axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jerome.mariette" <jer...@mbari.org>
Subject Re: problem when axessing a method
Date Fri, 12 Oct 2007 04:03:21 GMT


allright, just change of version of axis2.war to the 1.3 and everything is
working ;)







jerome.mariette wrote:
> 
> Hi everybody,
> I wrote a basic web service:  
>   public String test (String t) {
>     return (t);
>   }
> 
> when deployed, I have access to it easily throught my broser: 
>   http://localhost:8080/axis2/services/Test/test?t=I love axis
> 
> But when writing a java client:
>       public static void main(String[] args) throws Exception {
>         ServiceClient client = new ServiceClient();
>         // create option object
>         Options opts = new Options();
>         //setting target EPR
>         opts.setTo(new
> EndpointReference("http://localhost:8080/axis2/services/Test/test"));
>         //Setting action ,and which can be found from the wsdl of the
> service
>         opts.setAction("urn:test");
>         client.setOptions(opts);
>         OMElement res = client.sendReceive(createPayLoad());
>         System.out.println(res);
> 
>     }
> 
>     public static OMElement createPayLoad() {
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace omNs = fac.createOMNamespace("http://axis.org",
> "ns1");
>         OMElement method = fac.createOMElement("test", omNs);
>         OMElement value = fac.createOMElement("t", omNs);
>         value.setText("I Love Axis");
>         method.addChild(value);
>         return method;
>     }
> 
> This is not working !!!  and I get the following error:
> Exception in thread "main" org.apache.axis2.AxisFault: Exception occurred
> while trying to invoke service method test
> 	at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:434)
> 	at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:373)
> 	at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
> 	at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:520)
> 	at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:500)
> 	at TestClient.main(TestClient.java:20)
> 
> But if I implement a webService without any parameter (what I don't want):
>   public String test () {
>     return ("I love axis");
>   }
> 
> This is working fine !!!!
> I know I got that working before ... and have no idea what I did since
> last time !! I just deleted my axis2 folder by mistake, but I added all
> the library I need (and I actully don't need any here !!!) so it should
> work
> 
> do u have any idea ???
> thx
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-when-axessing-a-method-tf4611296.html#a13168815
Sent from the Axis - User mailing list archive at Nabble.com.


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


Mime
View raw message