douou6696 2011-04-29 08:50
浏览 158

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

I am trying to integrate netForum. It needs some SOAP requests. The following is a sample SOAP 1.1 request and response, but i don't know how to implement this in php.

Request:

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>

Response -

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>
  • 写回答

1条回答 默认 最新

  • drjltlm156790 2011-04-29 08:59
    关注

    PHP has built-in support for this through the SOAP extension (activated in most recent configs). The background behind this is available through http://php.net/manual/en/book.soap.php. SOAP lets you perform remote calls as if you were performing them on your own objects so you will probably have little to do with the raw data you're posting.

    Basically the functions of PHP's SOAP extensions are split into a SoapClient class and a SoapServer class. The former will be the one you're going to need. Have a look at http://www.php.net/manual/en/soapclient.dorequest.php and check the API docs for what kind of requests you can make.

    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器