Hi ChadDavis,
I deployed the UserGuideSampleService as mentioned in the axis2 new user guide and created the client by copying the code included in youe email. (Which is the same given in the user guide). I was able to invoke the service without having any issues. I tried with Tomcat 5.5.16 and the embedded axis2 server. Got the same results in both instances. My Java version is 1.5.0_06 and axis vesrion axis2-1.1.1.

It seems that you have changed the default settings in the axis2.xml. Please check your axis2.xml and try again.

Regards
Charitha


ChadDavis wrote:
I'm trying to run a client from the new user guide.  When I run it I
get the message that the transport out has not been set.  The code is
directly from the user guide, but I 'll post it here for convenience.
What causes this error?

package org.apache.axis2.axis2userguide;

import javax.xml.stream.XMLStreamException;
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.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.Constants;
import org.apache.axis2.client.ServiceClient;

public class SampleClient {

      private static EndpointReference targetEPR =
            new EndpointReference(
"http://localhost:8080/axis2/services/UserGuideSampleService";);

       public static OMElement greetUserPayload(String personToGreet) {
           OMFactory fac = OMAbstractFactory.getOMFactory();
           OMNamespace omNs = fac.createOMNamespace(
                   "http://example1.org/example1";, "example1");
           OMElement method = fac.createOMElement("sayHello", omNs);
           OMElement value = fac.createOMElement("personToGreet",
omNs);
           value.addChild(fac.createOMText(value, personToGreet));
           method.addChild(value);
           return method;
       }

       public static void main(String[] args) {
           try {
               OMElement payload =
SampleClient.greetUserPayload("John");
               Options options = new Options();
               options.setTo(targetEPR);

options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

               ServiceClient sender = new ServiceClient();
               sender.setOptions(options);
               OMElement result = sender.sendReceive(payload);

               String response = result.getFirstElement().getText();
               System.out.println(response);

           } catch (Exception e) { //(XMLStreamException e) {
               System.out.println(e.toString());
           }
       }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to