0

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.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
jkruer01
  • 2,175
  • 4
  • 32
  • 57

1 Answers1

-1

The exception states Server unavailable, please try later. This means either you have the wrong URL for the 3rd party web service or the 3rd party server is down.

Richard Schneider
  • 34,944
  • 9
  • 57
  • 73
  • When I click on "Get general help for this exception" it says "The exception is thrown when an XML Web Service method is called over SOAP and an exception occurs during processing of the SOAP header. The service is available but is throwing an error somewhere/somehow. When I take out the WSE security it works fine. – jkruer01 Feb 08 '13 at 22:28