I have a SOAP based web service with an associated reference.cs file (not WCF). The service is returning an invalid response. The reference.cs file has a testRequest method that I would like to step into. I only have limited control of the service so I want to override the results[0] line with my own test response to try & determine the exact reason that the response is invalid. I can’t however, step into testRequest. Why not? what exactly is results[0]? I tried to do a cast on my own with the Soap XML in a string, but I get a message saying I can’t cast from a string to that object. What is results[0] at this point then if it is not a string?
[System.Web.Services.Protocols.SoapHeaderAttribute("SecurityValue")]
[System.Web.Services.Protocols.SoapHeaderAttribute("MessageHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("TestResponse", Namespace="http:/test/Services")]
public TestResponse testRequest([System.Xml.Serialization.XmlElementAttribute("TestRequest", Namespace="http://Test.com/TestServices")] TestRequestTestRequest1) {
object[] results = this.Invoke("TestRequest", new object[] {
TestRequest1});
return ((TestResponse)(results[0]));
}
UPDATE #1
You can step into response.cs by going to Tools => Options => Debugging => General &
unchecking “Enable Just My Code”. The issue is that the request gets to my PC, but the “results” variable is null after this.Invoke is called. My question now is how can I intercept the call that this.Invoke is making & insert my own response. I DON”T have developer access to the actual service. Maybe I need to write a test service…
I created a test service that just returned a hard-coded SOAP response. That helped me diagnose the problem with the response. The problem ended up being a missing namespace