【发布时间】:2013-04-22 07:21:15
【问题描述】:
我已经花了几个小时做一些我认为我理解的事情:-)。 我有一个用于提供 Web 服务的 SOAP xml 文件。 我想我理解这个理论;-),但不是这样,因为它总是出错。
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<exec xmlns="CBWSCallEngine"
soapenv:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
<arguments>
<CbOrderProduct xmlns="http://www.cbonline.nl/xsd">
<Header>
<EndpointNm>xxxxxxx</EndpointNm>
<Certificaat>xxxxxxxx</Certificaat>
</Header>
<Detail>
<EAN>9789084999912</EAN>
<OrderReference>1988763767</OrderReference>
<ClientId>K Koning</ClientId>
<ReadingMethods>CR</ReadingMethods>
<RetailerId>xxxxxx</RetailerId>
</Detail>
</CbOrderProduct >
</arguments>
</exec>
</soapenv:Body>
我把这个带有已知函数的文件放到一个数组中。 然后我启动服务,但您没有听到任何响应。
$url = "https://tst.eboekhuis.nl/cbwebs/CBWSCallEngine?WSDL";
$client = new SoapClient($url);
$message = xml2array(file_get_contents('vraag.xml'));
echo $result = $client->exec($message);
谁能帮帮我?已修复,非常感谢。
Aad
【问题讨论】:
-
欢迎来到 StackOverflow。您必须编辑您的问题以更好地解释“出错”的含义?这和 Delphi 有什么关系?
-
exec 有输入 exec0Request(带参数)你发送的东西名称为 exec 和参数
-
只是一个空白屏幕。没有错误,屏幕上出现一个简单的回声。
-
只是一个空白屏幕。没有错误,屏幕上出现一个简单的回声。 @Bass:我尝试了 exec0Request,但我不知道如何使用这些参数。 de 标头中有 2 个参数:EndpointNm 和 Certificaat,节详细信息中有 5 个参数,位于标头下方。我试过这个 $result = $client->exec0Request(array('EndpointNm' => 'xxxxx', 'Certificaat' => 'xxxxx', 'EAN' => '9789084999912', 'OrderReference'=>'1988763767', 'ClientId' => 'K Koning', 'ReadingMethods' => 'CR', 'RetailerId' => '6202877'));回声 $result->exec0Request 。 "\n";我哪里错了
标签: php soap-client