ok I guess I got fast in my conclusion !! because it's not working really
well neither .... si as I know I did everything with the 1.2 I got back with
this version !!!
so I deployed an exemple: the quickstart exemple
from my browser everyything is still working fine ... but from my java code:
Exception in thread "main" org.apache.axis2.AxisFault: Exception occurred
while trying to invoke service method getPrice
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 EssaiMbari1.main(Quickstart.java:35)
so I don't get anything !! my client is:
--------------------------------------------------------------------------------
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.client.ServiceClient;
public class EssaiMbari1 {
public static OMElement createPayLoad() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs =
fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
OMElement method = fac.createOMElement("echo", omNs);
OMElement value = fac.createOMElement("value", omNs);
value.setText("Hello , my first service utilization");
method.addChild(value);
return method;
}
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://mbari1.neptune.uvic.ca:8080/axis2/services/StockQuoteService/getPrice?symbol=IBM"));
//Setting action ,and which can be found from the wsdl of the
service
opts.setAction("urn:getPrice");
client.setOptions(opts);
OMElement res = client.sendReceive(createPayLoad());
System.out.println(res);
}
}
-----------------------------------------------------------------------------------------
Can someone try it so I can see I'm not crazy ?
I'm working under eclipse and imported the .jar from the axis2_1.2/lib
folder (the one defined by my AXIS2_HOME so the one used to compile my
file!)
thx for your help
jerome.mariette wrote:
>
>
> 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#a13177039
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]