-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [EMAIL PROTECTED] wrote: > > Hi Sankat, Thanks for the response. I've been looking for a simple > example that adds a WS-Policy annotation (simple username/password > token stuff) to an existing WSDL (and will work with Axis2 > WSDL2JAVA to generate the appropriate skeletons/stubs). Would you > happen to have any pointers or examples of just what such an > annotation would look like?
I've attached a sample WSDL document that will help you to understand how to attach WS-Security policies to a WSDL. However I am not sure whether the defined policy is 100% correct since I am not a WS-Security domain expert. But my gut feeling is it is correct. HTH and keep posting if you find any issues .. Best, - --Sanka > > Thanks \Sarwar > > > > > *Sanka Samaranayke <[EMAIL PROTECTED]>* > > 02/12/2007 01:50 AM Please respond to [email protected] > > > > To [email protected] cc > > Subject Re: WSS4J & Axis2 > > > > > > > > > > Hi Sarwar, > > This is a scenario where you want to describes some additional > requirements of a service in a standard way s.t. client is able to > work with. WS Policy provides a standard, extensible framework for > describing such requirements and capabilities and WS-Security > Policy is an extension that describes WS Security requirements (or > capabilities) of a service. In this case all you need is to > construct a WS Security policy that describes the security > requirements of your service and attach it to your WSDL document. > > > If you use WSDL2Java to generate a stub using a policy annotated > WSDL, the stub will contain additional code to engage and configure > the required modules (In your case engage and configure Rampart > automatically). It will also contain additional methods to get the > required user inputs. > > e.g. > > stub.setUsername(...) stub.setUserPassword(..) > > > Please feel free to ask if you need further clarifications .. > > Best, --Sanka > > > > > > [EMAIL PROTECTED] wrote: > >> Hi all, Does the WSS4J (Rampart) support in Axis2 extend into the >> WSDL2JAVA tool? i.e.can I use WSDL2JAVA to emit client stubs that >> INCLUDE the required security tokens? > >> And how would I construct my WSDL to include WSS4J (or >> WS-Security in general) attributes? > >> My end goal is to use the WSDL as a design contract, so I need as >> much info as possible for client side programmers to be able to >> work with (generate stubs etc.) embedded in the WSDL. > >> Thanks \Sarwar > > > -- Sanka Samaranayake WSO2 Inc. > > http://sankas.blogspot.com/ http://www.wso2.org/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional commands, e-mail: [EMAIL PROTECTED] > > > > -- Sanka Samaranayake WSO2 Inc. > > http://sankas.blogspot.com/ http://www.wso2.org/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (GNU/Linux) iD8DBQFF00fU/Hd0ETKdgNIRAtrGAJ9PCcUQGyxskBE2WJqGahxSkzTekgCfV7Ke QRU8NcxUpEwfDCaxfRsIzvw= =8wqb -----END PGP SIGNATURE-----
<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions targetNamespace="http://example.com/ws/test" xmlns:tns="http://example.com/ws/test" xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsoap11="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" > <wsp:Policy wsu:Id="TestEndpoint" > <sp:SignedSupportingTokens> <wsp:Policy> <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" /> </wsp:Policy> </sp:SignedSupportingTokens> </wsp:Policy> <wsdl:types> <xs:schema targetNamespace="http://example.com/ws/test" blockDefault="#all" elementFormDefault="qualified" > <xs:element name="EchoRequest" type="xs:string" /> <xs:element name="EchoResponse" type="xs:string" /> </xs:schema> </wsdl:types> <wsdl:message name="EchoInMessage" > <wsdl:part name="Body" element="tns:EchoRequest" /> </wsdl:message> <wsdl:message name="EchoOutMessage" > <wsdl:part name="Body" element="tns:EchoResponse" /> </wsdl:message> <wsdl:portType name="Test" > <wsdl:operation name="Echo" > <wsdl:input message="tns:EchoInMessage" wsa:Action="http://example.com/ws/test/EchoRequest" /> <wsdl:output message="tns:EchoOutMessage" wsa:Action="http://example.com/ws/test/EchoResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="TestBinding" type="tns:Test" > <wsoap11:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsp:PolicyReference URI="#TestEndpoint" wsdl:required="true" /> <wsdl:operation name="Echo" > <wsoap11:operation soapAction="http://example.com/ws/test/EchoRequest" /> <wsdl:input> <wsoap11:body use="literal" /> </wsdl:input> <wsdl:output> <wsoap11:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Test" > <wsdl:port name="TestPort" binding="tns:TestBinding" > <wsoap11:address location="TBD" /> <wsa:EndpointReference> <wsa:Address>TBD</wsa:Address> </wsa:EndpointReference> </wsdl:port> </wsdl:service> </wsdl:definitions>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
