Hi,
I am using the correct tag in the configuration of synapse. The only problem is 
still netbeans. When I create the netbeans client, which must communicate 
securely with synapse, I give it the wsdl generated by synapse: 
http://localhost:8008/soap/CalculatorProxy?wsdl
To activate security in this client, the tag "wsp:UsingPolicy" seems to be 
needed by netbeans. But as the wsdl generated by synapse does not contain any 
security tag, it is not possible to configure any security aspects of the 
client in netbeans...
Here is the wsdl of the web service generated by netbeans and which is used in 
the synapse configuration within the tag:
<publishWSDL uri="file:repository/conf/CalculatorWSService.wsdl"/>
As you will see, the policy security of the web service is included in the wsdl 
file. I will try to find a way to import it from a file.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is 
JAX-WS RI 2.1.2-hudson-182-RC1. -->
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is 
JAX-WS RI 2.1.2-hudson-182-RC1. -->
<definitions 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
 xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:tns="http://service/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns="http://schemas.xmlsoap.org/wsdl/"; targetNamespace="http://service/"; 
name="CalculatorWSService">
<wsp:UsingPolicy/>
<wsp:Policy wsu:Id="CalculatorWSPortBindingPolicy">
<wsp:ExactlyOne>
<wsp:All>

<ns3:SignedSupportingTokens 
xmlns:ns3="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns3:UsernameToken 
ns3:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient";>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns3:WssUsernameToken10/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns3:UsernameToken>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns3:SignedSupportingTokens>
<ns4:SymmetricBinding 
xmlns:ns4="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns4:AlgorithmSuite>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns4:Basic128/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns4:AlgorithmSuite>
<ns4:IncludeTimestamp/>
<ns4:Layout>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns4:Strict/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns4:Layout>
<ns4:OnlySignEntireHeadersAndBody/>
<ns4:ProtectionToken>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns4:X509Token 
ns4:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never";>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns4:WssX509V3Token10/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns4:X509Token>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns4:ProtectionToken>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns4:SymmetricBinding>
<ns5:Wss11 xmlns:ns5="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<ns5:MustSupportRefEncryptedKey/>
<ns5:MustSupportRefIssuerSerial/>
<ns5:MustSupportRefKeyIdentifier/>
<ns5:MustSupportRefThumbprint/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</ns5:Wss11>
<ns6:UsingAddressing xmlns:ns6="http://www.w3.org/2006/05/addressing/wsdl"/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy wsu:Id="CalculatorWSPortBinding_multiply_Input_Policy">
<wsp:ExactlyOne>
<wsp:All>
<ns7:EncryptedParts 
xmlns:ns7="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<ns7:Body/>
</ns7:EncryptedParts>
<ns8:SignedParts 
xmlns:ns8="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<ns8:Body/>
<ns8:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="ReplyTo"/>
<ns8:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="To"/>
<ns8:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="From"/>
<ns8:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="MessageID"/>
<ns8:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
<ns8:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="Action"/>
<ns8:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="RelatesTo"/>
<ns8:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"; 
Name="AckRequested"/>
<ns8:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"; 
Name="Sequence"/>
<ns8:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"; 
Name="SequenceAcknowledgement"/>
</ns8:SignedParts>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy wsu:Id="CalculatorWSPortBinding_multiply_Output_Policy">
<wsp:ExactlyOne>
<wsp:All>
<ns9:EncryptedParts 
xmlns:ns9="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<ns9:Body/>
</ns9:EncryptedParts>
<ns10:SignedParts 
xmlns:ns10="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
<ns10:Body/>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="ReplyTo"/>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="To"/>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="From"/>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="MessageID"/>
<ns10:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="Action"/>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing"; Name="RelatesTo"/>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"; 
Name="AckRequested"/>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"; 
Name="Sequence"/>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"; 
Name="SequenceAcknowledgement"/>
</ns10:SignedParts>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<types>
<xsd:schema>
<xsd:import namespace="http://service/"; 
schemaLocation="http://localhost:8080/CalculatorService/CalculatorWSService?xsd=1"/>
</xsd:schema>
</types>
<message name="multiply">
<part name="parameters" element="tns:multiply"/>
</message>
<message name="multiplyResponse">
<part name="parameters" element="tns:multiplyResponse"/>
</message>
<portType name="CalculatorWS">
<operation name="multiply">
<input message="tns:multiply"/>
<output message="tns:multiplyResponse"/>
</operation>
</portType>
<binding name="CalculatorWSPortBinding" type="tns:CalculatorWS">
<wsp:PolicyReference URI="#CalculatorWSPortBindingPolicy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"; 
style="document"/>
<operation name="multiply">
<soap:operation soapAction=""/>
<input>
<wsp:PolicyReference URI="#CalculatorWSPortBinding_multiply_Input_Policy"/>
<soap:body use="literal"/>
</input>
<output>
<wsp:PolicyReference URI="#CalculatorWSPortBinding_multiply_Output_Policy"/>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="CalculatorWSService">
<port name="CalculatorWSPort" binding="tns:CalculatorWSPortBinding">
<soap:address 
location="http://localhost:8080/CalculatorService/CalculatorWSService"/>
</port>
</service>
</definitions>



Thanks!
Sihem

             
---------------------------------
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

Reply via email to