首页 > 解决方案 > Symantec Messaging 网关添加域肥皂请求

问题描述

我正在尝试在 php 中生成以下 XML 块以将其发送到 SMG 肥皂服务器。我怎样才能做到这一点?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dom="http://schemas.symantec.com/jaxws/domainProvisioningService">
   <soapenv:Header/>
   <soapenv:Body>
      <dom:AddDomains>
         <dom:domains>
            <domain name="domain1.com" local="true">               
            </domain>
             <domain name="domain2.com" local="true">               
            </domain>
         </dom:domains>
      </dom:AddDomains>
   </soapenv:Body>
</soapenv:Envelope>

标签: phpsoapsymantec

解决方案


我执行了以下 php 块并创建了所需的输出:

$xmldom = new DOMDocument(); 
$domainsAttr = $xmldom->createElement( "domains" );
$domainAttr = $xmldom->createElement( "domain" );
$domainAttr->setAttribute( "name", "test.com" );
$domainAttr->setAttribute( "local", "true" );
$domainsAttr->appendChild( $domainAttr );   
$xmldom->appendChild( $domainsAttr );

这是所需的输出:

<domains><domain name="test.com" local="true"/></domains>

我省略了要在此处发布的剩余代码,但是当我执行代码时,出现以下错误:

Cannot find dispatch method for {}domains

推荐阅读