webservice 给我一个 地址:http://www.xxxxxxxxxxxxxxx.aspx?...
直接在浏览器输入这个地址 , 显示的是XML。我现在希望用我自己的PHP里把这个XML输出来,怎么办啊?
我如果这样:header("Content-Type: application/xml");
print(http://www.xxxxxxxxxxxxxxx.aspx?...);却还是无法输出那个XML,Firefox下得到的是:
         XML解析错误:未组织好IE下得到的是:
     无法显示 XML 页我现在希望用我自己的PHP里把这个XML输出来,怎么办啊?

解决方案 »

  1.   

    echo file_get_contents("http://www.xxxxxxxxxxxxxxx.aspx?...");
      

  2.   

    header("Content-Type: application/xml");
    echo file_get_contents(http://www.xxxxxxxxxxxxxxx.aspx?...);数据是xml并不代表是webservice,webservice 是可以交互的。
    如果是webservice 最好用webservice 的方式连接
      

  3.   

    只要显示的话,只需要header(location:http://www.xxxxxxxxxxxxxxx.aspx?...);
    就可以了如果是测试webservice返回回来的数据,则需要把response过来的数据转成hmtl能够显示的字符才行,这个转的函数是htmlspecialchars()
      

  4.   

    我一般用下面的代码测试webservice返回来的数据
    echo (htmlspecialchars($soap->response,ENT_QUOTES));
    如果显示乱码的话,记得转换编码