Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integer value is lost in web service call

I have an application that makes a web service call to get the URL of an MSI depending on whether the user's computer is 32bit or 64bit.

The call GetURLByOS takes 2 methods (1. string AuthenticationInfo , 2. int osBit). As I'm debugging, I can see the authentication info. The osBit's value is 8 (for 64bit) when calling into the web service. But its value is lost (0) when actually in the web service.

Can someone help me figure out why the integer value is lost?

Update: I'm attaching to the process. In the client, I see value 8 being passed in. In the web service call, I see 0. This is a SOAP web service call. Here's the WSDL code on the client:

    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://mydomain.com/product/1.0/GetURLByOs", RequestNamespace = "http://mydomain.com/product/1.0", ResponseNamespace = "http://mydomain/product/1.0", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetURLByOs(string eTicket, int OsBitType)
        {
            object[] results = this.Invoke("GetURLByOs", new object[] {
                        eTicket, OsBitType});
            return ((string)(results[0]));
        }

Here's the actual web service:

    [WebMethod]
        public string GetURLByOs(string eTicket, int osBitType)
        {
            return MyFacade.GetUrl(eTicket, osBitType);
        }

BTW, when I change the parameter to type string, it gets passed properly (value "8"). It's only when I pass it as an integer that the value is zeroed out.

like image 842
Monkey Avatar asked Nov 21 '11 21:11

Monkey


1 Answers

I found out what was the problem. On the (client) WSDL code, the parameter is OsBitType. But on the actual web service, the parameter is osBitType. After changing the web service parameter to OsBitType, it's working fine.

Strange thing is, this doesn't occur if the parameter is a string.

like image 150
Monkey Avatar answered Oct 11 '22 23:10

Monkey