Re: RE: soapclient method to .net server returns object not xml

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

 



NEby@newedgenetworks.com ("Eby, Nicholas") wrote:
>You should be able to pass the return value of
>SoapClient->__getLastResponse() into simplexml_load_string() and be
>alright.  Don't concatenate in the headers from
>__getLastResponseHeaders() because that doesn't contain any of the XML -
>the XML doc is entirely in the body of the response.=20
>

Using simplexml_load_string($client->__getLastResponse) I can only get an
empty SimpleXmlElement object.
Below is the string which loads up fine in mozilla as an xml file.
..
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
    <soap:Body>
        <GetUserAgreementResponse xmlns="http://www.foo.com/webservices/";>
           
<GetUserAgreementResult>https://www.foo.com/docs/useragreement.html</GetUserAgreementResult>
        </GetUserAgreementResponse>
    </soap:Body>
</soap:Envelope>
..

This string will work using simplexml_load_string.
..
<?xml version='1.0'?>
<document>
<title>Forty What?</title>
<from>Joe</from>
<to>Jane</to>
<body>
   I know that's the answer -- but what's the question?
 </body>
</document>
..

Going in circles,
Thanks so much


>-----Original Message-----
>From: Roland Cruse [mailto:roland.cruse@vrs-soft.com]=20
>Sent: Monday, January 22, 2007 1:34 PM
>To: soap@lists.php.net
>Subject: Re:  soapclient method to .net server returns object not
>xml
>
>>
>>If you want XML, aren't it a REST service you're trying to create?
>>SOAPClient was designed to return a stdObject , not a xml document.
>>
>Thanks.
>
>I am only a php SOAPClient accessing a .net soap server.
>
>From other postings I understand that soapclient is meant to return an
>object.
>That works for me in some instances. Knut Urdalen's wsdl2php has been a
>great help. But in an other method, which returns a large
>multidimensional data set, I think it would be better to get the result
>in xml to feed to simpleXml which would then be easier to work with and
>would not need parsing.
>
>I also have php ext/soap code calling a different service other than the
>one I am using and this method called returns *xml*. A while back I made
>requests to a soap server in the form of a post in a web form with the
>complete soap request inside the "textarea", that also returned xml. But
>then I am hearing knowledgeable people say I am supposed to work with
>the object that the soapclient returns. =20
>
>Knowing no other way to get xml from a soapclient method call I saved
>the output of __getLastReponseHeaders and __getLastReponse into a
>string/file (both ways) and tried loading them into simpleXml but I get
>an empty object on return (testing the same operation with good xml
>gives a positive result).
>
>Head spinning. Can anyone point me some tips?
>
>Thanks
>
>
>
>
>>2007/1/18, Roland <roland.cruse@vrs-soft.com>:
>>>
>>> Hi
>>>
>>> I am new to soap and maybe I am missing something. Using php ext/soap
>
>>> calling a .net server.
>>>
>>> $client =3D3D new SoapClient("http://foo.asmx?WSDL";);
>>> echo $client->foo();
>>>
>>> Returns an stdObject when I want xml. If I call the same url not=20
>>> using soap I do get xml.
>>>
>>> I have been trying something like this:
>>> $client =3D3D new SoapClient("http://foo.asmx?WSDL";, array('encoding' =
>
>>> =3D3D> 'literal'));
>>>
>>> But I get an invalid encoding error.
>>>
>>> I do not know how many web pages I have looked at trying to figure=20
>>> this out.
>>>
>>> Any help would be so welcome
>>>
>>> --
>>> PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit:=20
>>> http://www.php.net/unsub.php
>>>
>>>
>>
>>
>>--=3D20
>>Sincerely
>>  Claus J=3DF8rgensen, Denmark
>>  Tlf: +45 86 54 19 07
>>  Mobil: +45 30 13 27 32
>>
>>------=3D_Part_163693_1325884.1169157550884--
>
>--
>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


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

  Powered by Linux