I am trying to build a client that interacts with a 3rd party SOAP Web Service. This web service requires WSE Security.
I generated an old school .asmx web service from the WSDL of the Service I am trying to interact with. The WSDL has no information in it about WSE Security.
Without the WSE Security I can connect fine. However, I added WSE Security to my .asmx web service.
I added the following code to my client to add the WSE Username and Password
SoapContext requestContext = host.RequestSoapContext;
UsernameToken userToken = new UsernameToken("username", "password", PasswordOption.SendPlainText);
requestContext.Security.Tokens.Add(userToken);
However, now when I call the ProcessMessage method I get the following exception which doesn't tell me very much:
System.Web.Services.Protocols.SoapHeaderException: Server unavailable, please try later
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Reynolds.Core.STARProxy.STARWebService.ProcessMessage(Payload& payload) in C:\Projects\Reynolds.Core\Reynolds.Core\Web References\STARProxy\Reference.cs:line 105
at Reynolds.Core.reynolds.SendGenericXMLRequest(XmlElement[] inputElements, String url, Guid[] guids) in C:\Projects\Reynolds.Core\Reynolds.Core\Reynolds.cs:line 191
at Reynolds.Core.reynolds.SendGenericSingleXMLRequest(XmlElement inputXML, String url, Guid guid) in C:\Projects\Reynolds.Core\Reynolds.Core\Reynolds.cs:line 125
at Reynolds.Core.reynolds.SendGenericSingleXMLRequest(XmlElement inputXML, String url) in C:\Projects\Reynolds.Core\Reynolds.Core\Reynolds.cs:line 120
at Reynolds.Core.reynolds.SendGenericSingleXMLRequest(XmlElement inputXML) in C:\Projects\Reynolds.Core\Reynolds.Core\Reynolds.cs:line 114
at Reynolds.Testing.GUI.Form1.btnProcessMessage_Click(Object sender, EventArgs e) in C:\Projects\Reynolds.Testing\Reynolds.Testing.GUI\Form1.cs:line 33
The exception doesn't really give me much to work with here. I tried doing various Google searches but wasn't able to get anywhere.
This is my first time using WSE so any help would be appreciated.