Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

com.sun.xml.messaging.saaj.soap.MessageFactoryImpl not found

843834Jan 23 2003 — edited Jun 29 2010
I comoiled the following codes. It passed but could not be run.

import javax.xml.soap.*;
import java.io.*;
import javax.xml.transform.stream.*;
import javax.xml.messaging.*;

public class AsinSOAP{
public static void main(String args[]){
try {
javax.xml.soap.MessageFactory factory = javax.xml.soap.MessageFactory.newInstance();
SOAPMessage request = factory.createMessage();
SOAPPart soapPart = request.getSOAPPart();
StreamSource src = new StreamSource(new FileInputStream(args[0]));
soapPart.setContent(src);
SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = conFactory.createConnection();
URLEndpoint endpoint = new URLEndpoint(args[1]);
System.out.println("AsinSearchQuery:");
request.writeTo(System.out);
SOAPMessage response = connection.call(request,endpoint);
System.out.println("AsinSearchResult");
response.writeTo(System.out);

} catch (SOAPException e) {
System.err.println(e.getMessage());
} catch (IOException e){
System.err.println(e.getMessage());
}
}
}


The error was
Unable to create message factory for SOAP: Provider com.sun.xml.messaging.saaj.soap.MessageFactoryImpl not found

I didn't use that class on my program. Why do we need it?



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2010
Added on Jan 23 2003
8 comments
1,739 views