SOAP noob question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm working on creating a client for a SOAP web service API on a media server for some distance learning tools I've been creating. The service is written in ASP.NET and I'm (obviously) using PHP (v.4 with PEAR::SOAP 0.9.1).

I am calling serveral of the functions defined by the web service, but
am getting a very consistent error on return. This despite the fact that the return seems to contain the material I'm looking for in the format I'm hoping to see.

Here's an example of the code for my client (I can send the actual URL for the WSDL if needed, but want to save them a bunch of traffic if I can):

***********
code snippet
***********
<?php

require_once('SOAP/Client.php');

//Set the URL for the DW WSDL:
$wsdlurl = 'https://the_service_url/frontendapi.asmx?wsdl';

//Create a SOAP WSDL object:
$wsdl = new SOAP_WSDL($wsdlurl);

//Create the local proxy to avoid having to re-parse WSDL on every call:
$client = $wsdl->getProxy();

//Show us the client, so we are sure everythings okay so far
//echo $client.'<br>';

//Turn off SSL verification to bypass the cert problem with DW's CA Cert
$client->setOpt('curl',CURLOPT_SSL_VERIFYPEER,0);
$client->setOpt('curl',CURLOPT_SSL_VERIFYHOST,0);

//Set parameters for the query, using numbers from my data in DW
$recordID = 76;
$inputClass = "Folder";
$applicationID = 19;
$attributeList = "";
$containerCollID = 68;
$desiredOutput = "Folder;MediaGroup;MediaObject";
$orderByParameters = "Folder:Name";

//Call the getInfo method using the above parameters:
$response = $client->GetInfoPublicOnly($recordID,$containerCollID,$applicationID,$inputClass,$attributeList); //$response = $client->EnumPublicOnly($recordID,3,$inputClass,$containerCollID,$applicationID,$attributeList,$desiredOutput,$orderByParameters);

//output the errors that result so I can be confused by them:
if (PEAR::isError($response)) {
	echo 'error<br>';
	echo 'message: <pre>'.$response->getMessage().'</pre><br>';
	echo 'user info: <pre>'.$response->getUserInfo().'</pre><br>';
	echo 'get wire: <pre>'.$client->__get_wire().'</pre><br>';
} else {
	echo 'no error<br>';
	echo "<pre>\n";
	print_r($response);
	echo "</pre>";
}

?>
**********
End Code
**********

The response I get from the web service is an error message, and looks like this:

**********
Response Snippet
**********
error
message:
XML error on line 1 col 4 byte 4 not well-formed

user info:
HTTP/1.1 200 OK
Date: Tue, 26 Jul 2005 19:26:17 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 1777

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  <soap:Body>
    <GetInfoPublicOnlyResponse xmlns="DigitalWellWebServiceAPI">
      <GetInfoPublicOnlyResult>
        <xs:schema id="NewDataSet" xmlns=""
          xmlns:xs="http://www.w3.org/2001/XMLSchema";
          xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
          <xs:element name="NewDataSet" msdata:IsDataSet="true";>
            <xs:complexType>
              <xs:choice maxOccurs="unbounded">
                <xs:element name="Table" >
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="CollectionID" type="xs:int"
                        minOccurs="0" />
                      <xs:element name="Name" type="xs:string"
                        minOccurs="0" />
                      <xs:element name="Description" type="xs:string"
                        minOccurs="0" />
                      <xs:element name="CollectionType" type="xs:string"
                        minOccurs="0" />
                      <xs:element name="ImagePath" type="xs:string"
                        minOccurs="0" />
                      <xs:element name="ParentCollectionID" type="xs:int"
                        minOccurs="0" />
                      <xs:element name="AltText" type="xs:string"
                        minOccurs="0" />
                      <xs:element name="PID" type="xs:string"
                        minOccurs="0" />
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
            </xs:complexType>
          </xs:element>
        </xs:schema>
        <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
          xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
          <NewDataSet xmlns="">
            <Table diffgr:id="Table1" msdata:rowOrder="0";>
              <CollectionID>76</CollectionID>
              <Name>Kieran Photos</Name>
              <Description>collection of photos of my favorite
                son</Description>
              <CollectionType>Generic</CollectionType>
              <ImagePath />
              <ParentCollectionID>68</ParentCollectionID>
              <AltText />
              <PID>392B325B-4D3B-4C7C-B853-51E4596630E8</PID>
            </Table>
          </NewDataSet>
        </diffgr:diffgram>
      </GetInfoPublicOnlyResult>
    </GetInfoPublicOnlyResponse>
  </soap:Body>
</soap:Envelope>

**********
End Return Snippet
**********

The XML returned by the web service seems just fine to me. It has all the information I was expecting to get, in the format I was expecting to see, but it comes back wrapped in a PEAR error object. Any ideas what I'm missing here?

Thanks for any information you all might be able to share, and sorry if the answer is ridiculous and simple, I am a new soap user, so a bit over my head here for now.

C


********************************
Cris Ewing
CME and Telehealth Web Services
University of Washington
School of Medicine
Work Phone: (206) 685-9116
Home Phone: (206) 365-3413
E-mail: cewing@u.washington.edu
*******************************

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux