duanhong8839 2015-12-03 17:13
浏览 225

在没有WSDL页面的情况下执行SoapClient __soapCall

I'm working with a SOAP API, and they've disabled the WSDL document that's normally located in the base .asmx URL for SOAP APIs. The page is instead a 404 page when viewed without an XML request. Right now, simply instantiating a SoapClient fails ($soap = new SoapClient($url);, the error is Premature end of data in tag html line 1). I'm assuming here that a new instance of SoapClient tries to retrieve the WSDL from the server. Is there a way of turning this off? Of saying 'I want to use SoapClient, but don't do any calls until I tell you the XML call that you'll be using (along with all required data)'?

EDIT: I've tried setting cache_wsdl to WSDL_CACHE_NONE but I still get that error.

  • 写回答

1条回答 默认 最新

  • dou7851 2016-02-04 14:52
    关注

    You have to run SoapClient in non-wsdl mode therefore you must set the wsdl parameter of the SoapClient c'tor to null

    public SoapClient::SoapClient ( mixed $wsdl [, array $options ] )
    

    Initialize it the following way

    $client = new SoapClient(null, array('location' => http://your_domain/your_webservice",
                                         'uri'      => "http://namespace_of_the_webservice/"));
    
    location...The location of the webservice
    uri...The namespace of the target webservice
    
    评论

报告相同问题?

悬赏问题

  • ¥15 ROS Turtlebot3 多机协同自主探索环境时遇到的多机任务分配问题,explore节点
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题