atom feed13 messages in net.java.dev.jwsdp.usersRe: Problem in creating SOAP connecti...
FromSent OnAttachments
Nic HinesAug 23, 2005 4:47 am.zip
Mårten GustafssonAug 23, 2005 4:58 am 
Neeraj BajajAug 24, 2005 12:02 am 
Nic HinesAug 24, 2005 1:52 am 
Neeraj BajajAug 24, 2005 2:03 am 
soumya shriAug 25, 2005 8:01 am 
Farrukh NajmiAug 25, 2005 12:59 pm 
Farrukh NajmiAug 26, 2005 10:00 am 
Farrukh NajmiAug 26, 2005 10:01 am 
soumya shriAug 30, 2005 6:44 am 
V B Kumar JayantiAug 30, 2005 10:42 pm 
soumya shriSep 1, 2005 5:51 am 
Neeraj BajajSep 6, 2005 2:05 am 
Subject:Re: Problem in creating SOAP connection Factory
From:V B Kumar Jayanti (Vbku@Sun.COM)
Date:Aug 30, 2005 10:42:00 pm
List:net.java.dev.jwsdp.users

I tried your program on linux with the following command line and it works without any problems

java -classpath ./saaj/lib/saaj-impl.jar:./saaj/lib/saaj-api.jar:./jwsdp-shared/lib/activation.jar:./jwsdp-shared/lib/mail.jar:.:.fastinfoset/lib/FastInfoset.jar SOAPSend

REQUEST:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!--

Check that your classpath is correct, enable -verbose option for java and debug the output.

soumya shri wrote:

Hi, I am trying to execute a stand alone program using SAAJ which sends the message to an endpoint.

I am getting the following error when tried executing it. Unable to create SOAP connection factory: Provider com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory not found

I have these JAR files included in my class path.

C:\Sun\jwsdp-1.6\xmldsig\lib\xmldsig.jar; C:\Sun\jwsdp-1.6\jwsdp-shared\lib\xmlsec.jar; C:\Sun\jwsdp-1.6\saaj\lib\saaj-api.jar; C:\Sun\jwsdp-1.6\saaj\lib\saaj-impl.jar; C:\Sun\jwsdp-1.6\jwsdp-shared\lib\commons-logging.jar; C:\Sun\jwsdp-1.6\jwsdp-shared\lib\mail.jar; C:\Sun\jwsdp-1.6\jwsdp-shared\lib\activation.jar; C:\Sun\jwsdp-1.6\jaxp\lib\endorsed\dom.jar; C:\Sun\jwsdp-1.6\jaxp\lib\endorsed\sax.jar; C:\Sun\jwsdp-1.6\jaxp\lib\endorsed\xalan.jar; C:\Sun\jwsdp-1.6\jaxp\lib\endorsed\xercesImpl.jar

Can anyone tell me what i am missing?

Here is my program.

import javax.xml.soap.SOAPConnectionFactory; import javax.xml.soap.SOAPConnection; import javax.xml.soap.MessageFactory; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPPart; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPElement; import java.io.FileInputStream; import javax.xml.transform.stream.StreamSource;

import javax.xml.transform.TransformerFactory; import javax.xml.transform.Transformer; import javax.xml.transform.Source;

import javax.xml.transform.stream.StreamResult;

public class SOAPSend {

public static void main(String args[]) {

try {

//First create the connection

SOAPConnectionFactory soapConnFactory =

SOAPConnectionFactory.newInstance(); SOAPConnection connection =

soapConnFactory.createConnection();

//Next, create the actual message MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage message = messageFactory.createMessage();

//Create objects for the message parts SOAPPart soapPart = message.getSOAPPart(); SOAPEnvelope envelope = soapPart.getEnvelope(); SOAPBody body = envelope.getBody();

//Populate the Message StreamSource preppedMsgSrc = new StreamSource( new FileInputStream("mca.msg")); soapPart.setContent(preppedMsgSrc);

//Save the message message.saveChanges();

//Check the input System.out.println("\nREQUEST:\n"); message.writeTo(System.out); System.out.println();

//Send the message and get a reply

//Set the destination String destination = "some destination which i will specify later"; //Send the message SOAPMessage reply = connection.call(message, destination);

//Check the output System.out.println("\nRESPONSE:\n"); //Create the transformer TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); //Extract the content of the reply Source sourceContent = reply.getSOAPPart().getContent(); //Set the output for the transformation StreamResult result = new StreamResult(System.out); transformer.transform(sourceContent, result); System.out.println();

//Close the connection connection.close();

} catch(Exception e) { System.out.println(e.getMessage()); } } }

thanks, soumya