camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ben_rr <bin.k...@gmail.com>
Subject spring-ws component unmarshall Jaxb problem when Payload namespace prefix in attribute value
Date Wed, 16 May 2012 04:47:33 GMT
I have this problem when use spring-ws component as a web service client. It
happens when payload of web service response has namespace prefix in
attribute value.

my route looks like,

from("direct:callWebService").marshall(jaxbDataFormat).to("spring-ws:someServer?soapAction=someAction").unmarshall(jaxbDataFormat)

I can see the web service has been called successfully from the server side
and response returned as well.
But when the payload has namespace prefix in attribute value I have an
unmarshall problem.

exception in log, 

/hangeId: ID-MELWKS-0433-64949-1337140734480-0-3). Exhausted after delivery
attempt: 1 caught: java.lang.IllegalArgumentException: prefix n2 is not
bound to a namespace
java.lang.IllegalArgumentException: prefix n2 is not bound to a namespace
        at
com.sun.xml.bind.DatatypeConverterImpl._parseQName(DatatypeConverterImpl.java:385)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyXsiLoader.selectLoader(LeafPropertyXsiLoader.java:86)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyXsiLoader.startElement(LeafPropertyXsiLoader.java:69)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:481)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:148)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
        at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
        at
org.apache.camel.converter.jaxb.JaxbDataFormat.unmarshal(JaxbDataFormat.java:152)/


*soap response*,
<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>

There are related issue opened on spring-ws and xmlBeans
https://issues.apache.org/jira/browse/XMLBEANS-427
and
https://issues.apache.org/jira/browse/XMLBEANS-427

but I still dont have a solution for this.

Please help.
Thanks


--
View this message in context: http://camel.465427.n5.nabble.com/spring-ws-component-unmarshall-Jaxb-problem-when-Payload-namespace-prefix-in-attribute-value-tp5710538.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message