axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Suriarachchi" <amilasuriarach...@gmail.com>
Subject Re: [axis2] wsdl with policy
Date Tue, 08 Jan 2008 05:46:54 GMT
On Jan 8, 2008 5:51 AM, Stephen Souness <sounie@hotmail.com> wrote:

> Does this mean that the client stubs generated by wsdl2java shouldn't be
> expected to include anything extra if the WSDL contains policy
> information?


yes.  A normal wsdl (lets say MS  interop wsdl) would only display standard
security policies.
obviously it does not know about the rampart specific things.
So you have to manually set those rampart specific things.

>
>
> The stubs that I have generated do not expose a getServiceContext() or
> _getServiceContext() method.
>
> The tutorial at:
> http://www.shellysaunders.co.uk/Blog/tabid/65/EntryID/2/Default.aspx
> looks promising, but also indicates the _getServiceContext() method
> should be present.
>
> Are you able to direct me to a simple complete example?

I am not aware of such. The code I showed to you I used to check this with
the
MS interop site.

>
>
> At the moment I have pieces from different sources that won't match up:
> - a WSDL file from http://131.107.72.15/ilab/ (which is no longer
> accessible)
> - the example Test class that was posted earlier
> - some somewhat vague instructions in the axis2 documentation
>
>
> --
> Stephen
>
>
>
> Amila Suriarachchi wrote:
> >
> >
> > On Jan 7, 2008 5:31 AM, Stephen Souness <sounie@hotmail.com
> > <mailto:sounie@hotmail.com>> wrote:
> >
> >     Do I need to provide a policy file, and if so how do I tell
> WSDL2Java
> >     where to look for it?
> >
> >
> > see the test java file I have given. you have to give the rampart
> > specific policy file to the stub.
> > normally in a wsdl file you get only the security policies.
> >
> > in this example it is give as an Policy object
> > CryptoConfig signcriptoInfo = new CryptoConfig();
> >         signcriptoInfo.setProvider(Merlin.class.getName());
> >         Properties properties = new Properties();
> >
> > properties.setProperty("
> org.apache.ws.security.crypto.merlin.keystore.type",
> > "JKS");
> >
> > properties.setProperty("org.apache.ws.security.crypto.merlin.file",
> > "security_client_wcf/conf/sec.jks");
> >
> > properties.setProperty("
> org.apache.ws.security.crypto.merlin.keystore.password",
> > "password");
> >         signcriptoInfo.setProp(properties);
> >
> >         CryptoConfig encriptcriptoInfo = new CryptoConfig();
> >         encriptcriptoInfo.setProp(properties);
> >         encriptcriptoInfo.setProvider(Merlin.class.getName());
> >
> >         RampartConfig config = new RampartConfig();
> >         config.setUser("alice");
> >         config.setEncryptionUser("bob");
> >         config.setPwCbClass("util.PasswordCallbackHandler");
> >         config.setSigCryptoConfig(signcriptoInfo);
> >         config.setEncrCryptoConfig(encriptcriptoInfo);
> >
> >         ramapConfigPolicy = new Policy();
> >         ramapConfigPolicy.addAssertion(config);
> >
> > but you may do the following as well using a policy file.
> >
> >   StAXOMBuilder builder = new StAXOMBuilder(SECURITY_POLICY_FILE);
> >         Policy securityPolicy =
> > PolicyEngine.getPolicy(builder.getDocumentElement());
> >
> >
> > serviceClient.getServiceContext().getConfigurationContext().setProperty(
> RampartMessageData.KEY_RAMPART_POLICY,
> > securityPolicy);
> >
> >
> > thanks,
> > Amila.
> >
> >
> >
> >
> >     Amila Suriarachchi wrote:
> >      > When you generate the code it adds the security policies to input
> and
> >      > output messages.
> >      > Here codegen tool normalize the policy and attached it as a
> string so
> >      > that runtime
> >      > it builds the policy from that.
> >      >
> >      > See the attached test case.
> >      >
> >      > Amila.
> >      >
> >      >
> >      >
> >      > On Dec 21, 2007 2:59 AM, Stephen Souness <sounie@hotmail.com
> >     <mailto:sounie@hotmail.com>
> >      > <mailto:sounie@hotmail.com <mailto:sounie@hotmail.com>>>
wrote:
> >      >
> >      >     Thanks for that Amila.
> >      >
> >      >     I've tried the following:
> >      >
> >      >     wsdl2java -pn A12Binding -o generated -uri C:\interop.wsdl
> >      >
> >      >
> >      >     I haven't noticed anything in the generated
> >     EchoServiceStub.java that
> >      >     deals with the X509 or other security aspects specified in
> the
> >      >     A12Binding_policy policy.
> >      >
> >      >     Is their some additional axis2 setup required?
> >      >
> >      >
> >      >     --
> >      >     Stephen
> >      >
> >      >
> >      >
> >      >     Amila Suriarachchi wrote:
> >      >      > see some security samples here
> >      >      > http://131.107.72.15/ilab/
> >      >      >
> >      >      > Amila
> >      >      >
> >      >      > On Dec 20, 2007 1:49 AM, Stephen Souness <
> >     sounie@hotmail.com <mailto:sounie@hotmail.com>
> >      >     <mailto:sounie@hotmail.com <mailto:sounie@hotmail.com>>
> >      >      > <mailto: sounie@hotmail.com <mailto:sounie@hotmail.com>
> >     <mailto:sounie@hotmail.com <mailto:sounie@hotmail.com>>>>
wrote:
> >      >      >
> >      >      >     Hi all,
> >      >      >
> >      >      >     Can anyone direct me to an example of a WSDL which
> >     includes valid
> >      >      >     policy
> >      >      >     references, which wsdl2java can interpret and generate
> an
> >      >     appropriate
> >      >      >     client stub from?
> >      >      >
> >      >      >     Alternatively, is there a better way to generate the
> >     client code?
> >      >      >
> >      >      >     --
> >      >      >     Stephen
> >      >      >
> >      >      >
> >      >      >
> >      >
> >
> ---------------------------------------------------------------------
> >      >      >     To unsubscribe, e-mail:
> >     axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>
> >      >     <mailto:axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>>
> >      >      >     <mailto: axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>
> >      >     <mailto:axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>>>
> >      >      >     For additional commands, e-mail:
> >     axis-user-help@ws.apache.org <mailto:axis-user-help@ws.apache.org>
> >      >     <mailto:axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>>
> >      >      >     <mailto: axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>
> >      >     <mailto:axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>>>
> >      >      >
> >      >      >
> >      >      >
> >      >      >
> >      >      > --
> >      >      > Amila Suriarachchi,
> >      >      > WSO2 Inc.
> >      >
> >      >
> >      >
> >
> ---------------------------------------------------------------------
> >      >     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>
> >      >     <mailto:axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>>
> >      >     For additional commands, e-mail: axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>
> >      >     <mailto:axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>>
> >      >
> >      >
> >      >
> >      >
> >      > --
> >      > Amila Suriarachchi,
> >      > WSO2 Inc.
> >      >
> >      >
> >      >
> >
> ------------------------------------------------------------------------
> >      >
> >      >
> ---------------------------------------------------------------------
> >      > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>
> >      > For additional commands, e-mail: axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>
> >
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >     <mailto:axis-user-unsubscribe@ws.apache.org>
> >     For additional commands, e-mail: axis-user-help@ws.apache.org
> >     <mailto:axis-user-help@ws.apache.org>
> >
> >
> >
> >
> > --
> > Amila Suriarachchi,
> > WSO2 Inc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Mime
View raw message