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 Srikanth Muthyala <sr...@iitc.com.au> on 2007/10/15 01:52:29 UTC
Axis 2 client part of web app
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"?>
<!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: 1.3 Built on : Aug 10, 2007 (04:45:47 LKT) -->
<serviceGroup>
<service name="RtbCallEvent">
<messageReceivers>
<messageReceiver mep=" http://www.w3.org/ns/wsdl/in-out " class="com.customer.service.rtbcallevent.RtbCallEventMessageReceiverInOut"/>
</messageReceivers>
<parameter name="ServiceClass">com.customer.service.rtbcallevent.RtbCallEventSkeleton</parameter>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<operation name="callEvent" mep=" http://www.w3.org/ns/wsdl/in-out ">
<actionMapping>\"\"</actionMapping>
<outputActionMapping>urn:rtbCallEvent/wsdl:rtbCallEventSEI:callEventResponse</outputActionMapping>
</operation>
</service>
</serviceGroup>
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.
Regards,
Srikanth Muthyala
Re: Axis 2 client part of web app
Posted by keith chapman <ke...@gmail.com>.
Hi Srikanth,
When your using the webapp is looks like addressing is engaged. As a
workaround just set this option on the client
stub._serviceClient.getOptions().setAction("");
As a better solluion can you send me the interface operation section of your
?wsdl2. Or the whole wsdl. Looks like there is a mismatch in the addreassing
header in the client and the server.
Thanks,
Keith.
On 10/15/07, Srikanth Muthyala <sr...@iitc.com.au> wrote:
>
> Hi Keith,
>
> Thanks for your tip to use TCP Monitor.
> I ran the client using both main method and web app. The difference I
> noticed in request was the header (see below) - other remains the same.
>
> *<soapenv:Envelope xmlns:soapenv="**
> http://schemas.xmlsoap.org/soap/envelope/*<http://schemas.xmlsoap.org/soap/envelope/>
> *" xmlns:wsa="**http://www.w3.org/2005/08/addressing">*<http://www.w3.org/2005/08/addressing%22%3E>
> *<soapenv:Header>*
> * <wsa:To>http://localhost:8080/RTBCustomer/services/RtbCallEvent
> </wsa:To>*
> * <wsa:MessageID>urn:uuid:CEE8CBBEB2653D48CD1192428093191</wsa:MessageID>
> *
> * <wsa:Action>""</wsa:Action>*
> *</soapenv:Header>
> <soapenv:Body>........*
>
> Again looking at the fault
> Faultcode = {http://www.w3.org/2005/08/addressing }ActionNotSupported
> Reason = The server did not recognise the action which it received:
>
> ...makes it obvious the header is the culprit. How do I fix this?? FYI, I
> included req/response messages below.
>
> Regards,
>
> Srikanth Muthyala
>
> *Main Method request*
> POST /RTBCustomer/services/RtbCallEvent HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: ""
> User-Agent: Axis2
> Host: 127.0.0.1:8080
> Transfer-Encoding: chunked
>
> 1b1
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:callEvent<http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoapenv:Body%3E%3Cns1:callEvent>xmlns:ns1="urn:rtbCallEvent/types"><recordId>sdfsd</recordId><direction>sdf</direction><callingNumber>sdfds</callingNumber><calledNumber>param</calledNumber><answerTime>param</answerTime><releaseTime>sdf</releaseTime><group>successq</group></ns1:callEvent></soapenv:Body></soapenv:Envelope>
> 0
>
> *Main Method response*
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=UTF-8
> Transfer-Encoding: chunked
> Date: Mon, 15 Oct 2007 06:00:54 GMT
>
> 109
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:callEventResponse<http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoapenv:Body%3E%3Cns1:callEventResponse>xmlns:ns1="urn:rtbCallEvent/types"><result>true</result></ns1:callEventResponse></soapenv:Body></soapenv:Envelope>
> 0
>
> *Web app request*
> POST /RTBCustomer/services/RtbCallEvent HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: ""
> User-Agent: Axis2
> Host: 127.0.0.1:8080
> Transfer-Encoding: chunked
>
> 2ef
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="
> http://www.w3.org/2005/08/addressing"><soapenv:Header><wsa:To>http://localhost:8080/RTBCustomer/services/RtbCallEvent</wsa:To><wsa:MessageID>urn:uuid:CEE8CBBEB2653D48CD1192428093191</wsa:MessageID><wsa:Action>""</wsa:Action></soapenv:Header><soapenv:Body><ns1:callEventxmlns:ns1="urn:rtbCallEvent/types"><recordId>
> 30779377474759249921344.5360+100000
> </recordId><direction>Originating</direction><callingNumber>+61396261104</callingNumber><calledNumber>96261100</calledNumber><answerTime>20070925012009</answerTime><releaseTime>20070925012015</releaseTime><group>group1</group></ns1:callEvent></soapenv:Body></soapenv:Envelope>
> 0
>
>
> *Web app response*
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=UTF-8
> Transfer-Encoding: chunked
> Date: Mon, 15 Oct 2007 06:17:45 GMT
> Connection: close
>
> 285
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="
> http://www.w3.org/2005/08/addressing"><soapenv:Header><wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action><wsa:RelatesTo>urn:uuid:CEE8CBBEB2653D48CD1192428093191</wsa:RelatesTo><wsa:FaultDetail><wsa:ProblemAction><wsa:Action>""</wsa:Action></wsa:ProblemAction></wsa:FaultDetail></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>wsa:ActionNotSupported</faultcode><faultstring>The[action] cannot be processed at the receiver.</faultstring><detail
> /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
> 0
>
>
>
>
> **
> **
>
> ----- Original Message -----
> From: "keith chapman" <ke...@gmail.com>
> To: axis-user@ws.apache.org
> Sent: Monday, 15 October 2007 02:14:19 PM (GMT+1000) Australia/Sydney
> Subject: Re: Axis 2 client part of web app
>
> Hi Srikanth,
>
> Can you use TCP-Monitor (U can use the eclipse plugin) and capture the
> request and responses in the two cases and post it here. That'll help
> diagnose the problem.
>
> Thanks,
> Keith.
>
> On 10/15/07, Srikanth Muthyala <sr...@iitc.com.au> wrote:
> >
> > 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"?>
> > <!-- This file was auto-generated from WSDL -->
> > <!-- by the Apache *Axis2* version: 1.3 Built on : Aug 10, 2007
> > (04:45:47 LKT) -->
> > <serviceGroup>
> > <service name="RtbCallEvent">
> > <messageReceivers>
> > <messageReceiver mep=" http://www.w3.org/ns/wsdl/in-out"
> > class="
> > com.customer.service.rtbcallevent.RtbCallEventMessageReceiverInOut"/>
> > </messageReceivers>
> > <parameter name="ServiceClass">
> > com.customer.service.rtbcallevent.RtbCallEventSkeleton</parameter>
> > <parameter name="useOriginalwsdl">true</parameter>
> > <parameter name="modifyUserWSDLPortAddress">true</parameter>
> > <operation name="callEvent" mep="http://www.w3.org/ns/wsdl/in-out
> > ">
> > <actionMapping>\"\"</actionMapping>
> >
> > <outputActionMapping>urn:rtbCallEvent/wsdl:rtbCallEventSEI:callEventResponse</outputActionMapping>
> >
> > </operation>
> > </service>
> > </serviceGroup>
> >
> > *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.
> >
> > Regards,
> >
> > Srikanth Muthyala
> >
> >
> >
>
>
> --
> Keith Chapman
> WSO2 Inc.
> Oxygen for Web Services Developers.
> http://wso2.org/
>
--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/
Re: Axis 2 client part of web app
Posted by Srikanth Muthyala <sr...@iitc.com.au>.
Hi Keith,
Thanks for your tip to use TCP Monitor.
I ran the client using both main method and web app. The difference I noticed in request was the header (see below) - other remains the same.
<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ " xmlns:wsa=" http://www.w3.org/2005/08/addressing">
<soapenv:Header>
<wsa:To>http://localhost:8080/RTBCustomer/services/RtbCallEvent</wsa:To>
<wsa:MessageID>urn:uuid:CEE8CBBEB2653D48CD1192428093191</wsa:MessageID>
<wsa:Action>""</wsa:Action>
</soapenv:Header>
<soapenv:Body>........
Again looking at the fault
Faultcode = { http://www.w3.org/2005/08/addressing }ActionNotSupported
Reason = The server did not recognise the action which it received:
...makes it obvious the header is the culprit. How do I fix this?? FYI, I included req/response messages below.
Regards,
Srikanth Muthyala
Main Method request
POST /RTBCustomer/services/RtbCallEvent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
User-Agent: Axis2
Host: 127.0.0.1:8080
Transfer-Encoding: chunked
1b1
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:callEvent xmlns:ns1="urn:rtbCallEvent/types"><recordId>sdfsd</recordId><direction>sdf</direction><callingNumber>sdfds</callingNumber><calledNumber>param</calledNumber><answerTime>param</answerTime><releaseTime>sdf</releaseTime><group>successq</group></ns1:callEvent></soapenv:Body></soapenv:Envelope>
0
Main Method response
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Oct 2007 06:00:54 GMT
109
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:callEventResponse xmlns:ns1="urn:rtbCallEvent/types"><result>true</result></ns1:callEventResponse></soapenv:Body></soapenv:Envelope>
0
Web app request
POST /RTBCustomer/services/RtbCallEvent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
User-Agent: Axis2
Host: 127.0.0.1:8080
Transfer-Encoding: chunked
2ef
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ " xmlns:wsa=" http://www.w3.org/2005/08/addressing"><soapenv:Header><wsa:To>http://localhost:8080/RTBCustomer/services/RtbCallEvent</wsa:To><wsa:MessageID>urn:uuid:CEE8CBBEB2653D48CD1192428093191</wsa:MessageID><wsa:Action>""</wsa:Action></soapenv:Header><soapenv:Body><ns1:callEvent xmlns:ns1="urn:rtbCallEvent/types"><recordId>30779377474759249921344.5360+100000</recordId><direction>Originating</direction><callingNumber>+61396261104</callingNumber><calledNumber>96261100</calledNumber><answerTime>20070925012009</answerTime><releaseTime>20070925012015</releaseTime><group>group1</group></ns1:callEvent></soapenv:Body></soapenv:Envelope>
0
Web app response
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Oct 2007 06:17:45 GMT
Connection: close
285
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ " xmlns:wsa=" http://www.w3.org/2005/08/addressing"><soapenv:Header><wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action><wsa:RelatesTo>urn:uuid:CEE8CBBEB2653D48CD1192428093191</wsa:RelatesTo><wsa:FaultDetail><wsa:ProblemAction><wsa:Action>""</wsa:Action></wsa:ProblemAction></wsa:FaultDetail></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>wsa:ActionNotSupported</faultcode><faultstring>The [action] cannot be processed at the receiver.</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
0
----- Original Message -----
From: "keith chapman" <ke...@gmail.com>
To: axis-user@ws.apache.org
Sent: Monday, 15 October 2007 02:14:19 PM (GMT+1000) Australia/Sydney
Subject: Re: Axis 2 client part of web app
Hi Srikanth,
Can you use TCP-Monitor (U can use the eclipse plugin) and capture the request and responses in the two cases and post it here. That'll help diagnose the problem.
Thanks,
Keith.
On 10/15/07, Srikanth Muthyala < srikanth@iitc.com.au > wrote:
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"?>
<!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: 1.3 Built on : Aug 10, 2007 (04:45:47 LKT) -->
<serviceGroup>
<service name="RtbCallEvent">
<messageReceivers>
<messageReceiver mep=" http://www.w3.org/ns/wsdl/in-out " class="com.customer.service.rtbcallevent.RtbCallEventMessageReceiverInOut"/>
</messageReceivers>
<parameter name="ServiceClass"> com.customer.service.rtbcallevent.RtbCallEventSkeleton</parameter>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<operation name="callEvent" mep=" http://www.w3.org/ns/wsdl/in-out ">
<actionMapping>\"\"</actionMapping>
<outputActionMapping>urn:rtbCallEvent/wsdl:rtbCallEventSEI:callEventResponse</outputActionMapping>
</operation>
</service>
</serviceGroup>
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.
Regards,
Srikanth Muthyala
--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/
Re: Axis 2 client part of web app
Posted by keith chapman <ke...@gmail.com>.
Hi Srikanth,
Can you use TCP-Monitor (U can use the eclipse plugin) and capture the
request and responses in the two cases and post it here. That'll help
diagnose the problem.
Thanks,
Keith.
On 10/15/07, Srikanth Muthyala <sr...@iitc.com.au> wrote:
>
> 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"?>
> <!-- This file was auto-generated from WSDL -->
> <!-- by the Apache *Axis2* version: 1.3 Built on : Aug 10, 2007 (04:45:47
> LKT) -->
> <serviceGroup>
> <service name="RtbCallEvent">
> <messageReceivers>
> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
> class="com.customer.service.rtbcallevent.RtbCallEventMessageReceiverInOut"/>
>
> </messageReceivers>
> <parameter name="ServiceClass">
> com.customer.service.rtbcallevent.RtbCallEventSkeleton</parameter>
> <parameter name="useOriginalwsdl">true</parameter>
> <parameter name="modifyUserWSDLPortAddress">true</parameter>
> <operation name="callEvent" mep="http://www.w3.org/ns/wsdl/in-out">
>
> <actionMapping>\"\"</actionMapping>
>
> <outputActionMapping>urn:rtbCallEvent/wsdl:rtbCallEventSEI:callEventResponse</outputActionMapping>
>
> </operation>
> </service>
> </serviceGroup>
>
> *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.
>
> Regards,
>
> Srikanth Muthyala
>
>
>
--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/