Hi guys,
I'm dealing with Web Service and Basic Authentication.
I've a wsdl file which describes my WS and I've tried to modify it in order to handle the authentication.
Here's the code of my wsdl
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:DBSIS_Censimento"
xmlns="
http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="
http://xml.apache.org/xml-soap"
xmlns:impl="urn:DBSIS_Censimento"
xmlns:intf="urn:DBSIS_Censimento"
xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="
http://ejb.sa.sis.eng.it"
xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="
http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:sp="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
xmlns:wsp="
http://sun.com/ws/httpbc/security/BasicauthSecurityPolicy"
xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:mysp="
http://sun.com/ws/httpbc/security/BasicauthSecurityPolicy">
<types>
<schema targetNamespace="
http://ejb.sa.sis.eng.it" xmlns="
http://www.w3.org/2001/XMLSchema">
<import namespace="
http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="CensimentoException">
<sequence/>
</complexType>
</schema>
</types>
<message name="censisciSoggettoResponse">
<part name="censisciSoggettoReturn" type="xsd:string"/>
</message>
<message name="censisciSoggettoRequest">
<part name="in0" type="xsd:string"/>
</message>
<message name="CensimentoException">
<part name="fault" type="tns1:CensimentoException"/>
</message>
<portType name="Censimento">
<operation name="censisciSoggetto" parameterOrder="in0">
<input message="impl:censisciSoggettoRequest" name="censisciSoggettoRequest"/>
<output message="impl:censisciSoggettoResponse" name="censisciSoggettoResponse"/>
<fault message="impl:CensimentoException" name="CensimentoException"/>
</operation>
</portType>
<binding name="it.eng.sis.sa.webservices.impl.CensimentoImpl" type="impl:Censimento">
<wsdlsoap:binding style="rpc" transport="
http://schemas.xmlsoap.org/soap/http"/>
<operation name="censisciSoggetto">
<wsdlsoap:operation soapAction=""/>
<input name="censisciSoggettoRequest">
<wsdlsoap:body namespace="urn:DBSIS_Censimento" use="literal"/>
</input>
<output name="censisciSoggettoResponse">
<wsdlsoap:body namespace="urn:DBSIS_Censimento" use="literal"/>
</output>
<fault name="CensimentoException">
<wsdlsoap:fault name="CensimentoException" use="literal"/>
</fault>
</operation>
</binding>
<service name="CensimentoService">
<port binding="impl:it.eng.sis.sa.webservices.impl.CensimentoImpl" name="Censimento">
<wsdlsoap:address location="
http://nal-tix2.rete.toscana.it/cart/PD/SPCASL7Siena/SPCRegioneToscana/SPCCensimentoAnagrafico"/>
<wsp:PolicyReference URI="#HttpBasicAuthBindingBindingWssTokenPolicy"></wsp:PolicyReference>
</port>
</service>
<wsp:Policy wsu:Id="HttpBasicAuthBindingBindingWssTokenPolicy">
<mysp:MustSupportBasicAuthentication on="true">
<!-- authenticationType is one of simple, am, or realm -->
<mysp:BasicAuthenticationDetail>
<mysp:WssTokenCompare />
</mysp:BasicAuthenticationDetail>
</mysp:MustSupportBasicAuthentication>
<mysp:UsernameToken mysp:IncludeToken="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken10>MY_USER</sp:WssUsernameToken10>
<sp:WssPassword>MY_PASSWORD</sp:WssPassword>
</wsp:Policy>
</mysp:UsernameToken>
</wsp:Policy>
</definitions>
I'm missing something because when I try to invoke the WS, I get a message from the WS like "Missing Credentials"... so it seems that i'm not doing the right modifies...
Can anyone help me with my wsdl code?
Thanks in advance
PS: I'm trying the same wsdl file using SOAP-UI and i get the same result
Fabio
*** Where there is a Will, There is a Way ***