-3

Hi i am using OSB 11g.

I am having trouble whith not well formed xml.

My service has to be any xml service. Some of the xml's I receive are not well formed.

If i use messaging service is able to check an not well formed xml in the java callout.

but when I use any xml service before the java callout osb tries to parse the xml

and i get this error : Failure while unmarshalling message: Failed to parse XML text

Is there any way to handle not well formed xml in any XML service ?

When i receive a not well formed XML I want to handle it in the java callout.

Ophium
  • 1
  • 1
  • 3

1 Answers1

1

I know nothing about OSB, but...

A standard XML parser will not parse ill-formed XML.

There are "tolerant" parsers out there which will attempt to recover and deliver their best guess at what you intended. I believe the W3C's "tidy" tool can be (ab)used for this purpose; there are others. Mostly these are used in authoring environments such as text editors with "xml assist" modes or tools to do a one-time fixup of data, because the best guess is often incomplete or wrong and a human has to be involved in helping to correct the problem.

The better answer, in the long term, is to get the folks producing your XML to fix their tools. The best reason for using XML is interoperability, and if it isn't correct XML it isn't interoperable.

keshlam
  • 7,931
  • 2
  • 19
  • 33
  • You are right. The best way is to make the folks send well formed XML. But the problem is dont know who is sending the message. That's why I want to see the message and trace who is sendding. If the java callout is called i could do anything but before the java callout is called osb tries to parse the xml an throws error and the java callout is never called. – Ophium Dec 27 '13 at 01:07
  • In that case, running the document through a cleanup step such as tidy before letting osb parse it is the best suggestion I can give you. The results may not be what you expected or wanted, but that's the nature of ill-formed documents; if they don't have a well-defined meaning, any meaning you give them is going to be a guess. – keshlam Dec 27 '13 at 01:27