The integer value is lost when the web service is called

I have an application that calls a web service to retrieve the MSI URL depending on whether the user's computer is 32-bit or 64-bit.

The GetURLByOS call accepts 2 methods (1. line AuthenticationInfo, 2. int osBit). As I debug, I can see the authentication information. The osBit value is 8 (for 64 bits) when called to the web service. But its value is lost (0) when it is actually in the web service.

Can someone help me understand why the integer value is lost?

Update: I am joining the process. In the client, I see the value 8. 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 is the real web service:

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

BTW, when I change the parameter for line input, it gets the correct transmission (value "8"). This is only when I pass it as an integer whose value is reset to zero.

+6
source share
2 answers

I found out what the problem is. On the (client) WSDL code, the OsBitType parameter. But on the web service itself, the osBitType parameter. After changing the web service setting in OsBitType, it works fine.

Strange, this does not happen if the parameter is a string.

+3
source

In my situation, after the link to the web service update, it works fine.

+1
source

Source: https://habr.com/ru/post/902061/


All Articles