When posting to an Ensemble Web Service I get the following SOAP fault. Seems like I remember seeing this before but I don’t remember the solution.
<?xml version='1.0' encoding='UTF-8' standalone='no' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema' xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" >
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>wsse:FailedAuthentication</faultcode>
<faultstring>The security token could not be authenticated or authorized</faultstring>
<detail></detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is the SOAP that I post:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema" >
<SOAP-ENV:Body>
<LabResults>
<id>2</id>
</LabResults>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Thanks,
Randy L Stewart
In your client instantiation, try setting the Username and Password properties prior to invoking the web method.
Luca's example is for when you are using the SOAP Client Wizard against a WSDL.
Kim