views:

230

answers:

2

I need some help figuring out how to troubleshoot a problem with an ASP.Net 2 asmx webservice which seems to be ignoring incoming params.

I have an ASMX service that takes a string, does a little work with an SAP API, and returns the results of the operation as a string. It works fine in a dev environment, but fails in production because it seems not to receive the incoming params.

Here's a representative code snippet:

in the consuming code, "TextIdentifier" is a string that's passed in to the method that calls the web service

SAPProxyWebService.SAPProxyWebService webservice = new SAPProxyWebService.SAPProxyWebService();
return webservice.GetEncodedText( TextIdentifier );

the web method is declared as follows:

[WebMethod()]
public string GetEncodedText(string TextIDString)
{
   do some stuff with TextIDString;
   return results;
}

When I log the value of TextIdentifier within the method that's calling the web method I get the expected value. In fact, I see the expected input when I log it on the same line as the web method call.

However when I log the TextIDString param inside the webmethod, before any other operations, it's null. When I hard-code a particular value inside the web method I get the results I would expect for the hard-coded value.

What should I be looking for that would cause the web method to "lose" the incoming parameter?

+1  A: 

Have you tried using Fiddler? You should be able to look at the SOAP/whatever packets you have going on between the client and server.

Moron
good idea, but the consumer is actually a SQL Reporting Service report using a little component to handle the web service calls. The calls to the web service take place from the reporting services box and the web server box, so not easy to intermediate with Fiddler.
cori
A: 

So I'm not sure exactly what the root cause was, nor what aspect of my fix actually resolved the issue, but what I ended up doing that worked was to deploy the web service in a different location and point the client library at it there. I deployed the report (including the client library) up through our dev/testing architecture and everything worked fine. I then deployed the webservice back in it's original location and then the report and library up through the architecture and the report worked with the web service in its original location.

My suspicion is that perhaps the client library/report were using a cached version of the service definition. What doesn't make sense about that is that as I was modifying the service to log what was happening, the place in the code that was throwing the exception (a Null Reference Exception) would move, and the report would reflect the new location (i.e. line number) in the code where the same statement was being executed.

cori