我在使用 nuSoap 和 IIS 时遇到了一些问题。问题是,当调用 web 服务时,我收到以下错误。
第 1 行解析 SOAP 有效负载时出现 XML 错误:标签不匹配
Apache 环境中的相同调用会返回一个格式良好的 XML,开始时没有其他字符。这是它在 IIS 上返回的内容
*<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body><ns1:crearSolicitudResponse xmlns:ns1="http://localhost/EasyFlow/interfaces/webservices/"><respuesta xsi:type="xsd:string">EXITO: Solicitud 106 creada</respuesta></ns1:crearSolicitudResponse></SOAP-ENV:Body></SOAP-ENV:Envelo*
所以我在这里看到的是 IIS 在打开 XML 之前生成了额外的  并因此截断了信封的最后一个结束标记。这是请求信息和标头,以及响应信息和标头
**Request**
POST /EasyFlow/addons/webservices/CGWebservice.php HTTP/1.1
Host: 192.168.0.250:8081
User-Agent: NuSOAP/0.9.5 (1.123)
Connection: Keep-Alive
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: "http://localhost/EasyFlow/interfaces/webservices/crearSolicitud"
Content-Length: 892
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body><ns1595:crearSolicitud xmlns:ns1595="http://localhost/EasyFlow/interfaces/webservices/"><request_id xsi:type="xsd:string">106</request_id><request_name xsi:type="xsd:string">Solicitud de prueba WS</request_name><request_description xsi:type="xsd:string">Solicitud de prueba generada desde el WebService</request_description><request_createdby xsi:type="xsd:string">admin</request_createdby><tipo xsi:type="xsd:string">incop</tipo><monto xsi:type="xsd:string">1000</monto></ns1595:crearSolicitud></SOAP-ENV:Body></SOAP-ENV:Envelope>
**Response**
HTTP/1.1 200 OK
Date: Fri, 05 Jul 2013 16:15:02 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/5.4.15
Server: NuSOAP Server v0.9.5
X-SOAP-Server: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=ISO-8859-1
Content-Length: 588
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body><ns1:crearSolicitudResponse xmlns:ns1="http://localhost/EasyFlow/interfaces/webservices/"><respuesta xsi:type="xsd:string">EXITO: Solicitud 106 creada</respuesta></ns1:crearSolicitudResponse></SOAP-ENV:Body></SOAP-ENV:Envelo
如果有人可以帮助我,那就太棒了。一个多星期以来,我一直在努力解决这个问题。
谢谢