On May 23, 2013, at 1:27 PM, David Nedrow <[email protected]> wrote:
> I have a problem in which CXF generated client code expects a namespace as
> part of the web-service response. However, the web-service does not include a
> namespace as part of the response. This causes an unexpected element error.
> How can I configure the client to ignore the missing namespace? Plain old
> java, no Spring.
>
> Here's a snippet of the exception the client throws... Exception in thread
> "main" javax.xml.ws.soap.SOAPFaultException: Unexpected wrapper element
> getResponse found. Expected
> {http://www.service-now.com/fooservice}getResponse.
This LOOKS like the server is generating an invalid soap message. Any chance
of seeing the soap message? At least the body and immediate children?
Per SOAP spec, the immediate children of the SOAP:Body element must be
qualified. However, it looks like your server is sending back a plain
"<getReponse>" element that isn't qualified. If that's the case, there isn't
an easy way to get CXF to use it as CXF would set itself up to generate and
accept valid messages. You MAY be able to use the cxf transform feature
(http://cxf.apache.org/docs/transformationfeature.html) to add namespaces to
the elements as they come in. That may work.
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com