doubi9531 2011-11-24 10:35
浏览 220
已采纳

php使用SOAP与不同的SoapAction

I'm working with a WSDL that has a different SOAP Action in the header to the one I would expect. At the moment when I call the web service, I just get like a .NET description site of a web service. In this instance it's

https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx

What URL should I actually call to get to the getPurseBalance() method as the option in the SOAP Action from the WSDL doesn't seem to be defined, is there anyway I can determine this or should I go to the web service provider?

Thanks,

  • 写回答

2条回答 默认 最新

  • douyi3676 2011-11-24 10:41
    关注

    You should not call a URL, you should post a XML to this direct same page. To know what to send to the web service you can check your URL:

    https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx?op=getPurseBalance

    Here you can also view your SoapAction and other headers to be send:

    POST /ytm/sQuidpages/sQuidPWS.asmx HTTP/1.1
    Host: preprod.squidcard.com
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "https://secure.squidcard.com/getPurseBalance"
    

    If you don't want to create XML manually you can also use the SoapClient class from PHP. You can find more information here:

    http://www.php.net/manual/en/class.soapclient.php

    $client = new SoapClient("https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx?WSDL");
    var_dump($client->__getFunctions());
    
    $client->__soapCall("getPurseBalance", array('your parameters'));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP