donglao7947 2011-12-13 17:00
浏览 90
已采纳

PHP不会加载WSDL,但是浏览器显示XML很好吗?

I am trying to access a Windows Service via SoapClient. When I type the ip:port in my browser, it loads the WSDL fine:

<wsdl:definitions name="RmJobService" targetNamespace="http://www.rimage.com/RmJobService">
    <wsdl:types>
        <xsd:schema targetNamespace="http://www.rimage.com/RmJobService/Imports">
            <xsd:import schemaLocation="http://ip:port/RmJobService.svc?xsd=xsd0" namespace="http://www.rimage.com/RmJobService"/>
            <xsd:import schemaLocation="http://ip:port/RmJobService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
            <xsd:import schemaLocation="http://ip:port/RmJobService.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/Rimage.Web.Service"/>
            <xsd:import schemaLocation="http://ip:port/RmJobService.svc?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
        </xsd:schema>
    </wsdl:types>
    ...etc...

But when I try to establish a SoapClient:

try 
{
    $sclient = new SoapClient('http://ip:port/RmJobService.svc?wsdl', array(
        "trace" => 1, "soap_version" => SOAP_1_1));
}
catch (SoapFault $ex)
{
    echo $exception->getMessage();
}

I get this error:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://ip:port/RmJobService.svc?wsdl' : Start tag expected, '<' not found 

Even trying to use file_get_contents or cURL returns null. Any ideas what is going on here?

Dave

  • 写回答

1条回答 默认 最新

  • drag2458 2012-05-31 02:07
    关注

    This ended up being a server firewall issue. Check with the host to make sure it could connect to the source and once they opened the port, everything worked fine. Dumb.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!