首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不知道如何在PHP中创建XML SOAP帖子

我不知道如何在PHP中创建XML SOAP帖子
EN

Stack Overflow用户
提问于 2013-01-04 16:19:06
回答 1查看 183关注 0票数 0

我搜索了示例和更多,但它不起作用。我不知道如何为我的xml消息创建"POST代码“。我想我需要一个soapclient,但是我不知道如何使用它。

WSDL文件地址:https://secure.intelly.nl/webservices/intellymodule001.asmx?WSDL

这是我创建的xml消息:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" 
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
        xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
        xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
        xmlns:tns="http://extranet.intelly.nl/module001/" 
        xmlns:s="http://www.w3.org/2001/XMLSchema" 
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<SOAP-ENV:Body>
    <tns:GetDomains xmlns:tns="http://extranet.intelly.nl/module001/">
        <tns:credentials>
            <ExternalProgramFunction>***</ExternalProgramFunction>
            <ExternalProgramID>***</ExternalProgramID>
            <Domain>***</Domain>
            <Username>***</Username>
            <Password>***</Password>
        </tns:credentials>
        <tns:message>
        </tns:message>
        <tns:message>
        </tns:message>
        <tns:searchParameters>
            <OnlyActive>True</OnlyActive>
        </tns:searchParameters>
    </tns:GetDomains>
</SOAP-ENV:Body>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-04 16:59:25

PHP有一个原生SoapClient,下面是一个使用你的输入结构的例子:

代码语言:javascript
复制
$client = new SoapClient('https://secure.intelly.nl/webservices/intellymodule001.asmx?WSDL');

$params = array(
    'credentials' => array(
        'ExternalProgramFunction' => 'xxx',
        'ExternalProgramID' => 'xxx',
        'Domain' => 'xxx',
        'UserName' => 'xxx',
        'Password' => 'xxx'
    ),
    'message' => array(),
    'searchParameters' => array(
        'OnlyActive' => true
    )
);

$response = $client->GetDomains($params);

print_r($response);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14153516

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档