Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieving data from WSDL webservice in PHP
    text
    copied!<p>I'll start out by saying I have no idea what so ever about what I am trying to do. My PHP skills is -beginner- and my experience with webservices is NULL.</p> <p>I have a WSDL URL <a href="http://example.com/ws/3.1/NNE?WSDL" rel="nofollow">http://example.com/ws/3.1/NNE?WSDL</a>. I would like to call the <strong>searchTargetGroup</strong> method from a PHP script, so I can loop through the answer and save the data to my database.</p> <p>Anywho, I have no idea how to create the call from PHP. :-( I've looked at NuSOAP for PHP and also the built in SoapClient, but without luck. I <em>think</em> the problem is that I'm trying to call a complex method without fully understanding what the frog I'm messing around with.</p> <p>So I used SoapUI to retrieve the definition file and creating a request, which works perfectly and I'm getting all the info I want. Problem is, I have <strong>no clue</strong> how I should make a PHP file creating exact same request as SoapUI (and thereby getting the correct answer).</p> <p>The XML request SoapUI generates for me looks like this:</p> <pre><code>&lt;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"&gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;nne:searchTargetGroup soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt; &lt;QuestionTargetGroup_1 xsi:type="nne:QuestionTargetGroup" xmlns:nne="http://example.com/ws/NNE"&gt; &lt;companyFormCodeList xsi:type="xsd:string"&gt;10,60,80&lt;/companyFormCodeList&gt; &lt;companyStatus xsi:type="xsd:string"&gt;0&lt;/companyStatus&gt; &lt;hasPhoneOnly xsi:type="xsd:boolean"&gt;true&lt;/hasPhoneOnly&gt; &lt;/QuestionTargetGroup_1&gt; &lt;int_2 xsi:type="xsd:int"&gt;500&lt;/int_2&gt; &lt;int_3 xsi:type="xsd:int"&gt;1&lt;/int_3&gt; &lt;int_4 xsi:type="xsd:int"&gt;1&lt;/int_4&gt; &lt;String_5 xsi:type="xsd:string"&gt;passstring&lt;/String_5&gt; &lt;/nne:searchTargetGroup&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>Can anyone help me in some direction? Preferably the right one. :-)</p> <p>I'm aware that you can't test on the URL, since it's IP protected, but I would really just like to know how to make above call from a PHP file/function.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload