[英]CXF webservice client, how to handle response from a called webservice?
我已經實現了一個Web服務客戶端,該客戶端在Web應用程序內部使用(使用Spring),並且此客戶端收到CXF失敗的響應並給我一條錯誤消息。
錯誤消息是:
服務器無法識別HTTP標頭SOAPAction的值
我已經發現問題,但不知道該怎么做才能調整我的Web服務響應處理。
下面的xml響應可以正常工作。
可行,可以接受!
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bar="http://www.dummyurl.com/service-v1.0/">
<soapenv:Header/>
<soapenv:Body>
<bar:StartSessionResponse>
<result>1</result>
</bar:StartSessionResponse>
</soapenv:Body>
</soapenv:Envelope>
該服務實際上返回:
失敗並給我一個錯誤!
<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>
<StartSessionResponse xmlns="www.dummyurl.com/service-v1.0/">
<result xmlns="">1</result>
</StartSessionResponse>
</soap:Body>
</soap:Envelope>
據我所見,區別在於
xmlns =“ www.dummyurl.com/service-v1.0/元素,成功的xml中包含信封,失敗的xml中包含響應方法。
有什么方法可以說服CXF接受響應嗎? 還是服務回饋了異常結果?
假設第一個響應是正確的,則服務在第二種情況下會返回錯誤響應。
在第一種情況下,“ www.dummyurl.com/service-v1.0/”是元素的名稱空間-StartSessionResponse,結果不符合該名稱空間。 在第二種情況下,StartSessionResponse具有與第一個示例相同的名稱空間,但是結果完全具有不同的名稱空間,取出xmlns =“”作為結果將使xml一致。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.