SAAJ, SOAP API problem
843834Aug 24 2006 — edited Aug 24 2006I have to create a new soap message from an existing file (attaching the file as the SOAP Attachment unchanged). I am just trying to get started at the moment and have downloaded the SAAJ from the sun web site:
https://saaj.dev.java.net/
I have included the downloaded jar files in my Java/lib folder and included it in my classpath. I am using Net Beans 5 and have also imported the 2 jar files (saaj-api.jar and saaj-impl.jar) to the project library.
I have the code for creating and manipulating the SOAP file but it is all commented out apart from these two lines:
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
I get the error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:47)
at prototype.SOAPFunctions.SOAPRun(SOAPFunctions.java:40)
at prototype.Main.main(Main.java:32)
Can someone please help! I've imported the following to my project:
import javax.xml.soap.*;
import javax.xml.transform.*;
import java.io.FileInputStream;
import com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl;
import javax.xml.transform.stream.*;
import org.w3c.dom.*;