irandoct Posted October 16, 2013 Share Posted October 16, 2013 Hi, i'm writing a webservice for my application. i can't print and save result of webservice. my php code: <?php .... $client = new SoapClient("http://addresst/code.asmx?wsdl"); $params = array( 'Username'=>$username, 'PassWord'=>$password, 'numberOfMessages'=>$numberOfMessages, 'destNumber'=>$destNumber, 'ErrNum'=>$ErrNum, ); $result = $client->GetAllMessages( $params ); if (is_soap_fault($result)) { echo '<h2>Fault:</h2><pre>'; print_r($result); echo '</pre>'; } else { print_r($result); //testing output echo "<hr/>"; $res = $result->GetAllMessagesResult;//testing output print_r($res); //end get messages } ?> xml schema: <s:element name="GetAllMessages"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="numberOfMessages" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="destNumber" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ErrNum" type="s:int"/></s:sequence></s:complexType></s:element><s:element name="GetAllMessagesResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetAllMessagesResult" type="tns:ArrayOfArrayOfString"/><s:element minOccurs="1" maxOccurs="1" name="ErrNum" type="s:int"/></s:sequence></s:complexType></s:element><s:complexType name="ArrayOfArrayOfString"><s:sequence><s:element minOccurs="0" maxOccurs="unbounded" name="ArrayOfString" nillable="true" type="tns:ArrayOfString"/></s:sequence></s:complexType> what's wrong? please post your code based on XML schema i posted here! Regards Mansour Link to comment https://forums.phpfreaks.com/topic/283020-printing-results-from-web-service-soapclient/ Share on other sites More sharing options...
irandoct Posted October 16, 2013 Author Share Posted October 16, 2013 Hi guys, webservice address: http://sms-webservice.ir/v1/v1.asmx?wsdl I'm looking forward... mansour Link to comment https://forums.phpfreaks.com/topic/283020-printing-results-from-web-service-soapclient/#findComment-1454159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.