pb9调用cxf webservice 错误unexpected return content-type:text/html

unaras 2017-04-13 11:38:26
如题:
我用cxf和spring结合,写了一个服务,服务namespace是http://com.hospital/,java调用的时候使用axis2的客户端,完全没有问题。但是在使用pb9调用的过程中,各种问题出现。
目前卡在了,错误“unexpected return content-type:text/html”。
出现错误的时候,还没有走到服务后台的方法。
我写的pb的代码如下:
SoapConnection conn_soap
smsinterfaceserviceport smsport
long rVal
String nameapace="http://com.hospital/"
conn_soap = CREATE SoapConnection
smsport = CREATE smsinterfaceserviceport

rVal = conn_soap.CreateInstance(smsport,"smsinterfaceserviceport",nameapace)
//messagebox('提示:',string(rval))
if rVal <> 0 then
messagebox('提示:','连接网络URL 出现错误,错误代码: '+string(rval))
return
end if
tns__testresponse lst_result

smsport.test()
//lst_result = smsport.test()

destroy conn_soap
destroy smsport
...全文
2540 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
往事依旧如烟 2017-07-10
  • 打赏
  • 举报
回复
遇到同样的问题,请问楼主是如何解决的
unaras 2017-04-13
  • 打赏
  • 举报
回复
CXF 服务器端报错 org.apache.cxf.interceptor.Fault: Unexpected wrapper element test found. Expected {http://service.web.hospital.qazit.com/}test.
unaras 2017-04-13
  • 打赏
  • 举报
回复
String nameapace="http://com.hospital/" 修改成了,wsdl的地址,原来的设置不会走到服务器的后台就中断了,改成wsdl的地址后,是可以走到后台的,但是提示命名空间错误。 这是我打印的日志: REQUEST: CLOSED POST /****/webservice/SMSInterfaceService HTTP/1.1 Host: 192.168.0.120:8080 Connection: Keep-Alive User-Agent: EasySoap++/0.6 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://service.web.hospital.qazit.com/#test" Content-Length: 458 <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/" xmlns:A="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.w3.org/2001/XMLSchema" E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <E:Body> <test s:type="ns1:test" xmlns:ns1="http://service.web.hospital.qazit.com/"> <ns1:arg0 s:type="y:string">unaras</ns1:arg0> </test> </E:Body> </E:Envelope> RESPONSE: HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=UTF-8 Content-Length: 290 Date: Thu, 13 Apr 2017 07:32:00 GMT Connection: close <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unexpected wrapper element test found. Expected {http://service.web.hospital.qazit.com/}test.</faultstring></soap:Fault></soap:Body></soap:Envelope>CLOSED Connection Disconnected

662

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder Web 应用
社区管理员
  • Web 应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧