如何请求从SOAP XML API的答案吗? [英] How to request an answer from a SOAP XML API?

查看:188
本文介绍了如何请求从SOAP XML API的答案吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有与前SOAP XML API的工作。

I never worked with SOAP XML api before.

我读了SO几个类似的问题,但我不能得到它的工作。

I read a couple of similar questions on SO but I can't get it to work.

下面是一个简单的要求:

Here's a simple request:

<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>

我已经联系他们,但他们不提供PHP API。

I've contacted them but they do not offer a PHP API.

我想使用内置的PHP SoapClient类外。

I would like to use the SoapClient class built in PHP.

现在的问题是:
如何发送请求和打印答案?

The question is: How do I send the request and print the answer?

推荐答案

看起来你的WSDL位于 https://live.domainbox.net/?WSDL

Looks like your WSDL is located at https://live.domainbox.net/?WSDL.

下面是使用原生的PHP SoapClient的一个例子。

Here's an example using the native 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);

这篇关于如何请求从SOAP XML API的答案吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆