I thought I might as well add the code that I have for trying to get this to
work as I might get some better help that way:
If I don’t use the interface in the services.xml but instead use the
implementation I no longer get the error related to a return type of Future<?>
Services.xml:
<serviceGroup>
<service name="CreditScoreService">
<description>Test Async Service</description>
<parameter name="ServiceClass" locked="false">
webservices2.CreditScoreServiceImpl</parameter>
<operation name="getCreditScore">
<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
</service>
</serviceGroup>
public interface CreditScoreService {
//Async with passed in callback function
public Future<?> getCreditScoreAsync(String inParam,
AsyncHandler<String> handler);
//Async using polling
public Response<String> getCreditScoreAsync(String inParam);
//Standard method
public String getCreditScore(String inParam);
}
public class CreditScoreServiceImpl implements CreditScoreService {
public Response<String> getCreditScoreAsync(String requestType) {
System.out.println("calling async method");
return null;
}
public Future<String> getCreditScoreAsync(String requestType,
AsyncHandler<String> handler) {
System.out.println("calling async method");
return null;
}
public String getCreditScore(String inputParam) {
return "200";
}
public class CreditScoreResponse {
private String responseType;
/**
* @return the responseType
*/
public String getResponseType() {
return responseType;
}
/**
* @param responseType the responseType to set
*/
public void setResponseType(String responseType) {
this.responseType = responseType;
}
}
}
Can anyone can tell me where I am going wrong, please!
Thanks,
Paul
From: Ockleford Paul (NHS CONNECTING FOR HEALTH) [mailto:[email protected]]
Sent: 05 December 2012 15:10
To: [email protected]
Subject: Async services
---
This message was sent from an email address external to NHSmail but gives the
appearance of being from an NHSmail (@nhs.net) address. The recipient should
verify the sender and content before acting upon information contained within.
The identified sender is
[email protected]
---
Hi,
I am trying to create a service which exposes asynchronous methods in the same
way as this document describes:
http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html#Async
I am having quite a lot of trouble getting either of the examples to work.,
even trying to expose a method with a return type of Future<?> seems to result
in an error when axis starts up.
My first question is where can I download the source code related to the
snippets, it would be nice to be able to see the implementation of the methods
described in the interface.
Second question is whether anybody has a link to a good document that details
this process. I have tried to follow quite a few tutorials today and have still
not ended up with a working demo.
Finally does the method described on the axis website work for stub code
generated from a wsdl? I don’t seem to be able to get a handle on my
CreditScoreService object like the example client shows so I have no idea how
to actually get a Request object back.
Any help would be good as I am currently stuck on this.
Thanks,
Paul
********************************************************************************************************************
This message may contain confidential information. If you are not the intended
recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take
any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.
Thank you for your co-operation.
NHSmail is the secure email and directory service available for all NHS staff
in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information
with NHSmail and GSi recipients
NHSmail provides an email address for your career in the NHS and can be
accessed anywhere
********************************************************************************************************************
********************************************************************************************************************
This message may contain confidential information. If you are not the intended
recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take
any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.
Thank you for your co-operation.
NHSmail is the secure email and directory service available for all NHS staff
in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information
with NHSmail and GSi recipients
NHSmail provides an email address for your career in the NHS and can be
accessed anywhere
********************************************************************************************************************