You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ChadDavis <ch...@gmail.com> on 2007/01/12 02:38:49 UTC

transport out has not been set

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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: transport out has not been set

Posted by ChadDavis <ch...@gmail.com>.
Okay, so it turns out that I didn't have all of the jars from the
distribution's lib file in my classpath.  The error I received on
trying to run the client was, however, a configuration related error.
I guess this must be because some implementation class with the
default configuration was not found; shouldn't the framework through a
classnotfound error??? There's probably some good reason for this, but
its confusing.



On 1/12/07, ChadDavis <ch...@gmail.com> wrote:
> Thanks for you help.  I'm still not there yet though.
>
> Actually, I didn't change anything in axis2.xml  I started to suspect
> that the problem was related to the configuration.  So, is that client
> supposed to read the axis2.xml file?  If so, how does it know where to
> find it?
>
> Interestingly enought, when I executed the client via the axis2.sh
> script, which I notice passes in params to indiciate the location of
> the axis2.xml file, I get a different error message.  "A required
> header representing a message addressing header is not present"
>
> All of this seems to indicate that I need to understand the
> configuration via the axis2.xml.  I've looked at the documentaiton but
> still don't understand how the client reads the axis2.xml file.  ALSO,
> which class is bing configured in the case of the client?  AND is
> there ever a case where it can run successfully without reading the
> axis2.xml file?
>
> On 1/11/07, Charitha Kankanamge <ch...@wso2.com> wrote:
> > 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: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: transport out has not been set

Posted by ChadDavis <ch...@gmail.com>.
Thanks for you help.  I'm still not there yet though.

Actually, I didn't change anything in axis2.xml  I started to suspect
that the problem was related to the configuration.  So, is that client
supposed to read the axis2.xml file?  If so, how does it know where to
find it?

Interestingly enought, when I executed the client via the axis2.sh
script, which I notice passes in params to indiciate the location of
the axis2.xml file, I get a different error message.  "A required
header representing a message addressing header is not present"

All of this seems to indicate that I need to understand the
configuration via the axis2.xml.  I've looked at the documentaiton but
still don't understand how the client reads the axis2.xml file.  ALSO,
which class is bing configured in the case of the client?  AND is
there ever a case where it can run successfully without reading the
axis2.xml file?

On 1/11/07, Charitha Kankanamge <ch...@wso2.com> wrote:
> 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: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: transport out has not been set

Posted by Charitha Kankanamge <ch...@wso2.com>.
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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org