Creating the right SOAP call in PHP -


i'm having trouble creating right soap call in php. i've tested following call in soap ui , works, i've tried creating objects, arrays , soapheaders , can't seem right call. here request works in soap ui:

<?xml version="1.0" encoding="utf-8"?> <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="com.dtn.aghost.api.subscriptions">     <soapenv:header>         <com:servicecredentials>             <usernamepasswordcombo>                 <username>[username]</username>                 <password>[password]</password>             </usernamepasswordcombo>         </com:servicecredentials>     </soapenv:header>     <soapenv:body>         <com:subscriptionserviceidlist>             <visible>1</visible>         </com:subscriptionserviceidlist>     </soapenv:body> </soapenv:envelope> 

thanks!

i had questions request has little information regarding you've tried. suggest add of code have attempted use , of resources you've looked @ information. in addition answer request if described results of tried. such there errors if errors did see?

a place examples of php code connecting soap web service php documentation soap client.

in comments of page find examples of code others have used. may adapt use purposes.

as example of code connecting soap web service

<?php      $http_client = 'http://example.com/myservice.asmx?wsdl';      $client = new soapclient($http_client, array(         'style' => soap_document,         'use' => soap_literal,         'soap_version'=>soap_1_1,         'trace' => 1,         'connection_timeout' => 300));      $params = array( 'username' => $user_name, 'password' => $password);      $results = $client->myfunction($params);      // debug code can added after  ?> 

another thing need debug results of request. in example above sets value of trace 1. allows debug soap request has taken place. can following code.

    // debug code      echo $client->__getlastrequestheaders();     echo $client->__getlastrequest()     echo $client->__getlastresponseheaders();     echo $client->__getlastresponse(); 

php soapclient getlastresponse

last of can use is_soap_fault determine if request failed. there code examples on php documentation getting error code of happened.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -