Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 58333 invoked from network); 29 May 2007 10:11:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 May 2007 10:11:41 -0000 Received: (qmail 63449 invoked by uid 500); 29 May 2007 10:11:42 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 63250 invoked by uid 500); 29 May 2007 10:11:41 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 63234 invoked by uid 99); 29 May 2007 10:11:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 03:11:41 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 03:11:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2A83371417D for ; Tue, 29 May 2007 03:11:16 -0700 (PDT) Message-ID: <1639988.1180433476170.JavaMail.jira@brutus> Date: Tue, 29 May 2007 03:11:16 -0700 (PDT) From: "Esteve (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-2222) When In-Reply-To: <27187797.1171948085496.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499757 ] Esteve commented on AXIS2-2222: ------------------------------- Hi, I have been experimenting this problem and I've solved it by including all required dependencies in the classpath. The message is not clear at all. org.apache.axis2 axis2 ${version.axis2} compile org.apache.ws.commons.axiom axiom-api ${version.axiom} compile org.apache.ws.commons.axiom axiom-impl ${version.axiom} compile stax stax ${version.stax} compile wsdl4j wsdl4j ${version.wsdl4j} compile org.apache.ws.commons.schema XmlSchema ${version.XmlSchema} compile commons-fileupload commons-fileupload ${version.commons.fileupload} jar compile jdom jdom 1.0 compile oro oro 2.0.8 compile commons-httpclient commons-httpclient 3.0 jar compile commons-io commons-io 1.1 compile commons-logging commons-logging 1.0.4 jar compile annogen annogen 0.1.0 compile 1.2.14 1.2 1.2.4 1.2.0 20040917 1.6.2 1.3.1 1.2 > When > ----- > > Key: AXIS2-2222 > URL: https://issues.apache.org/jira/browse/AXIS2-2222 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Affects Versions: 1.1.1 > Environment: WindowsXP Service Pack 2, Maven2, Java 1.5, Duo Core Processor > Reporter: Andrew J. Leer > Assignee: Deepal Jayasinghe > Attachments: wsaxis2demoBug.zip > > > The Error wrote: > org.apache.axis2.AxisFault: Transport out has not been set > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:662) > at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:237) > at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202) > at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:579) > at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508) > at com.mooo.mv.demo.ws.AppTest.testServiceClient(AppTest.java:111) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > package com.mooo.mv.demo.ws; > import java.io.PrintStream; > import java.io.StringReader; > import javax.xml.namespace.QName; > 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.impl.builder.StAXOMBuilder; > import org.apache.axis2.Constants; > import org.apache.axis2.addressing.AddressingConstants; > import org.apache.axis2.addressing.EndpointReference; > import org.apache.axis2.client.Options; > import org.apache.axis2.client.ServiceClient; > import org.apache.axis2.description.TransportOutDescription; > import org.apache.axis2.transport.http.HTTPConstants; > import junit.framework.Test; > import junit.framework.TestCase; > import junit.framework.TestSuite; > /** > * Unit test for simple App. > */ > public class AppTest > extends TestCase > { > /** > * Create the test case > * > * @param testName name of the test case > */ > public AppTest( String testName ) > { > super( testName ); > } > /** > * @return the suite of tests being tested > */ > public static Test suite() > { > return new TestSuite( AppTest.class ); > } > public static OMElement getPayload() > { > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMNamespace omNs = fac.createOMNamespace("http://bible.sumerano.com/", "tns"); > OMElement method = fac.createOMElement("GetTranslations", omNs); > // OMElement method = fac.createOMElement("getPrice", omNs); > // OMElement value = fac.createOMElement("symbol", omNs); > // value.addChild(fac.createOMText(value, symbol)); > // method.addChild(value); > return method; > } > public void testServiceClient() throws Exception > { > OMElement xmlPayload = getPayload(); > PrintStream ps = System.out; > xmlPayload.serialize(ps); > Options options = new Options(); > options.setTo(new EndpointReference("http://bible.sumerano.com/bible.asmx?WSDL")); > options.setTransportInProtocol(Constants.TRANSPORT_HTTP); > ServiceClient sender = new ServiceClient(); > sender.setOptions(options); > options.setUseSeparateListener(false); > OMElement result = sender.sendReceive(xmlPayload); > result.serialize(ps); > } > } > Now I understand that I've already set the "in" transport protocol. But I really do not know how to set the "out" transport protocol or why I have to do it. The client example in the Axis2 documentation (http://ws.apache.org/axis2/1_1_1/quickstartguide.html) does not require this: > Client Example from quick start guide wrote: > package samples.quickstart.clients; > 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.axis2.Constants; > import org.apache.axis2.addressing.EndpointReference; > import org.apache.axis2.client.Options; > import org.apache.axis2.client.ServiceClient; > public class AXIOMClient { > private static EndpointReference targetEPR = > new EndpointReference("http://localhost:8080/axis2/services/StockQuoteService"); > public static OMElement getPricePayload(String symbol) { > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMNamespace omNs = fac.createOMNamespace("http://axiom.service.quickstart.samples/xsd", "tns"); > OMElement method = fac.createOMElement("getPrice", omNs); > OMElement value = fac.createOMElement("symbol", omNs); > value.addChild(fac.createOMText(value, symbol)); > method.addChild(value); > return method; > } > public static OMElement updatePayload(String symbol, double price) { > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMNamespace omNs = fac.createOMNamespace("http://axiom.service.quickstart.samples/xsd", "tns"); > OMElement method = fac.createOMElement("update", omNs); > OMElement value1 = fac.createOMElement("symbol", omNs); > value1.addChild(fac.createOMText(value1, symbol)); > method.addChild(value1);`q > OMElement value2 = fac.createOMElement("price", omNs); > value2.addChild(fac.createOMText(value2, > Double.toString(price))); > method.addChild(value2); > return method; > } > public static void main(String[] args) { > try { > OMElement getPricePayload = getPricePayload("WSO"); > OMElement updatePayload = updatePayload("WSO", 123.42); > Options options = new Options(); > options.setTo(targetEPR); > options.setTransportInProtocol(Constants.TRANSPORT_HTTP); > ServiceClient sender = new ServiceClient(); > sender.setOptions(options); > sender.fireAndForget(updatePayload); > System.err.println("done"); > OMElement result = sender.sendReceive(getPricePayload); > String response = result.getFirstElement().getText(); > System.err.println("Current price of WSO: " + response); > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > Is this something that hasn't been updated in the tutorial or is there something that I'm missing here? > Thank you, > Andrew J. Leer -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org