Envoyé de mon iPhone

Le 22 févr. 2010 à 23:22, Mohannad Hammadeh <mohannad.hamma...@orionhealth.c om> a écrit :


----- Original Message -----
From: "Paul Grillo" <paul.gri...@trivininc.com>
To: java-user@axis.apache.org
Sent: Tuesday, February 23, 2010 10:06:48 AM
Subject: unsubscribe





From: Oleg Kozlov [mailto:oleg.koz...@leadpoint.com]
Sent: Monday, February 22, 2010 3:50 PM
To: java-user@axis.apache.org
Subject: illegal XML character 0x8 from a .Net SOAP service :(



Hello,



I have an Axis2 1.5.1 (Java) client, auto-generated by wsdl2java with XmlBeans framework.



I'm integrating with a new vendor that has a SOAP web service written in .Net. The service is basically a wrapper around a legacy telephony switch. The service returns 1-9 binary numbers in its response in one of the XML elements. I have to point out that I our (client) side we do not even need to use that element at all, it just has some meaningless data... Apparently our vendor's other clients are all using .Net and the .Net framework does not care about inserting or parsing illegal characters in the SOAP Body ...



So, I'm getting an exception (see below).



I tried solving this problem by writing a custom Axis2 client module where I get access to the XML element that contains illegal characters and either set it's text value to blank string, or detach and get rid of the whole XML element altogether (since I don't need it). However, every time I iterate to the bad XML element - the parser blows up with the parsing error again inside my custom module. Also, due to the fact that Axis is using pull parsing method - there is no way to jump over the element with binary data, so I was not able to copy the entire XML DOM into a new DOM document skipping over the bad element.



I could not find a way to get low level access to XML stream where I could, for example, read from an input stream and write to an output stream, and skip over the illegal character.



Can anyone recommend another solution?



==============================

org.apache.axis2.AxisFault: [com.ctc.wstx.exc.WstxLazyException] Illegal character entity: expansion character (code 0x8) not a valid XML character
 at [row,col {unknown-source}]: [1,13020]
 at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at leadpoint.voice.service.paetec.callrecords.client.ServiceStub.fromOM (ServiceStub.java:3315) at leadpoint.voice.service.paetec.callrecords.client.ServiceStub.getEnhancedCDR( ServiceStub.java:1063) at leadpoint.voice.service.paetec.callrecords.client.ServiceTest.testgetEnhancedCDR( ServiceTest.java:184)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at com.intellij.junit3.JUnit3IdeaTestRunner.doRun (JUnit3IdeaTestRunner.java:108) at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs (JUnit3IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart (JUnitStarter.java:165) at com.intellij.rt.execution.junit.JUnitStarter.main (JUnitStarter.java:60)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java: 110) Caused by: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxParsingException: Illegal character entity: expansion character (code 0x8) not a valid XML character
 at [row,col {unknown-source}]: [1,13020]
at com.ctc.wstx.exc.WstxLazyException.throwLazily (WstxLazyException.java:45) at com.ctc.wstx.sr.StreamScanner.throwLazyError(StreamScanner.java: 704) at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java:3657) at com.ctc.wstx.sr.BasicStreamReader.getTextCharacters (BasicStreamReader.java:830) at javax.xml.stream.util.StreamReaderDelegate.getTextCharacters (StreamReaderDelegate.java:158) at org.apache.axiom.om.impl.builder.SafeXMLStreamReader.getTextCharacters( SafeXMLStreamReader.java:113) at org.apache.axiom.om.impl.llom.OMStAXWrapper.getTextCharacters (OMStAXWrapper.java:418) at org.apache.axiom.om.util.OMXMLStreamReaderValidator.getTextCharacters (OMXMLStreamReaderValidator.java:239) at org.apache.xmlbeans.impl.store.Locale.loadXMLStreamReader (Locale.java:1154) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject (Locale.java:843) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject (Locale.java:826) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse (SchemaTypeLoaderBase.java:231) at com.paetec.e800ws.xmlservices.GetEnhancedCDRResponseDocument $Factory.parse(GetEnhancedCDRResponseDocument.java:165) at leadpoint.voice.service.paetec.callrecords.client.ServiceStub.fromOM (ServiceStub.java:3226)
 ... 23 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal character entity: expansion character (code 0x8) not a valid XML character
 at [row,col {unknown-source}]: [1,13020]
at com.ctc.wstx.sr.StreamScanner.constructWfcException (StreamScanner.java:605) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java: 461) at com.ctc.wstx.sr.StreamScanner.reportIllegalChar (StreamScanner.java:2375) at com.ctc.wstx.sr.StreamScanner.checkAndExpandChar (StreamScanner.java:2321) at com.ctc.wstx.sr.StreamScanner.resolveSimpleEntity (StreamScanner.java:1180) at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary (BasicStreamReader.java:4675) at com.ctc.wstx.sr.BasicStreamReader.readCoalescedText (BasicStreamReader.java:4124) at com.ctc.wstx.sr.BasicStreamReader.finishToken (BasicStreamReader.java:3699) at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java:3647)
 ... 34 more

==============================



Thank you,

Oleg.

NOTICE: This e-mail message and any attachments are confidential. Dissemination of this information by any person, including the intended recipient, or use of this information by any person other than the intended recipient is unauthorized. If you are not the intended recipient: please notify me by return e-mail as soon as possible, do not open any attachment and delete this communication and any copies from your computer. Thank you.

--
Mohannad Hammadeh | Legacy Interface Developer | Orion Health

P: +64 9 638 0600 | M: +64 21 334 143
F: +64 9 638 0699 | skype: mohannad.hammadeh

Orion Health | www.orionhealth.com

2nd Floor, Orion House | Cnr Mary and Enfield St | Mount Eden | Auckland 1003 | New Zealand

This e-mail and any attachments are intended only for the person to whom it is addressed and may contain privileged, proprietary, or other data protected from disclosure under applicable law. If you are not the addressee or the person responsible for delivering this to the addressee you are hereby notified that reading, copying or distributing this transmission is prohibited. If you have received this e-mail in error, please telephone us immediately and remove all copies of it from your system. Thank you for your co-operation.


Reply via email to