RE: [SOAP] Help with .NET client
| From: | Alok K. Dhir | Date: | Thu, 17 Jul 2003 03:05:34 +0000 |
| Subject: | RE: [SOAP] Help with .NET client | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-836@lists.php.net to get a copy of this message | ||
Thanks for pointing that out - I have made the change you suggested.
Will let you know what I find out.
> -----Original Message-----
> From: Dmitri Vinogradov [mailto:dv@allyoucanthink.de]
> Sent: Wednesday, July 16, 2003 6:07 PM
> To: soap@lists.php.net
> Subject: Re: [SOAP] Help with .NET client
>
>
> Hi
>
> in major & minor you refer to non-xsd type (array)
>
> Please define at first:
>
> $this->__typedef['ArrayOfStrings'] =
> array(
> array('item'=>'string')
> );
> and then your StudentObject :
>
> $this->__typedef['StudentObject'] = array(
> ...
> 'major' => '{yournamespacehere}ArrayOfStrings',
> 'minor' => '{yournamespacehere}ArrayOfStrings',
> ...
> );
>
> Regards
> DV
>
>
>
>
>
>
> "Alok K. Dhir" <adhir@symplicity.com> schrieb im Newsbeitrag
> news:000401c34bdf$6992bb80$db01a8c0@rock...
> I also had to remove the trailing "/" in SCHEMA_SOAP_HTTP. I
> posted about
> this in a message a few weeks back. I believe this should be
> changed in cvs
> as a look around confirms that other SOAP implementations
> don't use/want the
> slash either.
>
> My typedef is defined as follows:
>
> $this->__typedef['StudentObject'] = array(
> 'student_id' => 'string',
> 'school_student_id' => 'string',
> 'fullname' => 'string',
> 'fname' => 'string',
> 'mi' => 'string',
> 'lname' => 'string',
> 'email' => 'string',
> 'ss_number' => 'string',
> 'gender' => 'string',
> 'birthdate' => 'string',
> 'permanent_street' => 'string',
> 'permanent_city' => 'string',
> 'permanent_state' => 'string',
> 'permanent_zip' => 'string',
> 'permanent_country' => 'string',
> 'street' => 'string',
> 'city' => 'string',
> 'state' => 'string',
> 'zip' => 'string',
> 'country' => 'string',
> 'account_disabled_flag' => 'string',
> 'account_blocked_flag' => 'string',
> 'major' => 'array',
> 'minor' => 'array',
> 'graduation_date' => 'string',
> 'year' => 'string',
> 'gpa' => 'string',
> 'program_type' => 'string',
> 'work_authorization' => 'string',
> 'degree_level' => 'string',
> 'receive_email_flag' => 'string',
> 'resume_book_flag' => 'string',
> 'logins' => 'string',
> 'lastlogin' => 'string'
> );
>
> I wonder if the problem might be in the client code in the
> .net application.
> Can you provide any details regarding what you had to do on
> that end in
> order to get it working?
>
> Thanks for responding - at least I know it can be done!
>
> > -----Original Message-----
> > From: Javier Muniz [mailto:jmuniz@granicus.com]
> > Sent: Wednesday, July 16, 2003 4:53 PM
> > To: 'Alok K. Dhir'; 'SOAP'
> > Subject: RE: [SOAP] Help with .NET client
> >
> >
> > I have successfully consumed a PHP SOAP webservice from a
> > .NET client using
> > 0.7.5 after changing the SCHEMA_SOAP_HTTP (removing the
> trailing /) in
> > Base.php.
> >
> > The only difference I can find in the provided WSDL and the
> > one that I am
> > using is that my schema targetNamespace is
> > "http://granicus.com/xsd" rather
> > than "urn:CSM_Student_API".
> >
> > Can you past your __typedef declaration?
> >
> > -Javier
> >
> > -----Original Message-----
> > From: Alok K. Dhir [mailto:adhir@symplicity.com]
> > Sent: Wednesday, July 16, 2003 12:42 PM
> > To: 'SOAP'
> > Subject: RE: [SOAP] Help with .NET client
> >
> >
> > It should be noted that the methods that return simple types
> > work fine from
> > the .NET client using the same PHP SOAP server.
> >
> > > -----Original Message-----
> > > From: Alok K. Dhir [mailto:adhir@symplicity.com]
> > > Sent: Wednesday, July 16, 2003 3:13 PM
> > > To: 'SOAP'
> > > Subject: [SOAP] Help with .NET client
> > >
> > >
> > >
> > > Hey all - I need help with a .NET SOAP client consuming my
> > > PHP SOAP web
> > > service.
> > >
> > > My SOAP server returns a "StudentObject" based on an ID
> > > passed to one of
> > > it's methods. The WSDL can be seen at
> > >
> > > http://csm-demo.symplicity.com/ws/student_api.php?wsdl.
> > >
> > > I am having no issue with a simple PHP script I wrote to
> > > "getStudentBySchoolID", but when my client's .NET
> > application tries to
> > > get it, he gets an error from his XML parser (the error message
> > > is provided
> > > below, under the getwire output).
> > >
> > > I ran the PHP SOAP client with trace on and I have attached
> > > the output of
> > > __getwire() (presumably exactly the same as what the .NET
> > > client gets and
> > > chokes on.
> > >
> > > Any pointers would be greatly appreciated.
> > >
> > > Al
> > >
> > >
> > > Output from __getwire() in PHP SOAP client
> > > ------------------------------------------
> > > HTTP/1.1 200 OK
> > > Date: Wed, 16 Jul 2003 19:03:03 GMT
> > > Server: Apache
> > > X-Powered-By: PHP/4.3.2
> > > X-Accelerated-By: PHPA/1.3.3r2
> > > Set-Cookie: PHPSESSID=38c4b2794a592f879038ac2aa6337b39; path=/
> > > Expires: Thu, 19 Nov 1981 08:52:00 GMT
> > > Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> > > pre-check=0
> > > Pragma: no-cache
> > > Status: 200 OK
> > > Content-Length: 2385
> > > Connection: close
> > > Content-Type: text/xml; charset=UTF-8
> > >
> > > <?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"
> > >
> > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:ns4="urn:CSM_Student_API"
> > >
>
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> > > <SOAP-ENV:Body>
> > >
> > > <ns4:getAsObjectBySchoolIDResponse>
> > > <StudentObject xsi:type="ns4:StudentObject">
> > > <student_id
> > >
> xsi:type="xsd:string">5eb58d1c4a183e1dec8e6cc3096939eb</student_id>
> > > <fullname xsi:type="xsd:string">Paul Andrews</fullname>
> > > <fname
> > > xsi:type="xsd:string">Paul</fname>
> > > <mi xsi:type="xsd:string">T</mi>
> > > <lname xsi:type="xsd:string">Andrews</lname>
> > > <email xsi:type="xsd:string">paul_andrews@bsu.edu</email>
> > > <ss_number xsi:type="xsd:string">
> > > </ss_number>
> > > <gender xsi:type="xsd:string">
> > > </gender>
> > > <birthdate xsi:type="xsd:string">
> > > </birthdate>
> > > <permanent_street xsi:type="xsd:string">1723 N Picolo
> > > Avenue</permanent_street> <permanent_city
> > xsi:type="xsd:string">Salt
> > > Lake City</permanent_city> <permanent_state
> > > xsi:type="xsd:string">UT</permanent_state>
> > > <permanent_zip xsi:type="xsd:string">89104</permanent_zip>
> > > <permanent_country xsi:type="xsd:string">US</permanent_country>
> > > <street xsi:type="xsd:string">785 Wayne Street
> > > Apt. 541</street>
> > > <city xsi:type="xsd:string">College Mountain</city>
> > > <state xsi:type="xsd:string">CO</state>
> > > <zip xsi:type="xsd:string">54789</zip>
> > > <country xsi:type="xsd:string">US</country>
> > > <account_disabled_flag
> > xsi:type="xsd:string">0</account_disabled_flag>
> > > <account_blocked_flag
> xsi:type="xsd:string">0</account_blocked_flag>
> > > <major>
> > > <item xsi:type="xsd:string">Arts & Sciences</item>
> > > <item xsi:type="xsd:string">Addition</item>
> > > </major>
> > > <minor/>
> > > <graduation_date
> xsi:type="xsd:string">2003-03-01</graduation_date>
> > > <year xsi:type="xsd:string">4</year>
> > > <gpa xsi:type="xsd:string">3.95</gpa>
> > > <program_type xsi:type="xsd:string">Career</program_type>
> > > <work_authorization
> > > xsi:type="xsd:string">1</work_authorization>
> > > <degree_level xsi:type="xsd:string">2</degree_level>
> > > <receive_email_flag
> > > xsi:type="xsd:string">1</receive_email_flag>
> > > <resume_book_flag xsi:type="xsd:string">1</resume_book_flag>
> > > <logins/>
> > > <lastlogin/>
> > > <password/>
> > > </StudentObject>
> > > </ns4:getAsObjectBySchoolIDResponse>
> > > </SOAP-ENV:Body>
> > > </SOAP-ENV:Envelope>
> > >
> > >
> > >
> > > Error from .NET XML parser
> > > ---------------------------
> > > System.InvalidOperationException: There is an error in XML
> > > document (36,
> > > 2). ---> System.Xml.XmlException: 'Element' is an invalid
> node type.
> > > Line 36, position 2. at System.Xml.XmlReader.ReadEndElement() at
> > >
> System.Xml.Serialization.XmlSerializationReader.ReadEndElement() at
> > >
> System.Xml.Serialization.XmlSerializationReader.ReadStringValue() at
> > > System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimi
> > > tive(XmlQu
> > > alifiedName type, Boolean elementCanBeType) at
> > > System.Xml.Serialization.XmlSerializationReader.ReadReferencin
> > > gElement(S
> > > tring name, String ns, Boolean elementCanBeType, String&
> > > fixupReference)
> > > at
> > > System.Xml.Serialization.XmlSerializationReader.ReadReferencin
> > > gElement(S
> > > tring name, String ns, String& fixupReference) at
> > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerialization
> > > Reader1.Re
> > > ad1_StudentObject() at
> > > System.Xml.Serialization.XmlSerializationReader.ReadReferencin
> > > gElement(S
> > > tring name, String ns, Boolean elementCanBeType, String&
> > > fixupReference)
> > > at
> > > System.Xml.Serialization.XmlSerializationReader.ReadReferencin
> > > gElement(S
> > > tring name, String ns, String& fixupReference) at
> > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerialization
> > > Reader1.Re
> > > ad8_getAsObjectBySchoolIDResponse() --- End of inner
> exception stack
> > > trace --- at
> > > System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
> > > xmlReader)
> > > at
> > > System.Web.Services.Protocols.SoapHttpClientProtocol.ReadRespo
> > > nse(SoapCl
> > > ientMessage message, WebResponse response, Stream
> responseStream) at
> > > System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> > > methodName, Object[] parameters) at
> > > com.symplicity.csm_demo.CSM_Student_APIService.getAsObjectBySc
> > > hoolID(Str
> > > ing id) in c:\inetpub\wwwroot\career\Web
> > > References\com.symplicity.csm-demo\Reference.vb:line 60 at
> > > webServiceTest.Page_Load(Object sender, EventArgs e) in
> > > c:\inetpub\wwwroot\career\student\webServiceTest.aspx.vb:line 76
> > >
> > > Alok K. Dhir
> > > adhir@symplicity.com
> > > Symplicity Corporation
> > > http://solutions.symplicity.com/
> > > 703-351-6987
> > >
> > >
> > > --
> > > PHP Soap Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > PHP Soap Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>