I just downloaded JBoss 4.0.2 and tried to deploy my previous applications 
developed under 4.0.1sp1.

One of them is a JAX-RPC Collector, trying to get a String from a SOAPMessage. 
It was working on 4.0.0 to 4.0.1sp1, now I got an exception. Someone has an 
Idea why, or another way to get the Soap Message as String that will work for 
all versions.

Here is the code:

  | ...
  | SOAPMessageContext soapContext = (SOAPMessageContext) messageContext;
  | SOAPMessage soapMsg = soapContext.getMessage();
  | SOAPEnvelope envelope = soapMsg.getSOAPPart().getEnvelope();
  | String soapText = nodeToString(envelope);
  | ...
  | private String nodeToString(Node node) throws 
TransformerFactoryConfigurationError, TransformerException {
  | 
  |   Source domSource = new DOMSource(node);
  |   StringWriter writer = new StringWriter();
  |   Result result = new StreamResult(writer);
  |   Transformer xformer = TransformerFactory.newInstance().newTransformer();
  |   xformer.transform(domSource, result); //Exception HERE!!
  |   return writer.toString();
  | }
  | 

And the Exception:
anonymous wrote : 
  | 16:22:50,245 ERROR [SOAPElementAxisImpl] Cannot convert SAX to DOM 
attributes
  | org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or 
change an object in a way which is incorrect with regard to namespaces.
  |         at org.apache.xerces.dom.CoreDocumentImpl.checkNamespaceWF(Unknown 
Source)
  |         at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
  |         at org.apache.xerces.dom.AttrNSImpl.(Unknown Source)
  |         at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown 
Source)
  |         at 
org.jboss.axis.message.SOAPElementAxisImpl.convertAttrSAXtoDOM(SOAPElementAxisImpl.java:724)
  |         at 
org.jboss.axis.message.SOAPElementAxisImpl.getAttributes(SOAPElementAxisImpl.java:686)
  |         at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:316)
  |         at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:159)
  |         at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:337)
  |         at ****.nodeToString(***.java:382)
  | ...
  | 

Thanks
Avraham

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3876587#3876587

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3876587


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to