PHP中的SOAP 1.1请求和响应处理

PHP中的SOAP 1.1请求和响应处理,php,soap,Php,Soap,我正在尝试集成netForum。它需要一些SOAP请求。下面是一个SOAP1.1请求和响应示例,但我不知道如何在php中实现它 请求: POST /xweb/netFORUMXMLONDemand.asmx HTTP/1.1 Host: nftpsandbox.avectra.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.avectra.com/OnDemand/2

我正在尝试集成netForum。它需要一些SOAP请求。下面是一个SOAP1.1请求和响应示例,但我不知道如何在php中实现它

请求:

POST /xweb/netFORUMXMLONDemand.asmx HTTP/1.1
Host: nftpsandbox.avectra.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.avectra.com/OnDemand/2005/NewIndividualInformation"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <AuthorizationToken xmlns="http://www.avectra.com/OnDemand/2005/">
      <Token>string</Token>
    </AuthorizationToken>
  </soap:Header>
  <soap:Body>
    <NewIndividualInformation xmlns="http://www.avectra.com/OnDemand/2005/">
      <oNode>xml</oNode>
    </NewIndividualInformation>
  </soap:Body>
</soap:Envelope>
POST/xweb/netFORUMXMLONDemand.asmx HTTP/1.1
主持人:nftpsandbox.avectra.com
内容类型:text/xml;字符集=utf-8
内容长度:长度
SOAPAction:“http://www.avectra.com/OnDemand/2005/NewIndividualInformation"
一串
xml
回应-

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <AuthorizationToken xmlns="http://www.avectra.com/OnDemand/2005/">
      <Token>string</Token>
    </AuthorizationToken>
  </soap:Header>
  <soap:Body>
    <NewIndividualInformationResponse xmlns="http://www.avectra.com/OnDemand/2005/">
      <NewIndividualInformationResult>xml</NewIndividualInformationResult>
    </NewIndividualInformationResponse>
  </soap:Body>
</soap:Envelope>
HTTP/1.1200正常
内容类型:text/xml;字符集=utf-8
内容长度:长度
一串
xml

PHP通过SOAP扩展(在最新配置中激活)对此提供了内置支持。这背后的背景可通过以下方式获得。SOAP允许您执行远程调用,就像您在自己的对象上执行远程调用一样,因此您可能与正在发布的原始数据没有什么关系

基本上,PHP的SOAP扩展的功能分为
SoapClient
类和
SoapServer
类。前者将是您需要的。查看并检查API文档,了解您可以发出什么样的请求。

谷歌搜索“PHP SOAP教程”会给出很多结果。这可能是一个好的开始。