Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2004

Tip: Looking for answers? Try searching our database.

Problem with dotNet & APACHE & Tomcat (System.InalidCastException)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
citnamor - 06 Aug 2004 11:07 GMT
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">
               &lt;request xmlns='urn:testAPI'&gt;
                   &lt;session id='15'/&gt;
               &lt;/request&gt;
       </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=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
 <response>
     <session id=&quot;1&quot;/>
 </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!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.