Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Moxy marshalling removes xsi namespace definitions(Moxy marshalling and unmarshalling modifies XML definition and removes xsi attribute)
Moxy marshalling removes xsi namespace definitions [message #1693411] Thu, 23 April 2015 23:30
Amol Navare is currently offline Amol NavareFriend
Messages: 1
Registered: April 2015
Junior Member
Jaw-WS CXF service creates XML output that has missing xsi namespace. This only happens with Moxy and not with JaxB

Here is the overview:

POJOS are generated from WSDL and XSDs.
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory property has been defined in Jaxb.properties file. This is ensuring that eclipselink moxy is used during runtime for marshalling/unmarshalling.
We are using Apache CXF Jax-Ws for our Soap services.
Sample xml returned from downstream service is shown below. This xml is well formed:

 
<message:RetrieveOrderResponse xmlns:common="urn:xyz:om:common:defn:v1" xmlns:message="urn:xyz:om:order:messages:v1" xmlns:xsd="www.w3.org/2001/XMLSchema" xmlns:xsi="www.w3.org/2001/XMLSchema-instance">
 <common:MessageInfo CreateDateTime="2015-04-17T13:13:36.819-07:00" MessageGUID="d8ad2956-ff69-45ff-9d57-c30dc50569a1" TransactionGUID="a772169a-b138-40e7-8d16-ca86b68d38b8">
    <common:DebugTraceBoolean>true</common:DebugTraceBoolean>
 </common:MessageInfo>
 <common:MessageStatus>
    <common:Status>Success</common:Status>
 </common:MessageStatus>
 <common:OrderList>
    <common:Order>
       <common:OrderLineList>
          <common:OrderLine>
             <common:OrderLineData namespace="urn:xyz:e3:data:abc:types:v1" type="xyzProduct">
                <ns2:xyzProduct xmlns:datatype="urn:xyz:om:supply:datatype:defn:v1" xmlns:finance="urn:xyz:e3:data:financetypes:defn:v4" xmlns:internal="urn:xyz:cc:es:order:internal" xmlns:min="xalan://org.jaxen.function.MinDateTimeFunction" xmlns:ns2="urn:xyz:e3:data:abc:types:v1" xmlns:ns3="urn:xyz:e3:data:basetypes:defn:v4" xmlns:ns4="urn:xyz:e3:data:financetypes:defn:v4" xmlns:ns5="urn:xyz:e3:data:timetypes:defn:v4" xmlns:ns6="urn:xyz:e3:data:messagetypes:defn:v5" xmlns:ns7="urn:xyz:e3:data:placetypes:defn:v4" xmlns:ns8="urn:xyz:om:supply:messages:defn:v1">
                   <ns2:abcProduct>
                      <ns2:DiningSeatingInformation>
                         <BookingStatusCode xsi:nil="true"/>
                         <DinSeatingCode xsi:nil="true"/>
                      </ns2:DiningSeatingInformation>
                   </ns2:abcProduct>
                </ns2:xyzProduct>
             </common:OrderLineData>
          </common:OrderLine>
       </common:OrderLineList>
    </common:Order>
 </common:OrderList>


We call the downstream service and unmarshall the response into a POJO.
POJO is then sent in service Response. On the client side the xml received from service client is missing
xmlns:xsd="www.w3.org/2001/XMLSchema" xmlns:xsi="www.w3.org/2001/XMLSchema-instance  
namespace definitions. Hence when client tries to unmarshall, following exception is thrown
Because of this unmarshalling on client side fails with error: null:Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred unmarshalling the document Internal Exception: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "xsi" (for attribute "nil") at [row,col {unknown-source}]: [1,7692]

Has anyone encountered similar issue where MOXY is giving trouble with xsi namespace definition during marshalling unmarshalling?

Thanks in advance for your help.

[Updated on: Mon, 27 April 2015 06:18]

Report message to a moderator

Previous Topic:Eclipselink runs in debug but fails in deployed jar - IllegalArgumentException: eclipselink.tolerate
Next Topic:Workbench not shiped in EclipseLink2.6
Goto Forum:
  


Current Time: Sat Nov 09 03:10:01 GMT 2024

Powered by FUDForum. Page generated in 0.02213 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top