2009年6月5日星期五

[fw-webservices] Talking to a .Net SOAP server

I would like to find examples of using ZendFramework to create a PHP5 client connecting to a .Net web services server, using SOAP, that provides database services and returns Complex (and otherwise self? described) data.  I have a working client so long as I constrain my access to methods only using less complex types. I need to make use of more complex types to get the performance where we need it to be.  My specific need is access a method described by the wsdl as: 
<s:element name="GetLoginRowFromName">     <s:complexType>         <s:sequence>             <s:element minOccurs="0" maxOccurs="1" name="loginName" type="s:string"/>             <s:element minOccurs="0" maxOccurs="1" name="ds">                 <s:complexType>                     <s:sequence>                         <s:element ref="s:schema"/>                         <s:any/>                     </s:sequence>                 </s:complexType>             </s:element>             <s:element minOccurs="0" maxOccurs="1" name="status" type="s:string"/>         </s:sequence>     </s:complexType> </s:element> <s:element name="GetLoginRowFromNameResponse">     <s:complexType>         <s:sequence>             <s:element minOccurs="0" maxOccurs="1" name="ds">                 <s:complexType>                     <s:sequence>                         <s:element ref="s:schema"/>                         <s:any/>                     </s:sequence>                 </s:complexType>             </s:element>             <s:element minOccurs="0" maxOccurs="1" name="status" type="s:string"/>         </s:sequence>     </s:complexType>                                                                    </s:element>     
The element named "ds" is what has stopped me cold. Simple for those who know the magic sauce, a bit more opaque for the rest of us. It seems that this is calling for the inclusion of a sub-schema? Something which must be generated on my part? The wsdl (minus the ol' ?WSDL in the URL) also provides the following:

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /simswebservices/RegistrationServices.asmx HTTP/1.1 Host: www.platteriversystems.net Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/LeadServices/RegistrationServices/GetLoginRowFromName"  <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">   <soap:Body>     <GetLoginRowFromName xmlns="http://tempuri.org/LeadServices/RegistrationServices">       <loginName>string</loginName>       <ds>         <xsd:schema>schema</xsd:schema>xml</ds>       <status>string</status>     </GetLoginRowFromName>   </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length  <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">   <soap:Body>     <GetLoginRowFromNameResponse xmlns="http://tempuri.org/LeadServices/RegistrationServices">       <ds>         <xsd:schema>schema</xsd:schema>xml</ds>       <status>string</status>     </GetLoginRowFromNameResponse>   </soap:Body> </soap:Envelope>
If this helps ... Got a sample script, or fragment of one, you can share? Thanks, JT
--
JT McDuffie
JT@McDuffie.net
(949) 500-7980
 
This electronic mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply electronic mail and destroy all copies of the message.

没有评论: