我正在使用 PHP,以前从未使用过 SOAP 和 PHP。
我需要建立Soap PHP 客户端它正在调用并从 a 检索信息Soap 服务器 .NET Web 服务.
我目前正在努力获取信息荷兰医疗保健系统的医生.对于在荷兰医疗保健系统中注册的每位医生,您可以检索
他的信息通过他独特的唯一的 BIG ID - 11 位唯一号码)从一个使用 WSDL 的 SOAP Web 服务.
所以当我打电话时SOAP服务器:
(服务器链接如下)
进入这个测试网站(如soapclient.com)
my XML 响应是正确的并且看起来与下面的 XML 完全相同括号中是我想在 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>
我需要构建一个 PHP 网页,它将执行完全相同的 SOAP 调用。
wsdl文件的地址是这样的:
webservices.cibg.nl/Ribiz/OpenbaarV2.asmx?wsdl.asmx?wsdl
肥皂服务器地址是这样的:
http://webservices-acc.cibg.nl/Ribiz/OpenbaarV2.asmx http://webservices-acc.cibg.nl/Ribiz/OpenbaarV2.asmx
肥皂的动作是这样的:
http://services.cibg.nl/ExternalUser/ListHcpApprox3 http://services.cibg.nl/ExternalUser/ListHcpApprox3
我发送的 SOAP 消息是这样的:
<?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>
(括号中是我们在 SOAP 服务器中发送的医生的 BIG ID 号)
如何将上述 SOAP 操作写入 PHP 代码并在 PHP 中存储我作为响应获得的 XML 变量?
我需要在 php 代码中存储的 XML 响应中的变量是这些......
<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: 这是 var_dump 的输出。其中 xxxxxxx 是我想要存储在 php 变量中的值!
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]
...