soap - Retrieving data from WSDL webservice in PHP -


i'll start out saying have no idea ever trying do. php skills -beginner- , experience webservices null.

i have wsdl url http://example.com/ws/3.1/nne?wsdl. call searchtargetgroup method php script, can loop through answer , save data database.

anywho, have no idea how create call php. :-( i've looked @ nusoap php , built in soapclient, without luck. think problem i'm trying call complex method without understanding frog i'm messing around with.

so used soapui retrieve definition file , creating request, works , i'm getting info want. problem is, have no clue how should make php file creating exact same request soapui (and thereby getting correct answer).

the xml request soapui generates me looks this:

<soapenv:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nne="http://example.com/ws/nne">     <soapenv:header/>     <soapenv:body>         <nne:searchtargetgroup soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/">             <questiontargetgroup_1 xsi:type="nne:questiontargetgroup" xmlns:nne="http://example.com/ws/nne">                 <companyformcodelist xsi:type="xsd:string">10,60,80</companyformcodelist>                 <companystatus xsi:type="xsd:string">0</companystatus>                 <hasphoneonly xsi:type="xsd:boolean">true</hasphoneonly>             </questiontargetgroup_1>             <int_2 xsi:type="xsd:int">500</int_2>             <int_3 xsi:type="xsd:int">1</int_3>             <int_4 xsi:type="xsd:int">1</int_4>             <string_5 xsi:type="xsd:string">passstring</string_5>         </nne:searchtargetgroup>     </soapenv:body> </soapenv:envelope> 

can me in direction? preferably right one. :-)

i'm aware can't test on url, since it's ip protected, know how make above call php file/function.

first of beginner here myself, cannot guarantee correct answer can give @ least hints.

use soapclient instead of nusoap. soapclient written in c, nusoap in php, soapclient faster.

if wsdl file fine, have should be:

$client = new soapclient("[url wsdl]"); 

after soapclient take care of rest , makes procedures defined in wsdl directly available.

$result = $client->name_of_procedure($arg1, $arg2, ...); 

the result of type stdclass or array elements of type stdclass.

without wsdl have specify details yourself, type of parameters, namespaces, ... , invoke via __soapcall() directly.

either way can inspect structure of $result var_dump() & co.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -