users@saaj.java.net

[SAAJ-USR] How to append org.w3c.dom.Node (from other doc) to SOAPElement, but using SAAJ 1.1.1

From: Karr, David <David.Karr_at_wamu.net>
Date: Fri, 30 Jan 2004 14:14:39 -0800

A while ago, using JWSDP 1.3, I figured out how to create a SOAPMessage,
and take an existing DOM document object and take a Node out of that
document and append it to a SOAPElement in the SOAPMessage, using the
strategy of first importing the Node (and its children) into the
document, and then appending it as a child. This works with JWSDP 1.3
(SAAJ 1.2), but only with standalone code and with Tomcat.

Unfortunately, I'm using WebLogic 8.1, which internally uses SAAJ 1.1.1
(approximately). As SAAJ 1.1.1 is somewhat limiting (the "Node" class
doesn't extend "org.w3c.dom.Node", which makes it difficult to copy
Nodes to a SOAPMessage), I'm trying to get my app to use the latest one
instead of the WebLogic one. I've tried several things to get this to
work.

I'm putting the saaj-api and saaj-impl jars in WEB-INF/lib. I tried
setting the "endorsed_dirs" property at WLS startup, but that caused
numerous exceptions at WLS startup.

If I just use "MessageFactory.createInstance()", I get "Unable to create
message factory for SOAP: null". I then tried two different things,
both of which got past this problem, but hit another one. One is
setting the "javax.xml.soap.MessageFactory" system property to
"com.sun.xml.messaging.saaj.soap.MessageFactoryImpl", and the other is
directly calling "new
com.sun.xml.messaging.saaj.soap.MessageFactoryImpl()" instead of
"MessageFactory.createInstance()". Both of these result in the
exception "java.lang.UnsupportedOperationException" being returned from
the "createMessage()" call. In the javadoc for "SOAPConnectionFactory",
which might be related, I saw a statement saying that this exception
means "... then the implementation does not support the SAAJ
communication infrastructure".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_saaj.dev.java.net
For additional commands, e-mail: users-help_at_saaj.dev.java.net