Thanks Christian. I have checked the JAXB namespace prefix mapping, but in my case I am only the web service client and all jaxb mappings are generated from server wsdl file by wsdl2java. And my problem is not marshalling but unmarshall response from web service server. It is more like a spring-ws camel component problem to me.
>From my debugging, around code org.apache.camel.component.spring.ws.SpringWebserviceProducer.java line 59 *body = endpoint.getConfiguration().getWebServiceTemplate().sendSourceAndReceive(sourcePayload, callback, SOURCE_EXTRACTOR);* When the web service response is <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n2="http://www.ben_rr.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <n:loginResponse xmlns:n="http://www.ben_rr.com/"> <n:Result xsi:type="n2:LoginResp"> <header xsi:type="n2:APIResponseHeader"> <errorCode xsi:type="n2:APIErrorEnum">OK</errorCode> <timestamp xsi:type="xsd:dateTime">2012-05-16T03:57:03.782Z</timestamp> </header> <errorCode xsi:type="n2:LoginErrorEnum">OK</errorCode> <minorErrorCode xsi:nil="1"/> <validUntil xsi:type="xsd:dateTime">0001-01-01T00:00:00.000Z</validUntil> </n:Result> </n:loginResponse> </soap:Body> </soap:Envelope> The body returned as a DomSource object with only the soap body which starts with node <n:loginResponse>. The prefix mapping xmlns:n2="http://www.ben_rr.com" on soap envelope is just simply gone then in my camel route an exception "prefix n2 is not bound to a namespace" throw out from org.apache.camel.converter.jaxb.JaxbDataFormat.unmarshal -- View this message in context: http://camel.465427.n5.nabble.com/spring-ws-component-unmarshall-Jaxb-problem-when-Payload-namespace-prefix-in-attribute-value-tp5710538p5711175.html Sent from the Camel - Users mailing list archive at Nabble.com.
