A marshalling exception is thrown when i send back the response to the
client. Does anybody know a solution for this problem?
This Failure only happends when i activate the schema validation on my
server.
By the way: The wsdl itself is quite bit (HL7v3). CXF has generated about
1600 classes out of its schema files.
Tested CXF Versions: 2.1.4, 2.2.6, 2.2.7
--------------------------------
WSDL (snippet):
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="PIXManager" targetNamespace="urn:ihe:iti:pixv3:2007"
xmlns:tns="urn:ihe:iti:pixv3:2007"
xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hl7="urn:hl7-org:v3">
<documentation>Example WSDL for PIX Manager</documentation>
<types>
...
<xsd:schema elementFormDefault="qualified"
targetNamespace="urn:hl7-org:v3"
xmlns:hl7="urn:hl7-org:v3">
<!-- Include the message schema -->
<xsd:include
schemaLocation="MCCI_IN000002UV01.xsd"/>
</xsd:schema>
...
</types>
...
<message name="MCCI_IN000002UV01_Message">
<part element="hl7:MCCI_IN000002UV01" name="Body"/>
</message>
...
<portType name="PIXManager_PortType">
<operation name="PIXManager_PRPA_IN201301UV02">
<input message="tns:PRPA_IN201301UV02_Message"
wsaw:Action="urn:hl7-org:v3:PRPA_IN201301UV02"/>
<output message="tns:MCCI_IN000002UV01_Message"
wsaw:Action="urn:hl7-org:v3:MCCI_IN000002UV01"/>
</operation>
...
</portType>
<binding name="PIXManager_Binding_Soap12"
type="tns:PIXManager_PortType">
<wsoap12:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="PIXManager_PRPA_IN201301UV02">
<wsoap12:operation
soapAction="urn:hl7-org:v3:PRPA_IN201301UV02"/>
<input>
<wsoap12:body use="literal"/>
</input>
<output>
<wsoap12:body use="literal"/>
</output>
</operation>
...
</binding>
...
</definitions>
------------------------------
MCCIIN000002UV01.java
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "MCCI_IN000002UV01")
public class MCCIIN000002UV01
extends MCCIMT000200UV01Message
{
....
}
-----------------------------
package-info.java
@javax.xml.bind.annotation.XmlSchema(namespace = "urn:hl7-org:v3",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.hl7.v3;
-----------------------------
Response Message which invokes
the exception:
Message:
<?xml version="1.0" encoding="UTF-8"?>
<MCCI_IN000002UV01 xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0">
....
</MCCI_IN000002UV01>
------------------------------
After sending back the response
to the client i get the following
Exception:
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot find
the declaration of element 'MCCI_IN000002UV01'.
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:247)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
...
[org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
element 'MCCI_IN000002UV01'.]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:172)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:530)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:222)
...
I've tried almost everything to avoid this exception but without success.
Again, this exception is only thrown if the schema validation is is enabled.
Am I wrong with the namespace or something else? Any other ideas??? Could it
be a bug in the databinding? The wsdl itself should be ok. Do i need the
xmlns:xsi namespace in the response message?
--
View this message in context:
http://old.nabble.com/org.xml.sax.SAXParseException%3A-cvc-elt.1%3A-Cannot-find-the-declaration-of-element-%27MCCI_IN000002UV01%27-tp28094095p28094095.html
Sent from the cxf-user mailing list archive at Nabble.com.