Note that there are some explanatory texts on larger screens.

plurals
  1. POSystem.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException
    text
    copied!<p>I've been getting the error:</p> <p>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException</p> <p>When I try to call my webservice using the following code:</p> <pre><code>{ //Create an echoSync request - set the services. ServiceNameType sourceService = new ServiceNameType {Service = "echoSync", OnBehalfOf = "Source"}; ServiceNameType destService = new ServiceNameType {Service = "echoSync", OnBehalfOf = "Destination"}; //Create the request. SDD2RequestType request = new SDD2RequestType { AppId = "echoSync", SourceService = sourceService, DestService = destService, RequestId = "1", RequestBody = "Ping" }; //Create the originator. originator originator = new originator {id = "123456789"}; //Create the transport. SDD2Transport transport = new SDD2Transport {originatorValue = originator}; //Send the request. SDD2ResponseType response = null; response = transport.SDD2TransportOp(request); //Write out the response. System.Console.WriteLine(response.ResponseBody.ToString()); } </code></pre> <p>My webservice method is quite simple and it looks like this:</p> <pre><code> [System.Web.Services.Protocols.SoapHeaderAttribute("originatorValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.InOut)] [System.Web.Services.WebMethodAttribute()] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://memberdirect.net/SDD2/Transport", RequestElementName = "SDD2Transport", RequestNamespace = "http://cucbc.com/sdd2/transport/", ResponseElementName = "SDD2TransportResponse", ResponseNamespace = "http://cucbc.com/sdd2/transport/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Default)] [return: System.Xml.Serialization.XmlElementAttribute("SDD2Response", Namespace = "http://cucbc.com/sdd2/")] public override SDD2ResponseType SDD2TransportOp(SDD2RequestType SDD2Request) { if (SDD2Request == null) throw new ArgumentNullException("SDD2Request"); var response = new SDD2ResponseType(); switch (SDD2Request.AppId) { case "echoSync": response.AppId = SDD2Request.AppId; response.ProcessingStatus = ProcessingStatusType.Complete; response.RequestId = SDD2Request.RequestId; response.ResponseBody = "Pong"; break; default: throw new System.NotImplementedException(); break; } return response; } </code></pre> <p>When I make the call I know the request is not NULL but when it arrives at the webservice it is always received as null. I generated the webservice from WSDL using the wsdl.exe utility and clearly I don't understand all the details of SOAP that I should. Has anyone else run into this issue?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload