使用 nusoap 的网络服务
我正在使用 nusoap 进行网络服务,将酒店 api 整合到我的网络应用程序中。
我创建了soapclient并调用了webservice。 请求是
POST /API/xyz.asmx HTTP/1.0 User-Agent: NuSOAP/0.6.3 Host: xyz.com Authorization: xyz Content-Type: text/xml; charset="ISO-8859-1" Content-Length: 646 SOAPAction: "xyz" <?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/" xmlns:si="http://soapinterop.org/xsd"><SOAP-ENV:Body> <username xsi:type="xsd:string">xyz</username>xxx000000</hotel_id></ns1:getwebservice>
,响应是
HTTP/1.1 200 OK Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 2.0.50727 Date: Tue, 31 May 2011 07:18:28 GMT Connection: close Content-Length: 387 <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><Get_hotel_infoResponse xmlns="http://tempuri.org/"><getwebservice><hotels xmlns="" /></getwebserviceResult></soap:Body></soap:Envelope> </SOAP-ENV:Body></SOAP-ENV:Envelope>
我得到的 xml 响应为空,即响应,那么我如何获取响应中的 xml 数据。
我没有收到 xmlns 链接作为响应。那么它会怎样呢?
i am using nusoap for webservices to intigrate hotel api into my web application.
I create soapclient and called webservice.
request is
POST /API/xyz.asmx HTTP/1.0 User-Agent: NuSOAP/0.6.3 Host: xyz.com Authorization: xyz Content-Type: text/xml; charset="ISO-8859-1" Content-Length: 646 SOAPAction: "xyz" <?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/" xmlns:si="http://soapinterop.org/xsd"><SOAP-ENV:Body> <username xsi:type="xsd:string">xyz</username>xxx000000</hotel_id></ns1:getwebservice>
and response is
HTTP/1.1 200 OK Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 2.0.50727 Date: Tue, 31 May 2011 07:18:28 GMT Connection: close Content-Length: 387 <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><Get_hotel_infoResponse xmlns="http://tempuri.org/"><getwebservice><hotels xmlns="" /></getwebserviceResult></soap:Body></soap:Envelope> </SOAP-ENV:Body></SOAP-ENV:Envelope>
I am getting the xml response empty in response i.e ,so how could i get the xml data in response.
I am not getting the xmlns link in response. so how will it come?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要使用 NuSOAP,它早就死了。使用 PHP 的集成
SoapClient
。Do not use NuSOAP, it's long dead. Use PHP's integrated
SoapClient
.