我从myfarebox.com
有肥皂代码<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mys="Mystifly.OnePoint" xmlns:mys1="http://schemas.datacontract.org/2004/07/Mystifly.OnePoint">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<mys:CreateSession>
<mys:rq>
<mys1:AccountNumber>Account_Number</mys1:AccountNumber>
<mys1:Password>Account_Password</mys1:Password>
<mys1:Target>test</mys1:Target>
<mys1:UserName>Account_Username</mys1:UserName>
</mys:rq>
</mys:CreateSession>
</soapenv:Body>
</soapenv:Envelope>
但是使用Postman,我会得到此错误
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
所以我在Stackoverflow和其他博客上阅读了一些示例,我获得了此代码https://gist.github.com/vishvendrasingh/0e0e0b990bf6458c546c477777767b2e28a0
但是它给出了这个错误
致命错误:SOAP-ERROR:解析WSDL:找不到 'http://onepointdemo.myfarebox.com/v2/onepoint.svc'in /var/www/api/index.php第4行
我是肥皂的新手,它似乎根本不起作用。
对于最后一个错误
致命错误:SOAP-ERROR:解析WSDL:在
中找不到'http://onepointdemo.myfarebox.com/v2/onepoint.svc'in /var/www/api/index.php第4行
在您的代码中,您应该通过在URL中添加?wsdl
来指向WSDL:
$wsdl = http://onepointdemo.myfarebox.com/V2/OnePoint.svc?wsdl