dongyun51582 2015-08-11 08:05
浏览 35
已采纳

如何在PHP文件中创建SOAP请求? [重复]

This question already has an answer here:

I want to make the following SOAP request in a PHP file, but I'm not sure how to implement it. Could someone explain how I would use this?

Also, how can I print out the result of the request stored in "LoginSuccess"

  1. POST /soap/V200611.ASMX HTTP/1.1
  2. Host: api.cvent.com
  3. Content-Type: application/soap+xml; charset=utf-8
  4. Content-Length: length
  5. <?xml version="1.0" encoding="utf-8"?>
  6. <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">
  7. <soap12:Body>
  8. <Login xmlns="http://api.cvent.com/2006-11">
  9. <AccountNumber>string</AccountNumber>
  10. <UserName>string</UserName>
  11. <Password>string</Password>
  12. </Login>
  13. </soap12:Body>
  14. </soap12:Envelope>
  15. HTTP/1.1 200 OK
  16. Content-Type: application/soap+xml; charset=utf-8
  17. Content-Length: length
  18. <?xml version="1.0" encoding="utf-8"?>
  19. <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">
  20. <soap12:Body>
  21. <LoginResponse xmlns="http://api.cvent.com/2006-11">
  22. <LoginResult LoginSuccess="boolean" ServerURL="string" CventSessionHeader="string" ErrorMessage="string" xmlns="http://schemas.cvent.com/api/2006-11" />
  23. </LoginResponse>
  24. </soap12:Body>
  25. </soap12:Envelope>
</div>

展开全部

  • 写回答

1条回答 默认 最新

  • doutun9179 2015-08-11 08:07
    关注

    Check the manual for http://php.net/manual/en/soapclient.dorequest.php:

    public string SoapClient::__doRequest ( string $request , string $location , string $action , int $version [, int $one_way = 0 ] ) performs SOAP request over HTTP.

    Parameters:

    request The XML SOAP request.

    location The URL to request.

    action The SOAP action.

    version The SOAP version.

    one_way If one_way is set to 1, this method returns nothing. Use this where a response is not expected.

    Return:

    The XML SOAP response.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部