.NET从程序调用PHP写的WebService,出错:客户端发现响应内容类型为“text/html”,但应为“text/xml”
因为要把PHP的论坛和.net的页面作一些联动,如远程添加帖子什么的,所以写了一个php的WebService
但是用.net程序调用这个WebService,却返回错误
客户端发现响应内容类型为“text/html”,但应为“text/xml”。
请求失败,错误信息为:
--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ws_phpwind" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:add_commentResponse><add_commentReturn xsi:type="xsd:int">19</add_commentReturn></ns1:add_commentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
--.
返回的明明就是xml嘛,为什么.net会认为是text/html呢?
php那边也正常执行了,我想添加的帖子也添加到数据库里了
这里
<add_commentReturn xsi:type="xsd:int">19</add_commentReturn>
这个19也是正确的返回结果
请问这是为什么呢?怎么解决?