开发者

CXF webservice client, how to handle response from a called webservice?

i have implemented a webservice client that is used inside a webapplication (using Spring) and this client gets a response in which CXF bailsout and gives me an error message.

The error message is:

Server did not recognize the value of HTTP Header SOAPAction

I have found the problem but do not know what i can do to adjust my webservice response handling.

The xml response below works without any problems.

Works and is accepted ok!

<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>

The service actually returns:

Fails and gives me an error!

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:x开发者_JAVA百科si="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>

The difference as far as i can see is in the placing of the

xmlns="www.dummyurl.com/service-v1.0/ element, in the success xml it is in the enveloppe, in the failed xml it is on the reponse method.

Is there a way that i can convince CXF to accept the response? Or is the service giving back an abnormal result?


The service is giving back a wrong response in the second case, assuming that the first response is proper.

In the first case "www.dummyurl.com/service-v1.0/" is the namespace of your elements - StartSessionResponse, result is not qualified with the namespace. In the second case, the StartSessionResponse has the same namespace as the first sample, but the result has a different namespace altogether, taking out xmlns="" for result will make the xml consistent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜