axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Agrawal, Vikas IN BLR SISL" <vikaskumar.agra...@siemens.com>
Subject getAsDom() Method is giving error
Date Tue, 11 Mar 2008 09:34:48 GMT

Hello All,

i am calling an wsdl operation which output is in xml form, to parse the
output i am using getAsDOM() method but it is giving following error:

Exception in thread "main" org.xml.sax.SAXException: Fatal Error:
URI=null Line=1: Reference is not allowed in prolog.
at
org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.ja
va:723)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(E
rrorHandlerWrapper.java:177)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XML
ErrorReporter.java:388)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLS
canner.java:1411)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDri
ver.next(XMLDocumentScannerImpl.java:1021)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLD
ocumentScannerImpl.java:645)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XM
LNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(XMLDocumentFragmentScannerImpl.java:508)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:807)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
a:107)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.jav
a:225)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docume
ntBuilderImpl.java:283)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
at
org.apache.axis.message.MessageElement.getAsDocument(MessageElement.java
:1082)
at
org.apache.axis.message.MessageElement.getAsDOM(MessageElement.java:1127
)
at test.CallEdmSrv.main(CallEdmSrv.java:34)
Java Result: 1

My main method is as follow:

public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub

try {

ItkInterfaceLocator a = new ItkInterfaceLocator();
String input_xml = "<ServiceParms><DocumentList><Document
DocId='1'><DocType
DocTypeName='DISCHARG'></DocType></Document></DocumentList><ObjectList><
Object DocId='1' ObjNum='1'><PhysicalObj Fmt='-25'
FileName='\\blr0020\hl7Msg\hl7_4.txt' /> </Object></ObjectList><Owner
OwnerTypeName='ENCOUNTER'
></Owner><Origin><UserId>adminuser</UserId><Workstation>blr0020</Worksta
tion></Origin></ServiceParms>";
IkmSvcAcquireDocumentsResponseIkmSvcAcquireDocumentsResult result = a
.getItkInterfaceSoap().ikmSvcAcquireDocuments(input_xml);
System.out.println("results = " + result);

MessageElement[] msg = (MessageElement[]) result.get_any();
System.out.println("result message == "+msg[0].getAsString());

Element resultData = msg[0].getAsDOM();
System.out.println(""+resultData.getAttribute("DocId"));
// S
System.out
.println("\n======================Results
finished======================");

} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

when i am trying to print result by getAsString() method before calling
getAsDom() it prints like this:
result message == &lt;Results&gt;&lt;ResultCode Code=&quot;0&quot;
/&gt;&lt;ResultData&gt;&lt;DocumentList&gt;&lt;Document
DocId=&quot;VV1B7CFBFF-EE58-11DC-9921-001143E8BC0B/1&quot;
Key=&quot;10C9SL1B7CFBFFEE5811DC9921001143E8BC0B&quot;
Action=&quot;Create&quot;&gt;&lt;CmdDetail&gt;3&lt;/CmdDetail&gt;


 
 
Important notice:This e-mail and any attachment thereto contains corporate proprietary information.
If you have received it by mistake, please notify us immediately by reply e-mail and delete
this e-mail and its attachments from your system. Thank You.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message