Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a PHP SOAP client and store the result xml in php variables
    primarykey
    data
    text
    <p>I am using PHP and have never used SOAP and PHP before.</p> <p>I need to build <strong>a Soap PHP Client</strong> which is calling and retrieves information from a <strong>Soap server .NET Web service</strong>.</p> <p>I'm currently working on getting information for <strong>Doctors in Dutch Health care system</strong> .for Every doctor which is registered in the Dutch of health care system you can retrieve his information through his unique <strong>unique BIG ID - 11 digit unique number</strong> ) from a <strong>SOAP web-service using WSDL</strong>.</p> <p>So when I am calling the <strong>SOAP server</strong> : (link of the server is below)</p> <p>into this a Testing web site (like soapclinet.com) </p> <p>my <strong>XML response is correct and looks exactly like this XML below</strong> in brackets the information of the doctor that i want to capture in php.</p> <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;soap:Body&gt; &lt;ListHcpApprox3Result xmlns="http://services.cibg.nl/ExternalUser"&gt; &lt;ListHcpApprox&gt; &lt;ListHcpApprox3&gt; &lt;HcpNumber&gt;200822&lt;/HcpNumber&gt; &lt;BirthSurname&gt; [Surname of the Doctor]&lt;/BirthSurname&gt; &lt;MailingName&gt; [Mailing name of the doctor] &lt;/MailingName&gt; &lt;Initial&gt; [Initials of the doctor] &lt;/Initial&gt; &lt;Gender&gt; [Gender of the doctor] &lt;/Gender&gt; &lt;ArticleRegistration&gt; &lt;ArticleRegistrationExtApp&gt; &lt;ArticleRegistrationNumber&gt; [unique BIG ID] &lt;/ArticleRegistrationNumber&gt; &lt;StartDate&gt;1998-12-10T00:00:00&lt;/StartDate&gt; &lt;EndDate xsi:nil="true"/&gt; &lt;TypeOfSpecialismId&gt;15&lt;/TypeOfSpecialismId&gt; &lt;/SpecialismExtApp&gt; &lt;/Specialism&gt; &lt;Mention/&gt; &lt;JudgmentProvision/&gt; &lt;Limitation/&gt; &lt;/ListHcpApprox3&gt; &lt;/ListHcpApprox&gt; &lt;/ListHcpApprox3Result&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p><strong><em>I need to build a PHP web page which will do exactly the same SOAP call.</em></strong> </p> <p><strong>the address of the wsdl file is this:</strong></p> <p>webservices.cibg.nl/Ribiz/OpenbaarV2.asmx?wsdl.asmx?wsdl </p> <p><strong>The soap server address is this:</strong> <a href="http://webservices-acc.cibg.nl/Ribiz/OpenbaarV2.asmx" rel="nofollow">http://webservices-acc.cibg.nl/Ribiz/OpenbaarV2.asmx</a></p> <p><strong>The soap action is this:</strong> <a href="http://services.cibg.nl/ExternalUser/ListHcpApprox3" rel="nofollow">http://services.cibg.nl/ExternalUser/ListHcpApprox3</a></p> <p><strong><em>and the SOAP message that i sent is this:</em></strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body&gt; &lt;listHcpApproxRequest xmlns="http://services.cibg.nl/ExternalUser"&gt; &lt;WebSite&gt;Ribiz&lt;/WebSite&gt; &lt;RegistrationNumber&gt; [BIG ID number of the doctor] &lt;/RegistrationNumber&gt; &lt;/listHcpApproxRequest&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p>(in brackets is the BIG ID number of the doctor that we send in SOAP server)</p> <p><strong>How can I write the above SOAP action into PHP code and store in PHP the variables of the XML that i get as response ?</strong></p> <p>the variables in XML response that I need to store in php code are these... </p> <pre><code>&lt;HcpNumber&gt;200822&lt;/HcpNumber&gt; &lt;BirthSurname&gt; [Surname of the Doctor]&lt;/BirthSurname&gt; &lt;MailingName&gt; [Mailing name of the doctor] &lt;/MailingName&gt; &lt;Initial&gt; [Initials of the doctor] &lt;/Initial&gt; &lt;Gender&gt; [Gender of the doctor] &lt;/Gender&gt; </code></pre> <p><strong>Update1:</strong> <em>This is the output of the var_dump. Where xxxxxxx are the values that I want to store in php variables!</em></p> <pre><code>object(stdClass)[2] public 'ListHcpApprox' =&gt; object(stdClass)[3] public 'ListHcpApprox3' =&gt; object(stdClass)[4] public 'HcpNumber' =&gt; string 'xxxxxxxxx' (length=6) public 'BirthSurname' =&gt; string 'xxxxxxxxxxx' (length=9) public 'MailingName' =&gt; string 'xxxxxxxxxxxxxxxxxx' (length=18) public 'Initial' =&gt; string 'xxxxxxxxxxxx' (length=8) public 'Gender' =&gt; string 'x' (length=1) public 'ArticleRegistration' =&gt; object(stdClass)[5] ... public 'Specialism' =&gt; object(stdClass)[7] ... public 'Mention' =&gt; object(stdClass)[9] ... public 'JudgmentProvision' =&gt; object(stdClass)[10] ... public 'Limitation' =&gt; object(stdClass)[11] ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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