I'm using jboss 4.0.0. and am having problems with attachments when using saaj. The only success I have is if I attach using MIME type text/plain and set content to a String.
If I try to set MIME type to application/xml or text/xml and set content to be JDOMSource then I get IllegalArgument exception:
If I try to set MIME type to application/xml or text/xml and set content to javax.xml.transform.stream.StreamSource then I get null pointer exception :
13:40:03,032 ERROR [EBXMLTransportActivatorBean] java.lang.NullPointerException
13:40:03,032 INFO [STDOUT] java.lang.NullPointerException
13:40:03,042 INFO [STDOUT] at org.apache.axis.attachments.ManagedMemoryData
13:40:03,042 INFO [STDOUT] at org.apache.axis.attachments.AttachmentPartImp
13:47:57,683 ERROR [EBXMLTransportActivatorBean] java.lang.IllegalArgumentExcep
ion: Cannot content type 'text/xml' for: org.jdom.transform.JDOMSource@2fe64a
13:47:57,723 INFO [STDOUT] java.lang.IllegalArgumentException: Cannot content
ype 'text/xml' for: org.jdom.transform.JDOMSource@2fe64a
13:47:57,763 INFO [STDOUT] at org.apache.axis.attachments.AttachmentPartIm
I would gratefully appreciate it if someone has some experience to offer on adding a StreamSource as an attachment with jboss-saaj.
1) yes, no
3) Since there is no support for the wrapped style, you can either use the saaj manually to construct and send the messages or integrate a toolkit that supports the wrapped style. Which is better I don't know.
4) no, 1.2
Indeed, the best support you get for the standard WS4EE technology. The wiki explains in detail the server and client programming model.
It tells you how to create service endpoints from POJO and SLSB and how to access remote web services from all sorts of J2EE components.
Your concern about SAAJ I don't understand. SAAJ is mainly interfaces and jboss-saaj is an implementation of those interfaces and factory methods. The only reason not to use jboss-saaj is when you want to completely replace the jboss WS support with some other technology, which probably is not trivial.
I have heared of people using JWSDP inside jboss, but then of course you loose the standard WS4EE deployment functionality and you are back to propriatory (unportable) code.
I have been investigating using jboss-saaj and am fairly happy with this. I notice that with JAXM, there is a JAXMServlet and ReqRespListener class.
Can you confirm whether it would be wise to use JAXM with JBoss and whether I can simply drop the two JAXM jar files into the jboss server/lib?
I can just use saaj within an ordinary servlet, but I like the idea of JAXM albeit that I heard it was not favoured by IBM and others.
Also, I am aiming to use jdom for XML processing - is this good practice for jboss or is it preferred to use dom4j, which ships with jboss?
One final question, does jboss 4.0.0 allow you to add jdom.jar etc to the ear file? I have tried using a manifest with Class-Path, but the Classloader cannot find it.
Thanks in advance,