J
Jared
I'm trying to create a .NET client to consume a Java web service. The
company that owns the web service does not publish a WSDL, but they do
publish an API document with examples of each supported request and
its corresponding response.
I've manually created a WSDL file based on their examples, and
generated a proxy class using WSDL.EXE. The proxy class appears to
send a valid request because I can see a valid response coming back
using a network sniffer. However, when the proxy class calls
Invoke(), it returns an object[] of the correct length, but with each
element null.
------------------------------------------------------
Here's the SOAP response I'm getting from the server (some data
changed to protect the innocent):
<?xml version="1.0" encoding="UTF-8"?>
<?Some_Company_API version="1.0"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<m:TheResponse xmlns:m="Some API">
<element1 xsi:type="xsd:string">some data</element1>
<element2 xsi:type="xsd:string">some more data</element2>
</m:TheResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------
------------------------------------------------------
Here's the method of the proxy class I'm calling:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("element1")]
public string Login(string param1, string param2, string param3, out
string element2) {
object[] results = this.Invoke("Login", new object[] {
param1,
param2,
param3});
element2 = ((string)(results[1]));
return ((string)(results[0]));
}
------------------------------------------------------
If I analyze results[] in breakmode, it has a length of 2, but each
element is null.
Is there something special I need to do to the proxy class to get it
to read the returned data?
TIA
Jared
company that owns the web service does not publish a WSDL, but they do
publish an API document with examples of each supported request and
its corresponding response.
I've manually created a WSDL file based on their examples, and
generated a proxy class using WSDL.EXE. The proxy class appears to
send a valid request because I can see a valid response coming back
using a network sniffer. However, when the proxy class calls
Invoke(), it returns an object[] of the correct length, but with each
element null.
------------------------------------------------------
Here's the SOAP response I'm getting from the server (some data
changed to protect the innocent):
<?xml version="1.0" encoding="UTF-8"?>
<?Some_Company_API version="1.0"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<m:TheResponse xmlns:m="Some API">
<element1 xsi:type="xsd:string">some data</element1>
<element2 xsi:type="xsd:string">some more data</element2>
</m:TheResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------
------------------------------------------------------
Here's the method of the proxy class I'm calling:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("element1")]
public string Login(string param1, string param2, string param3, out
string element2) {
object[] results = this.Invoke("Login", new object[] {
param1,
param2,
param3});
element2 = ((string)(results[1]));
return ((string)(results[0]));
}
------------------------------------------------------
If I analyze results[] in breakmode, it has a length of 2, but each
element is null.
Is there something special I need to do to the proxy class to get it
to read the returned data?
TIA
Jared