I use PHP and have never used SOAP and PHP before.
I need to create a PHP client for soap that calls and retrieves information from the Soap Server .NET Web service .
I am currently working on obtaining information for Doctors in the Dutch healthcare system . For each doctor who is registered with the Dutch health care system, you can get his information through a unique unique identifier (BIG ID - 11-digit unique number ) from the SOAP web service using WSDL .
Therefore, when I call the SOAP server : (server link below)
on this testing website (e.g. soapclinet.com)
my XML answer is correct and looks exactly like this XML below in brackets - the doctor information that I want to write in php.
<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"> <soap:Body> <ListHcpApprox3Result xmlns="http://services.cibg.nl/ExternalUser"> <ListHcpApprox> <ListHcpApprox3> <HcpNumber>200822</HcpNumber> <BirthSurname> [Surname of the Doctor]</BirthSurname> <MailingName> [Mailing name of the doctor] </MailingName> <Initial> [Initials of the doctor] </Initial> <Gender> [Gender of the doctor] </Gender> <ArticleRegistration> <ArticleRegistrationExtApp> <ArticleRegistrationNumber> [unique BIG ID] </ArticleRegistrationNumber> <StartDate>1998-12-10T00:00:00</StartDate> <EndDate xsi:nil="true"/> <TypeOfSpecialismId>15</TypeOfSpecialismId> </SpecialismExtApp> </Specialism> <Mention/> <JudgmentProvision/> <Limitation/> </ListHcpApprox3> </ListHcpApprox> </ListHcpApprox3Result> </soap:Body> </soap:Envelope>
I need to create a PHP webpage that will make the exact same SOAP call.
wsdl file address:
webservices.cibg.nl/Ribiz/OpenbaarV2.asmx?wsdl.asmx?wsdl
Soap server address: http://webservices-acc.cibg.nl/Ribiz/OpenbaarV2.asmx
Soap action is: http://services.cibg.nl/ExternalUser/ListHcpApprox3
and the SOAP message I sent is the following:
<?xml version="1.0" encoding="utf-8"?> <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/"> <soap:Body> <listHcpApproxRequest xmlns="http://services.cibg.nl/ExternalUser"> <WebSite>Ribiz</WebSite> <RegistrationNumber> [BIG ID number of the doctor] </RegistrationNumber> </listHcpApproxRequest> </soap:Body> </soap:Envelope>
(in parentheses is the BIG ID of the doctor, which we send to the SOAP server)
How do I write the above SOAP action in PHP code and save the XML variables in PHP that I get as an answer?
the variables in the XML response that I need to save in php code is ...
<HcpNumber>200822</HcpNumber> <BirthSurname> [Surname of the Doctor]</BirthSurname> <MailingName> [Mailing name of the doctor] </MailingName> <Initial> [Initials of the doctor] </Initial> <Gender> [Gender of the doctor] </Gender>
Update1: This is the result of var_dump. Where xxxxxxx are the values ββthat I want to store in php variables!
object(stdClass)[2] public 'ListHcpApprox' => object(stdClass)[3] public 'ListHcpApprox3' => object(stdClass)[4] public 'HcpNumber' => string 'xxxxxxxxx' (length=6) public 'BirthSurname' => string 'xxxxxxxxxxx' (length=9) public 'MailingName' => string 'xxxxxxxxxxxxxxxxxx' (length=18) public 'Initial' => string 'xxxxxxxxxxxx' (length=8) public 'Gender' => string 'x' (length=1) public 'ArticleRegistration' => object(stdClass)[5] ... public 'Specialism' => object(stdClass)[7] ... public 'Mention' => object(stdClass)[9] ... public 'JudgmentProvision' => object(stdClass)[10] ... public 'Limitation' => object(stdClass)[11] ...