Hi,
I am trying to utilise a web service that expects some additional info in the SOAP header.
I can discover and and add a reference to the web service but the Proxy class created does not deal with the extra header detail.
An example of the SOAP message expected is below:
If I call a webmethod at present, the SOAP (sniffed) looks like this:
As you can see, most of the required attributes are missing.
If it matters, I'm using C# 2.0. An snippet of the web service calling code is here:
I'm hoping there is a way to do this without constructing the entire header as a string and using MSXML but I'm not sure where to start.
Any help or pointers greatly appreciated!
"Just beacuse you're paranoid, don't mean they're not after you
I am trying to utilise a web service that expects some additional info in the SOAP header.
I can discover and and add a reference to the web service but the Proxy class created does not deal with the extra header detail.
An example of the SOAP message expected is below:
Code:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:wsa="[URL unfurl="true"]http://schemas.xmlsoap.org/ws/2004/08/addressing"[/URL] xmlns:wsse="[URL unfurl="true"]http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"[/URL] xmlns:wsu="[URL unfurl="true"]http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">[/URL]
<soap:Header>
<wsa:Action>[URL unfurl="true"]http://damasifa.unicorn.eu/wse/RunSynchrous</wsa:Action>[/URL]
<wsa:MessageID>urn:uuid:d4872b6c-c4fa-4330-a4df-926c46d2d17e</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>[URL unfurl="true"]http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>[/URL]
</wsa:ReplyTo>
<wsa:To>[URL unfurl="true"]http://damasifa-test.unicorn.eu/wse/DamasService.asmx</wsa:To>[/URL]
<wsse:Security soap:mustUnderstand="1">
<wsu:Timestamp wsu:Id="Timestamp-2f687a73-6cf8-4fc9-b5fc-2aaf91aa95eb">
<wsu:Created>2009-05-11T11:50:08Z</wsu:Created>
<wsu:Expires>2009-05-11T11:55:08Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="[URL unfurl="true"]http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"[/URL] wsu:Id="SecurityToken-48a23f89-ffa6-44b7-bcaf-1b67fc7a6e20">
<wsse:Username>XXXXXXXXX</wsse:Username>
<wsse:Password Type="[URL unfurl="true"]http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">X03MO1qnZdYdgyfeuILPmQ==</wsse:Password>[/URL]
<wsse:Nonce>4bt7c6LFwDJXeCObE//hoQ==</wsse:Nonce>
<wsu:Created>2009-05-11T11:50:08Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<RunSynchrous xmlns="[URL unfurl="true"]http://damasifa.unicorn.eu/wse">[/URL]
<Input>
<FID>GETDATETIME</FID>
<MessageHeader xsi:nil="true" />
<Parameters />
</Input>
</RunSynchrous>
</soap:Body>
</soap:Envelope>
If I call a webmethod at present, the SOAP (sniffed) looks like this:
Code:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"><soap:Body><RunSynchrous[/URL] xmlns="[URL unfurl="true"]http://damasifa.unicorn.eu/wse"><Input><FID>GETDATETIME</FID><MessageHeader[/URL] xsi:nil="true" /></Input></RunSynchrous></soap:Body></soap:Envelope>
As you can see, most of the required attributes are missing.
If it matters, I'm using C# 2.0. An snippet of the web service calling code is here:
Code:
Damas.DamasService svc = new DamasService();
svc.Proxy = new WebProxy("[URL unfurl="true"]http://myProxy:8080");[/URL]
InParams param = new InParams();
param.FID = "GETDATETIME";
OutParams op = svc.RunSynchrous(param);
I'm hoping there is a way to do this without constructing the entire header as a string and using MSXML but I'm not sure where to start.
Any help or pointers greatly appreciated!
"Just beacuse you're paranoid, don't mean they're not after you