JWS and XML

  • Thread starter Manish Hatwalne
  • Start date
M

Manish Hatwalne

I am doing lot of XML parsing in my JWS application. If the application is
run as a standalone application, it runs properly. But when I run it as a
JWS enabled application, it is giving me some problems. It throws an
exception while running following code -

public String XMLDocumentToString(Node node) { try { Transformer
xsltIdentity = TransformerFactory.newInstance().newTransformer();
DOMSource domSource = new DOMSource(node); StringWriter stringWriter = new
StringWriter(); StreamResult streamResult = new
StreamResult(stringWriter); xsltIdentity.transform(domSource,
streamResult); return stringWriter.toString(); } catch(Exception e)
{ System.out.println("Can not convert XML document to String " + e);
return null; } }
The exception thrown by the JWS is -
Can not convert XML document to String
org.apache.xml.utils.WrappedRuntimeException: Output method is xml could not
load output_xml.properties (check CLASSPATH)

The code DOES work as a standalone application, so that is not a problem.
How do I get it to work with JWS? Is there any other way of converting XML
doc to a String.

- Manish
 
M

Manish Hatwalne

The code is really messed up, so posting it again -

public String XMLDocumentToString(Node node)
{
try
{
Transformer xsltIdentity =
TransformerFactory.newInstance().newTransformer();
DOMSource domSource = new DOMSource(node);
StringWriter stringWriter = new StringWriter();
StreamResult streamResult = new StreamResult(stringWriter);
xsltIdentity.transform(domSource, streamResult);
return stringWriter.toString();
}
catch(Exception e)
{
System.out.println("Can not convert XML document to String" + e);
return null;
}
}

- Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top