There is one potential issue with the preceding code: The data types for the parameters sent to the Web Service are not provided. Unfortunately, some Web Service implementations require this information to work. Most notably, some .NET Web Services do not work without this information. It is hard to say who is to blame for that, Microsoft or Mozilla, but at least there is a way to make these two systems cooperate. To do so, you have to change the way the parameters are created. After instantiating the SOAPCall class, you have to load the correct encoding for each parameter. In the example, the data type used is integer, so that's what we are using. The parameters array is now created in the following fashion: Calling a Web Service with Distinctive Data Types from Mozilla (webservice-mozilla-php.html; excerpt)
Tip First, see whether the Web Service works without this extra encoding. Older Mozilla versions do not support the getAssociatedEncoding() method, whereas some newer versions manage to cooperate with certain .NET Web Services without the extra step of providing the data type. |