我以前从未使用过SOAP XML api.
我在SO上阅读了几个类似的问题,但我无法让它发挥作用.
这是一个简单的请求:
<soap12:Envelope xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:soap12=”http://www.w3.org/2003/05/
soap-envelope”>
<soap12:Body>
<CheckDomainAvailability xmlns=”https://live.domainbox.net/”>
<AuthenticationParameters>
<Reseller>myreseller</Reseller>
<Username>myuser</Username>
<Password>mypassword</Password>
</AuthenticationParameters>
<CommandParameters>
<DomainName>checkadomain.co</DomainName>
<LaunchPhase>GA</LaunchPhase>
</CommandParameters>
</CheckDomainAvailability>
</soap12:Body>
</soap12:Envelope>
Run Code Online (Sandbox Code Playgroud)
我已经联系过他们,但他们没有提供PHP API.
我想使用PHP内置的SoapClient类.
问题是:如何发送请求并打印答案?
看起来你的WSDL位于https://live.domainbox.net/?WSDL.
这是使用本机PHP SoapClient的示例.
$client = new SoapClient('https://live.domainbox.net/?WSDL');
// populate the inputs....
$params = array(
'AuthenticationParameters' => array(
'Reseller' => '',
'Username' => '',
'Password' => ''
),
'CommandParameters' => array(
'DomainName' => '',
'LaunchPhase' => ''
)
);
$result = $client->CheckDomainAvailability($params);
print_r($result);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4532 次 |
| 最近记录: |