You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Michal <ca...@yahoo.com> on 2007/08/02 18:15:16 UTC
Xfire removes namespace definition from xml
I am having a web service exposed using jsr181 SU. This unit follows
'contract first service' paradigm. So I have a wsdl which input message has
a schema like this:
<xsd:element name="TestRQ">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="Message"
type="xsd:anyType" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Based on this pojo classes are generated by maven plugin.
When I send following message (soap body):
<ns:TestRQ>
<Message>
<S xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.test.org/tset"
xsi:schemaLocation="http://www.test.org/test
../../../xsd/test.xsd">
<body />
</S>
</Message>
</ns:TestRQ>
I see that till Jsr181ExchangeProcessor the message is correct - all
namespaces are present. However, inside implementation of WebService I get a
pojo object (generated by maven and populated by xfire) which field
'message' is a DOM that does not have a definition of xsi prefix (i.e.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance")
Without this prefix definition at later stage xml reader breaks saying that:
com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "xsi"
(for attribute "schemaLocation")
Does anyone know the solution to this problem?
--
View this message in context: http://www.nabble.com/Xfire-removes-namespace-definition-from-xml-tf4207026s12049.html#a11967514
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Xfire removes namespace definition from xml
Posted by Michal <ca...@yahoo.com>.
I have debugged it further.
It is not a problem of XFire. Actually, the problem occurs when the message
is written to JMS queue. The writing is done by Woodstax library inside
XMLStreamHelper class.
I have found that if SoapMarshaler has the flag 'repairingNamespace' set to
true then the problem is fixed - actually I got another problem: default
namespace (in below example it means: http://www.test.org/tset) is not
written :(
I have following question:
1. How can I configure SM to use SoapMarshaler with repairingNamespace flag
set to true?
2. Can I have w Writer which both repairs namespaces and saves default
namespace?
Michal
Michal wrote:
>
> I am having a web service exposed using jsr181 SU. This unit follows
> 'contract first service' paradigm. So I have a wsdl which input message
> has a schema like this:
>
> <xsd:element name="TestRQ">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element minOccurs="1" maxOccurs="1" name="Message"
> type="xsd:anyType" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> Based on this pojo classes are generated by maven plugin.
>
> When I send following message (soap body):
>
> <ns:TestRQ>
> <Message>
>
> <S xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://www.test.org/tset"
> xsi:schemaLocation="http://www.test.org/test
> ../../../xsd/test.xsd">
> <body />
> </S>
> </Message>
> </ns:TestRQ>
>
>
> I see that till Jsr181ExchangeProcessor the message is correct - all
> namespaces are present. However, inside implementation of WebService I get
> a pojo object (generated by maven and populated by xfire) which field
> 'message' is a DOM that does not have a definition of xsi prefix (i.e.
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance")
>
> Without this prefix definition at later stage xml reader breaks saying
> that: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix
> "xsi" (for attribute "schemaLocation")
>
> Does anyone know the solution to this problem?
>
>
>
>
--
View this message in context: http://www.nabble.com/Xfire-removes-namespace-definition-from-xml-tf4207026s12049.html#a11984502
Sent from the ServiceMix - User mailing list archive at Nabble.com.