开发者

ASMX Webservice dropping incoming parameters

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 strin开发者_JS百科g 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜