Skip to main content

Axis2 Cient works as standalone but not as part of webapp

2 replies [Last post]
srikanthmm
Offline
Joined: 2007-04-15
Points: 0

Hello I am having a strange problem.

I have a client code generated using Axiscode generator in eclipse. If I make a call to the service when client is running as a standalone main method it works fine but when the same code is called while running in web app it gets fault
Faultcode = {http://www.w3.org/2005/08/addressing}ActionNotSupported
Reason = The server did not recognise the action which it received:

-I tried running cient and server on two different hosts and same host - no change.

This is my services.xml

<?xml version="1.0" encoding="UTF-8"?>

com.customer.service.rtbcallevent.RtbCallEventSkeleton
true
true

\"\"
urn:rtbCallEvent/wsdl:rtbCallEventSEI:callEventResponse

This is my java code
RtbCallEventStub stub = new RtbCallEventStub("http://10.96.201.30:8080/RTB/services/RtbCallEvent");
CallEvent7 callEvent = new CallEvent7();
CallEvent param = new CallEvent();

param.setAnswerTime("param");
param.setCalledNumber("param");
param.setCallingNumber("sdfds");
param.setDirection("sdf");
param.setGroup("successq");
param.setRecordId("sdfsd");
param.setReleaseTime("sdf");

callEvent.setCallEvent(param );
CallEventResponse6 resp = stub.callEvent(callEvent);
System.out.println(resp.getCallEventResponse().getResult());

} catch (AxisFault e) {
// TODO Auto-generated catch block
System.out.println(e.getFaultCode());
System.out.println(e.getMessage());
System.out.println(e.getReason());
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Any help will be appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
noletolucas
Offline
Joined: 2006-07-07
Points: 0

i figured out what was the problem.
we just need to set the action property:

RPCServiceClient serviceClient = new RPCServiceClient();
EndpointReference targetEPR = new EndpointReference("http://localhost:8080/Sample/services/AuthenticatorWS");
Options options = serviceClient.getOptions();
[b]options.setAction("login");[/b]
QName opGetWeather = new QName("http://localhost:8080/Sample/services/AuthenticatorWS", "login");

noletolucas
Offline
Joined: 2006-07-07
Points: 0

got exactly the same problem
any luck?

using Axis2 1.4.1

---
this is the code im trying to use inside my webapp and that works when standalone:
RPCServiceClient serviceClient = new RPCServiceClient();

Options options = serviceClient.getOptions();

EndpointReference targetEPR = new EndpointReference("http://127.0.0.1:8080/proj4/services/Service1");

options.setTo(targetEPR);

// Getting the weather
QName opGetWeather = new QName("http://service.pojo.sample", "operation1");

Object[] opGetWeatherArgs = new Object[] { };
Class[] returnTypes = new Class[] { String.class };

Object[] response = serviceClient.invokeBlocking(opGetWeather,
opGetWeatherArgs, returnTypes);

------
this is my services.xml:



Please Type your service description here




Service1

Message was edited by: noletolucas