Visual Basic .Net + pear::soap
| From: | David Ramalho | Date: | Wed, 31 Jul 2002 01:32:20 +0000 |
| Subject: | Visual Basic .Net + pear::soap | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-177@lists.php.net to get a copy of this message | ||
Hi guys!! I wanted to know if any of you have had any experience
here ... I'm on the newbie side of the force right now, my wsdl seems to
work, but I'm having some trouble passing Array's , especially on the
type cast over on VB ... I'll give you an example
----------
Server Code
function LstPostIt( $dummy )
{
$lstPostit = mysql_query("Select id_postit , titulo_postit ,
dsc_postit , dt_postit from postit");
$result = Array();
while( $row = mysql_fetch_assoc( $lstPostit ) )
$result[] = new SOAP_Value( 'ArrayPostIt' ,
'{http://dgv/adminpro/Types}PostItObj' ,
array( new
SOAP_Value('id_postit','int', $row['id_postit']) , new
SOAP_Value('titulo_postit','string', $row['titulo_postit']) , new
SOAP_Value('dsc_postit','string', $row['dsc_postit']) , new
SOAP_Value('dt_postit','string', $row['dt_postit']) ) );
return new SOAP_Value( 'LstPostItResponse' ,
'{http://dgv/adminpro/Types}LstPostItResponse'
, $result ); }
----------
WSDL
<types>
<xsd:schema targetNamespace="http://dgv/adminpro/Types">
<xsd:complexType name="ArrayPostIt">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="PostIt" nillable="true" type="xsd0:PostItObj" />
</xsd:sequence>
<xsd:complexType name="PostItObj">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1"
name="id_postit" type="xsd:int"/>
<xsd:element minOccurs="0" maxOccurs="1"
name="titulo_postit" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1"
name="dsc_postit" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1"
name="dt_postit" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="ArrayPostIt">
<part name="list" type="xsd0:ArrayPostIt"/>
</message>
<operation name="LstString">
<input message="tns:DummyRequest"/>
<output message="tns:LstArrayOut"/>
</operation>
-----------
VB .Net
Dim ws As New WindowsApplication1.localhost2.Hello()
Dim result As WindowsApplication1.localhost2.LstPostItResponse =
ws.LstPostIt("oo")
Error -> System.InvalidOperationException: There is an error in XML
document (73, 101). ---> System.InvalidCastException: Cannot assign
object of type WindowsApplication1.localhost2.PostItObj[] to an object
of type WindowsApplication1.localhost2.LstPostItResponse.
-----------
SOAP Response
<ns5:LstPostItResponse>
<LstPostItResponse xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns4:PostItObj[12]" SOAP-ENC:offset="[0]">
<ArrayPostIt xsi:type="ns4:PostItObj">
<id_postit xsi:type="xsd:int">1</id_postit>
<titulo_postit
xsi:type="xsd:string">TextBox1</titulo_postit>
<dsc_postit
xsi:type="xsd:string">TextBox2</dsc_postit>
<dt_postit xsi:type="xsd:string">2005-05-20
00:00:00</dt_postit>
</ArrayPostIt>
---------------------------------------------
This is a long shot, and analyzing this code is very very hard .... I'm
just looking out for people who have some experience and can help me
understand exactly how and what arrays & objects get thrown around with
the SOAP :)
Thank you for your time, guys
David Ramalho