ws-jaxme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stracuzzi Stefano <Stefano.Stracu...@siemens.com>
Subject Problems with unmarshalling and targetNameSpace
Date Tue, 08 Feb 2005 08:27:02 GMT
Hi guys,
	i had this simple schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:hl7-org:v2xml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns="urn:hl7-org:v2xml"
elementFormDefault="qualified">
	<xs:annotation>
		<xs:appinfo>
			<jaxb:schemaBindings>
				<jaxb:package name="net.stracca.xml"/>
			</jaxb:schemaBindings>
		</xs:appinfo>
	</xs:annotation>
	<xs:element name="QRY_A19">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="MSH" type="MSH"
minOccurs="1" maxOccurs="1"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="MSH">
		<xs:sequence>
			<xs:element ref="MSH.1" minOccurs="1"
maxOccurs="1"/>
			<xs:element ref="MSH.2" minOccurs="1"
maxOccurs="1"/>
			<xs:element ref="MSH.3" minOccurs="0"
maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="MSH.1" type="xs:string"/>
	<xs:element name="MSH.2" type="xs:string"/>
	<xs:element name="MSH.3" type="xs:string"/>
</xs:schema>

I generate my classes but when i try to unmarshall XMLs without the
namespace defined like this one:
<QRY_A19>
   <MSH>
      <MSH.1>foo</MSH.1>
      <MSH.2>bar</MSH.2>
      <MSH.3>foo</MSH.3>
   </MSH>
</QRY_A19>

i had this error:

javax.xml.bind.UnmarshalException: No manager configured for QRY_A19
	at
org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.jav
a:101)
	at net.stracca.tests.testXml.executeUnMarshall(testXml.java:47)
	at net.stracca.tests.testXml.main(testXml.java:37)
Caused by:
javax.xml.bind.UnmarshalException: No manager configured for QRY_A19
	at
org.apache.ws.jaxme.impl.JAXBContextImpl.getJMHandler(JAXBContextImpl.java:2
58)
	at
org.apache.ws.jaxme.impl.JMUnmarshallerHandlerImpl.startElement(JMUnmarshall
erHandlerImpl.java:118)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRoot
ElementHook(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at
org.apache.ws.jaxme.impl.JMUnmarshallerImpl.unmarshal(JMUnmarshallerImpl.jav
a:98)
	at net.stracca.tests.testXml.executeUnMarshall(testXml.java:47)
	at net.stracca.tests.testXml.main(testXml.java:37)

but when i try to unmarshall xmls like this one:
<QRY_A19 xmlns="urn:hl7-org:v2xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <MSH>
      <MSH.1>foo</MSH.1>
      <MSH.2>bar</MSH.2>
      <MSH.3>foo</MSH.3>
   </MSH>
</QRY_A19>

it's all right.

There's the possibility to accept the 2 types of xml? i receive this xml
from different other application and they sent me this 2 types of xmls :(

Thank's a Lot

Stefano Stracuzzi

Mime
View raw message