[Mono-bugs] [Bug 77297][Nor] New - stub generated from wsdl raises
InvalidCastException exception on a dynamic array transfered
by the webservice
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Jan 18 12:04:45 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by jmarbach at quelisid.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77297
--- shadow/77297 2006-01-18 12:04:45.000000000 -0500
+++ shadow/77297.tmp.15058 2006-01-18 12:04:45.000000000 -0500
@@ -0,0 +1,350 @@
+Bug#: 77297
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details: ubuntu 5.10
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Web.Services
+AssignedTo: lluis at ximian.com
+ReportedBy: jmarbach at quelisid.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: stub generated from wsdl raises InvalidCastException exception on a dynamic array transfered by the webservice
+
+Description of Problem:
+I've used gSOAP to build a webservice and generate the corresponding wsdl :
+***************************************************************************
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="quelisapi"
+ targetNamespace="urn:QuelisReader"
+ xmlns:tns="urn:QuelisReader"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:api="urn:QuelisReader"
+ xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
+ xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+<types>
+
+ <schema targetNamespace="urn:QuelisReader"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:api="urn:QuelisReader"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="unqualified"
+ attributeFormDefault="unqualified">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <simpleType name="boolean">
+ <restriction base="xsd:string">
+ <enumeration value="false"/>
+ <enumeration value="true"/>
+ </restriction>
+ </simpleType>
+ <complexType name="TagId">
+ <sequence>
+ <element name="uid" type="xsd:string" minOccurs="0" maxOccurs="1"
+nillable="true"/>
+ <element name="readings" type="xsd:int" minOccurs="1" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ <complexType name="TagIdArray">
+ <sequence>
+ <element name="item" type="api:TagId" minOccurs="0"
+maxOccurs="unbounded" nillable="true"/>
+ </sequence>
+ </complexType>
+ </schema>
+
+</types>
+
+<message name="getReaderConfig">
+</message>
+
+<message name="ReaderConfig">
+ <part name="name" type="xsd:string"/>
+ <part name="version" type="xsd:string"/>
+ <part name="interrogators" type="xsd:int"/>
+ <part name="multiplex" type="xsd:int"/>
+ <part name="inputs" type="xsd:int"/>
+ <part name="outputs" type="xsd:int"/>
+ <part name="scanningTime" type="xsd:int"/>
+ <part name="ready" type="xsd:boolean"/>
+ <part name="scanning" type="xsd:boolean"/>
+</message>
+
+<message name="setScanningTimeRequest">
+ <part name="scanningTime" type="xsd:int"/>
+</message>
+
+<message name="setScanningTimeResponse">
+ <part name="return" type="xsd:boolean"/>
+</message>
+
+<message name="getReaderStatusRequest">
+</message>
+
+<message name="getReaderStatusResponse">
+ <part name="return" type="xsd:boolean"/>
+</message>
+
+<message name="startScanningRequest">
+</message>
+
+<message name="startScanningResponse">
+ <part name="return" type="xsd:boolean"/>
+</message>
+
+<message name="stopScanningRequest">
+</message>
+
+<message name="stopScanningResponse">
+ <part name="return" type="xsd:boolean"/>
+</message>
+
+<message name="getTagIdList">
+ <part name="blocking" type="xsd:boolean"/>
+ <part name="timeout" type="xsd:long"/>
+</message>
+
+<message name="TagIdList">
+ <part name="tagIdArray" type="api:TagIdArray"/>
+ <part name="scanning" type="xsd:boolean"/>
+</message>
+
+<portType name="quelisapiPortType">
+ <operation name="getReaderConfig">
+ <documentation>Service definition of function
+api__getReaderConfig</documentation>
+ <input message="tns:getReaderConfig"/>
+ <output message="tns:ReaderConfig"/>
+ </operation>
+ <operation name="setScanningTime">
+ <documentation>Service definition of function
+api__setScanningTime</documentation>
+ <input message="tns:setScanningTimeRequest"/>
+ <output message="tns:setScanningTimeResponse"/>
+ </operation>
+ <operation name="getReaderStatus">
+ <documentation>Service definition of function
+api__getReaderStatus</documentation>
+ <input message="tns:getReaderStatusRequest"/>
+ <output message="tns:getReaderStatusResponse"/>
+ </operation>
+ <operation name="startScanning">
+ <documentation>Service definition of function
+api__startScanning</documentation>
+ <input message="tns:startScanningRequest"/>
+ <output message="tns:startScanningResponse"/>
+ </operation>
+ <operation name="stopScanning">
+ <documentation>Service definition of function
+api__stopScanning</documentation>
+ <input message="tns:stopScanningRequest"/>
+ <output message="tns:stopScanningResponse"/>
+ </operation>
+ <operation name="getTagIdList">
+ <documentation>Service definition of function
+api__getTagIdList</documentation>
+ <input message="tns:getTagIdList"/>
+ <output message="tns:TagIdList"/>
+ </operation>
+</portType>
+
+<binding name="quelisapi" type="tns:quelisapiPortType">
+ <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getReaderConfig">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="setScanningTime">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="getReaderStatus">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="startScanning">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="stopScanning">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="getTagIdList">
+ <SOAP:operation style="rpc" soapAction=""/>
+ <input>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <SOAP:body use="encoded" namespace="urn:QuelisReader"
+encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+</binding>
+
+<service name="quelisapi">
+ <documentation>gSOAP 2.7.6c generated service definition</documentation>
+ <port name="quelisapi" binding="tns:quelisapi">
+ <SOAP:address location="http://api.quelisid.com"/>
+ </port>
+</service>
+
+</definitions>
+**************************************************************************
+
+From this wsdl I've created a client stub with Mono "wsdl" tools. When
+using this stub class a System.InvalidCastException is raised when the stub
+remote function getTagIdList is called. Note that all other remote
+functions work without a glitch.
+
+The transfered object in the getTagIdList fuction is a "dynamic array of
+struct" ("TagIdList" in the wsdl file). This kind of object seems to be
+poorly supportded in SOAP implementations other than gSOAP.
+
+I've also generated the stub with MS.Net tools. The MS.Net generated class
+was simmilar but raised no exception. On the other hand MS.Net generated
+stub did not receive the array correctly either, it always receive a null
+array but the "scanning" parameter is received correctly.
+
+I've sniffed the HTTP packets during the array transfert and I've seen that
+the array seems to be correcty serialised and is not empty :
+**************************************************************************
+0000 00 0e a6 9e 8a 6a 00 14 fb 00 00 33 08 00 45 00 .....j.. ...3..E.
+0010 03 e0 4a 6b 40 00 40 06 68 28 c0 a8 01 ea c0 a8 ..Jk at .@. h(......
+0020 01 4a 1f 90 e1 e0 78 9e d1 5a ed 97 c4 f2 80 18 .J....x. .Z......
+0030 0f 80 56 0f 00 00 01 01 08 0a 00 7e 9b 24 05 3c ..V..... ...~.$.<
+0040 06 57 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f .WHTTP/1 .1 200 O
+0050 4b 0d 0a 53 65 72 76 65 72 3a 20 67 53 4f 41 50 K..Serve r: gSOAP
+0060 2f 32 2e 37 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 /2.7..Co ntent-Ty
+0070 70 65 3a 20 74 65 78 74 2f 78 6d 6c 3b 20 63 68 pe: text /xml; ch
+0080 61 72 73 65 74 3d 75 74 66 2d 38 0d 0a 43 6f 6e arset=ut f-8..Con
+0090 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 38 32 33 tent-Len gth: 823
+00a0 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 63 6c ..Connec tion: cl
+00b0 6f 73 65 0d 0a 0d 0a 3c 3f 78 6d 6c 20 76 65 72 ose....< ?xml ver
+00c0 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 sion="1. 0" encod
+00d0 69 6e 67 3d 22 55 54 46 2d 38 22 3f 3e 0a 3c 53 ing="UTF -8"?>.<S
+00e0 4f 41 50 2d 45 4e 56 3a 45 6e 76 65 6c 6f 70 65 OAP-ENV: Envelope
+00f0 20 78 6d 6c 6e 73 3a 53 4f 41 50 2d 45 4e 56 3d xmlns:S OAP-ENV=
+0100 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e "http:// schemas.
+0110 78 6d 6c 73 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 xmlsoap. org/soap
+0120 2f 65 6e 76 65 6c 6f 70 65 2f 22 20 78 6d 6c 6e /envelop e/" xmln
+0130 73 3a 53 4f 41 50 2d 45 4e 43 3d 22 68 74 74 70 s:SOAP-E NC="http
+0140 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 6d 6c 73 6f ://schem as.xmlso
+0150 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e 63 6f ap.org/s oap/enco
+0160 64 69 6e 67 2f 22 20 78 6d 6c 6e 73 3a 78 73 69 ding/" x mlns:xsi
+0170 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e ="http:/ /www.w3.
+0180 6f 72 67 2f 32 30 30 31 2f 58 4d 4c 53 63 68 65 org/2001 /XMLSche
+0190 6d 61 2d 69 6e 73 74 61 6e 63 65 22 20 78 6d 6c ma-insta nce" xml
+01a0 6e 73 3a 78 73 64 3d 22 68 74 74 70 3a 2f 2f 77 ns:xsd=" http://w
+01b0 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31 2f 58 ww.w3.or g/2001/X
+01c0 4d 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a MLSchema " xmlns:
+01d0 61 70 69 3d 22 75 72 6e 3a 51 75 65 6c 69 73 52 api="urn :QuelisR
+01e0 65 61 64 65 72 22 3e 3c 53 4f 41 50 2d 45 4e 56 eader">< SOAP-ENV
+01f0 3a 42 6f 64 79 20 53 4f 41 50 2d 45 4e 56 3a 65 :Body SO AP-ENV:e
+0200 6e 63 6f 64 69 6e 67 53 74 79 6c 65 3d 22 68 74 ncodingS tyle="ht
+0210 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 6d 6c tp://sch emas.xml
+0220 73 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e soap.org /soap/en
+0230 63 6f 64 69 6e 67 2f 22 3e 3c 61 70 69 3a 54 61 coding/" ><api:Ta
+0240 67 49 64 4c 69 73 74 3e 3c 74 61 67 49 64 41 72 gIdList> <tagIdAr
+0250 72 61 79 3e 3c 69 74 65 6d 3e 3c 75 69 64 3e 30 ray><ite m><uid>0
+0260 78 30 31 30 30 30 30 30 35 44 37 46 32 45 44 42 x0100000 5D7F2EDB
+0270 44 3c 2f 75 69 64 3e 3c 72 65 61 64 69 6e 67 73 D</uid>< readings
+0280 3e 31 3c 2f 72 65 61 64 69 6e 67 73 3e 3c 2f 69 >1</read ings></i
+0290 74 65 6d 3e 3c 69 74 65 6d 3e 3c 75 69 64 3e 30 tem><ite m><uid>0
+02a0 78 30 31 30 30 30 30 30 35 44 38 43 35 42 42 33 x0100000 5D8C5BB3
+02b0 37 3c 2f 75 69 64 3e 3c 72 65 61 64 69 6e 67 73 7</uid>< readings
+02c0 3e 31 3c 2f 72 65 61 64 69 6e 67 73 3e 3c 2f 69 >1</read ings></i
+02d0 74 65 6d 3e 3c 69 74 65 6d 3e 3c 75 69 64 3e 30 tem><ite m><uid>0
+02e0 78 30 31 30 30 30 30 30 35 44 41 35 45 45 46 38 x0100000 5DA5EEF8
+02f0 37 3c 2f 75 69 64 3e 3c 72 65 61 64 69 6e 67 73 7</uid>< readings
+0300 3e 31 3c 2f 72 65 61 64 69 6e 67 73 3e 3c 2f 69 >1</read ings></i
+0310 74 65 6d 3e 3c 69 74 65 6d 3e 3c 75 69 64 3e 30 tem><ite m><uid>0
+0320 78 30 31 30 30 30 30 30 35 44 41 42 37 38 33 38 x0100000 5DAB7838
+0330 30 3c 2f 75 69 64 3e 3c 72 65 61 64 69 6e 67 73 0</uid>< readings
+0340 3e 31 3c 2f 72 65 61 64 69 6e 67 73 3e 3c 2f 69 >1</read ings></i
+0350 74 65 6d 3e 3c 69 74 65 6d 3e 3c 75 69 64 3e 30 tem><ite m><uid>0
+0360 78 30 31 30 30 30 30 30 35 44 42 31 46 38 34 35 x0100000 5DB1F845
+0370 33 3c 2f 75 69 64 3e 3c 72 65 61 64 69 6e 67 73 3</uid>< readings
+0380 3e 31 3c 2f 72 65 61 64 69 6e 67 73 3e 3c 2f 69 >1</read ings></i
+0390 74 65 6d 3e 3c 2f 74 61 67 49 64 41 72 72 61 79 tem></ta gIdArray
+03a0 3e 3c 73 63 61 6e 6e 69 6e 67 3e 74 72 75 65 3c ><scanni ng>true<
+03b0 2f 73 63 61 6e 6e 69 6e 67 3e 3c 2f 61 70 69 3a /scannin g></api:
+03c0 54 61 67 49 64 4c 69 73 74 3e 3c 2f 53 4f 41 50 TagIdLis t></SOAP
+03d0 2d 45 4e 56 3a 42 6f 64 79 3e 3c 2f 53 4f 41 50 -ENV:Bod y></SOAP
+03e0 2d 45 4e 56 3a 45 6e 76 65 6c 6f 70 65 3e -ENV:Env elope>
+**************************************************************************
+
+Steps to reproduce the problem:
+1. Generate the gSOAP webservice and wsdl file
+2. Generate the stub from the wsdl file with Mono "wsdl" utility
+3. Call the getTagIdList remote method
+
+Actual Results:
+System.InvalidCastException raised while receiving a dynamic array of struct.
+
+Expected Results:
+Receiving correctly this kind of serialized objects.
+
+How often does this happen?
+Each time I call the problematic remote funciton
+
+Additional Information:
+
+To investigate on the point I would suggest to create a simple webservice
+with a remote function returning a "dynamic array of struct" similar to
+mine and studdy how the Mono generated Stub deserializes it.
+
+This pb may also come from a bad interoperablility between gSOAP and Mono
+SOAP for this kind of objects. The folliwing link summarizes the
+interoperability between gSOAP and other SOAP implementations :
+http://www.cs.fsu.edu/~engelen/interop11/interop2results.html.
More information about the mono-bugs
mailing list