Return-Path: Delivered-To: apmail-ws-sandesha-dev-archive@www.apache.org Received: (qmail 6740 invoked from network); 17 Jul 2006 13:45:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jul 2006 13:45:28 -0000 Received: (qmail 65271 invoked by uid 500); 17 Jul 2006 13:45:16 -0000 Delivered-To: apmail-ws-sandesha-dev-archive@ws.apache.org Received: (qmail 65209 invoked by uid 500); 17 Jul 2006 13:45:16 -0000 Mailing-List: contact sandesha-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list sandesha-dev@ws.apache.org Received: (qmail 65188 invoked by uid 99); 17 Jul 2006 13:45:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 06:45:16 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [129.183.4.8] (HELO ecfrec.frec.bull.fr) (129.183.4.8) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 06:45:15 -0700 Received: from localhost (localhost [127.0.0.1]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 491B819D921; Mon, 17 Jul 2006 15:44:53 +0200 (CEST) Received: from ecfrec.frec.bull.fr ([127.0.0.1]) by localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25622-05; Mon, 17 Jul 2006 15:44:48 +0200 (CEST) Received: from ecn002.frec.bull.fr (ecn002.frec.bull.fr [129.183.4.6]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 8956019D913; Mon, 17 Jul 2006 15:44:48 +0200 (CEST) Received: from [129.183.149.72] ([129.183.149.72]) by ecn002.frec.bull.fr (Lotus Domino Release 5.0.12) with ESMTP id 2006071715491707:45224 ; Mon, 17 Jul 2006 15:49:17 +0200 Message-ID: <44BB9439.7030504@bull.net> Date: Mon, 17 Jul 2006 15:44:25 +0200 From: Mancinelli Elodie User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en MIME-Version: 1.0 To: axis-user@ws.apache.org, sandesha-dev@ws.apache.org, Chamikara Jayalath Subject: Re: [MTOM/XOP+WSRM] servlet error References: <44B653C2.4080907@bull.net> <9d4ec10b0607131542y1da072aag5ac57a5d60ddcf3b@mail.gmail.com> <44BB326A.8010807@bull.net> In-Reply-To: <44BB326A.8010807@bull.net> X-MIMETrack: Itemize by SMTP Server on ECN002/FR/BULL(Release 5.0.12 |February 13, 2003) at 17/07/2006 15:49:17, Serialize by Router on ECN002/FR/BULL(Release 5.0.12 |February 13, 2003) at 17/07/2006 15:49:18, Serialize complete at 17/07/2006 15:49:18 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Scanned: by amavisd-new at frec.bull.fr X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, Can you think the problem is due to the tomcat version? Or the sandesha2 version? I download jars and war on http://people.apache.org/repository/sandesha2/. To configure the server,I have only change the axis2.xml. I can't change the module.xml because I intente to create a common server for all independante client (WSRM only, MTOM only, MTOM-WSRM). Sorry to insit. Regards Elodie Mancinelli Elodie wrote: > Hi Chamikara, > > I use tomcat in the server side and its version is the > apache-tomcat-5.5.15. > I join in attachment my client code. > > Thanks for your help. > > Regards > > Elodie > > > > Chamikara Jayalath wrote: > >> Hi Elodie, >> >> Are you using tomcat in the server side. If so which version? >> Can u send your client code as well. >> >> Chamikara >> >> >> On 7/13/06, *Mancinelli Elodie* > > wrote: >> >> Hi all, >> >> I want to realise an client-server which supports MTOM and WSRM. I >> created separatly a client-server with MTOM and a client-server >> with WSRM. >> >> My server has two methods: OneWay and RequestResponse. >> >> - When I launch my client to test the RequestResponse method: >> In TCPMon, I see, the CreateSequence and the >> CreateSequenceResponse. My >> first message is sent and it is accpeted. >> But my client never receives the response and there is no trace >> on my >> server, the method seems not be executed. >> >> - When I launch my client to test the OneWay method: >> In TCPMon, I see: >> - CreateSequence, CreateSequenceResponse >> - Three messages have send and three acknowledgments >> But no TerminateSequence. >> And on the server, there is an error: >> - "Servlet.service()" pour la servlet AxisServlet a g�n�r� une >> exception >> java.lang.IllegalStateException: Impossible de cr�er une >> sessionapr�s >> que la r�ponse ait �t� envoy�e >> at >> >> org.apache.catalina.connector.Request.doGetSession(Request.java:2214) >> at >> org.apache.catalina.connector.Request.getSession(Request.java:2024) >> at >> >> org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831) >> >> at >> ........ > >------------------------------------------------------------------------ > >package fr.gouv.finances.dgme.presto; > >import java.io.File; >import java.io.FileInputStream; >import javax.activation.DataHandler; >import javax.activation.FileDataSource; >import javax.xml.stream.XMLInputFactory; >import javax.xml.stream.XMLStreamReader; >import org.apache.axiom.om.OMAbstractFactory; >import org.apache.axiom.om.OMElement; >import org.apache.axiom.om.OMFactory; >import org.apache.axiom.om.OMNamespace; >import org.apache.axiom.om.OMText; >import org.apache.axiom.om.impl.builder.StAXOMBuilder; >import org.apache.axiom.soap.SOAP12Constants; >import org.apache.axis2.Constants; >import org.apache.axis2.addressing.EndpointReference; >import org.apache.axis2.client.Options; >import org.apache.axis2.client.ServiceClient; >import org.apache.axis2.client.async.AsyncResult; >import org.apache.axis2.client.async.Callback; >import org.apache.axis2.context.ConfigurationContext; >import org.apache.axis2.context.ConfigurationContextFactory; >import org.apache.axis2.context.MessageContextConstants; >import org.apache.sandesha2.client.SandeshaClientConstants; > > >public class PrestoWSRM_MTOMtest extends junit.framework.TestCase{ > > static String fileXMLName="test_data_in.xml"; > static String fileNameAttach="fichier.txt"; > private static EndpointReference targetEPR = new EndpointReference("http://localhost:8080/axis2/services/PrestoSvc"); > private static String targetEPRTcpmon ="http://localhost:8070/axis2/services/PrestoSvc"; > static String namespace="http://dgme.finances.gouv.fr/presto"; > private static String CLIENT_REPO_PATH = "RepoClient"; > private static String axis2_xml = CLIENT_REPO_PATH + File.separator +"conf" + File.separator + "axis2.xml"; > > /** > * Call submitRequestReponse with attachment > * > */ > public void testSubmitRequestResponseWSRMAddressable() throws Exception{ > > String nameMethod="submit"; > ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH,axis2_xml); > ServiceClient serviceClient = new ServiceClient (configContext,null); > > Options options=initOptions("submit",true); > serviceClient.setOptions(options); > String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress(); > options.setProperty(SandeshaClientConstants.AcksTo,acksTo); > > System.out.println("Envoi"); > Callback callback1 = new TestCallback ("Callback 1"); > serviceClient.sendReceiveNonBlocking (getOMBlock("message1","sequence1",nameMethod),callback1); > > while (!callback1.isComplete()) { > System.out.println("boucle1"); > Thread.sleep(1000); > } > > Callback callback2 = new TestCallback ("Callback 2"); > serviceClient.sendReceiveNonBlocking(getOMBlock("message2","sequence1",nameMethod),callback2); > > while (!callback2.isComplete()) { > System.out.println("boucle2"); > Thread.sleep(1000); > } > > options.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); > Callback callback3 = new TestCallback ("Callback 3"); > serviceClient.sendReceiveNonBlocking(getOMBlock("message3","sequence1",nameMethod),callback3); > > while (!callback3.isComplete()) { > System.out.println("boucle3"); > Thread.sleep(1000); > } > System.out.println("Fin du programme"); > Thread.sleep(10000); > serviceClient.finalizeInvoke(); > > } > > > /** > * Call submitOneWay with attachment > * > */ > public void testSubmitOneWayWSRMEmetteurAnonyme() throws Exception { > > String nameMethod="submitOneWay"; > ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH,axis2_xml); > ServiceClient sender = new ServiceClient (configContext,null); > > Options options=initOptions("submitOneWay", false); > sender.setOptions(options); > > System.out.println("Envoi"); > > sender.fireAndForget(getOMBlock("","ping1",nameMethod)); > sender.fireAndForget(getOMBlock("","ping2",nameMethod)); > > options.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true"); > sender.fireAndForget(getOMBlock("","ping3",nameMethod)); > > Thread.sleep(10000); > System.out.println("\nResult :"); > System.out.println("NO RETURN FOR WEBSERVICE"); > sender.finalizeInvoke(); > > } > > private OMElement getOMBlock(String text, String sequenceKey, String nameMethod) throws Exception{ > > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMNamespace omNs = fac.createOMNamespace(namespace, "m"); > OMElement payload = getPayload(nameMethod); > > // Attach text file > OMElement filetxt=createAttachment(fac,omNs); > payload.addChild(filetxt); > > // Add sequence number >// OMElement sequenceElem = fac.createOMElement("Sequence",omNs); >// if (nameMethod.equalsIgnoreCase("submit")) sequenceElem.setText(sequenceKey + "-" + text); >// else sequenceElem.setText(sequenceKey); >// payload.addChild(sequenceElem); > > System.out.println("Document sent : "+payload); > > return payload; > > } > > > static class TestCallback extends Callback { > > String name = null; > public TestCallback (String name) { > this.name = name; > } > > public void onComplete(AsyncResult result) { >// Traitement du r�sultat et affichage > System.out.println("\nResult :"); > System.out.println("Callback '" + name + "' got result:" + result.getResponseEnvelope()); > } > > public void onError (Exception e) { > System.out.println("Error reported for test call back"); > e.printStackTrace(); > } > } > > /** > * Define options > * > */ > private static Options initOptions(String nameMethod,boolean SeparateListener){ > > Options options = new Options (); > options.setTo(targetEPR); > options.setAction(nameMethod); > options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); > options.setTransportInProtocol(Constants.TRANSPORT_HTTP); > options.setUseSeparateListener(SeparateListener); > options.setProperty(MessageContextConstants.TRANSPORT_URL,targetEPRTcpmon); > options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); > > return options; > } > > /** > * Get file > * > */ > private OMElement getPayload(String operation) throws Exception { > OMFactory fac = OMAbstractFactory.getOMFactory(); > // Declaration du namespace > OMNamespace omNs = fac.createOMNamespace("http://dgme.finances.gouv.fr/presto", "m"); > // Creation du sommet de l'arborescence > OMElement payload = fac.createOMElement(operation, omNs); > > // Lecture du fichier a recuperer > XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream("test_data_in.xml")); > // Construction de l'element > StAXOMBuilder builder = new StAXOMBuilder(fac, parser); > // Intergration dans l arborescence > payload.addChild(builder.getDocumentElement()); > > return payload; > } > > /** > * Method which create attachment > * > */ > private static OMElement createAttachment(OMFactory fac, OMNamespace omNs) throws Exception{ > > OMElement attach = null; > > // Creation du noeud > attach = fac.createOMElement("attachment", omNs); > // Lecteure de ce fichier > File fileTxt = new File(fileNameAttach); > FileDataSource dataSource = new FileDataSource(fileTxt); > // Transformation en donn�es binaires > DataHandler expectedDH = new DataHandler(dataSource); > OMText textData = fac.createOMText(expectedDH, true); > // Ajout au message soap > attach.addChild(textData); > > return attach; > } > >} > > > >------------------------------------------------------------------------ > >--------------------------------------------------------------------- >To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org >For additional commands, e-mail: axis-user-help@ws.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org For additional commands, e-mail: sandesha-dev-help@ws.apache.org