如題:
我用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
uj5u.com熱心網友回復:
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
uj5u.com熱心網友回復:
CXF 服務器端報錯org.apache.cxf.interceptor.Fault: Unexpected wrapper element test found. Expected {http://service.web.hospital.qazit.com/}test.
uj5u.com熱心網友回復:
遇到同樣的問題,請問樓主是如何解決的轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/19605.html
標籤:Web 應用
