Hello,
I'm trying to access a webservice which runs on our SOAP Server (Apache
Tomcat) with Windows 2000 Advanced Server. I simply added the webreference
local copy of wsdl file into dotNet Application using dotNet's "Add Web
Reference" option. I am trying to execute a function using pieces of code as
follows;
----------------------------------
WebReference.MyService kkAPI = new WebReference.MyService();
kkAPI.Url = "http://abc.sample.com:8080/soap/servlet/rpcrouter"
try
{
string strResult = kkAPI.CloseHandle(dolXML);
MessageBox.Show(strResult);
}
catch (Exception dolError)
{
MessageBox.Show( "Error Source : "+dolError.Source+"\n"+
"Error Message : "+dolError.Message+"\n"+
"Inner Exception : "+dolError.InnerException+"\n"+
"Target Site : "+dolError.TargetSite+"\n");
}
------------------------------------
and dotNet raises an error as follows
------------------------------------
Error:
There is an error in XML document(6,47). System.InalidCastException:
Cannot assign object of type System.Boolean to an object of type
System.String at Microsoft.Xml.Serialization.GeneratedAssembly.
XmlSerializationReader1.Read3_OpenSessionResponse()
------------------------------------
while running a code in webReference that generated by dotNet as follows
------------------------------------
public string CloseHandle(string xml) {
object[] results = this.Invoke("CloseHandle", new object[] {xml});
return ((string)(results[0]));
}
------------------------------------
this code sends an xml to soap server as follows;
------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:testAPI"
xmlns:types="urn:testAPI/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:CloseHandle>
<xml xsi:type="xsd:string">
<request xmlns='urn:testAPI'>
<session id='15'/>
</request>
</xml>
</tns:CloseHandle>
</soap:Body>
</soap:Envelope>
------------------------------------
and soap server responses as follows;
------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:CloseHandle
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:testAPI">
<return xsi:type="xsd:boolean">true</return>
<xmlout xsi:type="xsd:string">
<?xml version="1.0" encoding="UTF-8"?>
<response>
<session id="1"/>
</response>
</xmlout>
</ns1:CloseHandle>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------
how can i handle this problem?
i know message is growed to much. :) i am sorry!
JGKjr - 17 Sep 2004 21:15 GMT
Did you figure this out yet? I'm having a similar problem going against a
Delphi web service. Looks like serialization issue maybe.
Jim
email me at: jgkennedy@mindspring.com is you know the answer.
Thanks
> Hello,
>
[quoted text clipped - 90 lines]
> how can i handle this problem?
> i know message is growed to much. :) i am sorry!