Return-Path: X-Original-To: apmail-axis-java-user-archive@www.apache.org Delivered-To: apmail-axis-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64ED2EDB4 for ; Mon, 17 Dec 2012 15:29:18 +0000 (UTC) Received: (qmail 90542 invoked by uid 500); 17 Dec 2012 15:29:16 -0000 Delivered-To: apmail-axis-java-user-archive@axis.apache.org Received: (qmail 90120 invoked by uid 500); 17 Dec 2012 15:29:15 -0000 Mailing-List: contact java-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@axis.apache.org Delivered-To: mailing list java-user@axis.apache.org Received: (qmail 90062 invoked by uid 500); 17 Dec 2012 15:29:15 -0000 Delivered-To: apmail-ws-axis-user@ws.apache.org Received: (qmail 88503 invoked by uid 99); 17 Dec 2012 15:28:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Dec 2012 15:28:34 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [62.208.144.128] (HELO relay.nhs.uk) (62.208.144.128) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Dec 2012 15:28:27 +0000 Received: from nhs-pd1e-esg106.ad1.nhs.net (nhs-pd1e-esg106.ad1.nhs.net [127.0.0.1]) by IMSVA80 (Postfix) with ESMTP id 67BD344896C for ; Mon, 17 Dec 2012 15:28:05 +0000 (GMT) Received: from smtp.nhs.net (unknown [192.168.9.67]) by nhs-pd1e-esg106.ad1.nhs.net (Postfix) with ESMTP id A0CDA45800B for ; Mon, 17 Dec 2012 15:28:04 +0000 (GMT) Received: from NHS-PD1I-HTS011.AD1.NHS.NET (192.168.17.11) by NHS-PD1e-ETS003.ad1.nhs.net (192.168.8.67) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 17 Dec 2012 15:28:02 +0000 Received: from NHS-PCLI-MBC015.AD1.NHS.NET ([192.168.16.29]) by NHS-PD1I-HTS011.AD1.NHS.NET ([192.168.17.11]) with mapi; Mon, 17 Dec 2012 15:28:02 +0000 From: "Ockleford Paul (NHS CONNECTING FOR HEALTH)" To: "axis-user@ws.apache.org" Date: Mon, 17 Dec 2012 15:28:03 +0000 Subject: More questions on async service Thread-Topic: More questions on async service Thread-Index: Ac3caxrgSlHT0FCQQWi+gp9hZhp0Hg== OLD-MSG-ID: <494C599007DDA542A4811051B82E39DA60FA43A8D2@NHS-PCLI-MBC015.AD1.NHS.NET> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB Content-Type: multipart/alternative; boundary="_000_494C599007DDA542A4811051B82E39DA60FA43A8D2NHSPCLIMBC015_" MIME-Version: 1.0 Message-Id: <20121217152804.A0CDA45800B@nhs-pd1e-esg106.ad1.nhs.net> X-TM-AS-Product-Ver: IMSVA-8.0.0.1467-6.8.0.1017-19456.007 X-TM-AS-Result: No--38.640-60-31-10 X-imss-scan-details: No--38.640-60-31-10;No--38.640-3-31-10;No--38.640-5-31-10 X-TMASE-MatchedRID: 3tfEZSmUs4C36bWU2xVUipHXKSSl+ScKLAnNohUyMa0nFcnAoAp5ryob 8R4KvXYM38oEy4wG4Oztag89aFqL3MKTW98jPwwNneIQmu8UmaGTgV2heE0WDZgZDtjwsuhLidM oKS5QldDmC/8bffcLuFNigAiuAZ60drkSn8I/xo65kfgtJfb41RHlzzcojFNOaxKBbTWINAuNjz etu1+ZzWXqc2R50DiazZpvrLjwrYu+moGtOG/rU6OuVibdZNTvm/y00tE9Sta5vQ50gIH+ijydO VERLYzlfhrWmQI4nQ9v1XptriGt2BfUAIYzulpwt1AhvyEKdj7ljSRvSGpq3Ddnd59Af7CPHGmA LPPxete7yChwmphahp2DdYyTLheOBWd9rvGh7Kw4lNZ1y5cL/iH8kDR0dp2mwC2dc82MUgK9Kut m8ZtuZMrPSVVpkMtbnFVXhIhBdtoOwLYqF/p9l5mug812qIbzEg29CAbgfD33bBqxmjinTVMgFa PCixwUyFR1jLq/vXi/5RDtQSaOp+uYiGPpNwNP71Wx2uUbPLdDr8MVm6DK3TA4N9SXuYkpjNLxr cxKViWMkVsdMJZ1Bn+lsrTmsmXb1lfDCm9+EZVYKMMlFh4BnYfsPVs/8Vw6EfKzCAntKpDzMbPr nKd2TP/55Kkc+9/6c91xMYNqHkVwFML1KUSMqnpruoeiWYa5mRKFhwukYf0Ev5X2UPfz0Uv+Gv9 gyZL/ZipMsTQzH+LCyfEFi/VtE9EL/FmgGm28BxsweNg3EaGFkCkkB0UMNq9dKZJ2VxiaLnuFYf aWSqYzDLM3gGacyYoiK4zcka0xjDKOBQNjPn7nvYyC+9BYURLIUNMiW9PecYQR6nNa0UieVEP6u vJOog== X-Virus-Checked: Checked by ClamAV on apache.org --_000_494C599007DDA542A4811051B82E39DA60FA43A8D2NHSPCLIMBC015_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am still pretty confused by the whole async services with axis 2. I bough= t deepaks book purely for this but it really doesn't go into any detail and= looks to be pretty much the same as the axis documentation. I have created= a very basic service which echoes a string, it's just a single method in a= pojo and I have deployed this service successfully. I have used wsdl2java to create me some client side code and I have include= d the option to create the async bits as well. Now trying to follow the doc= umentation I cannot go any further because I don't get any of the methods t= he documentation describes, why is this? What I get is a call back interfac= e and I have implemented the call back successfully but how exactly am I su= pposed to implement a polling client? On my stub client I only have 2 metho= ds available to me: SayHelloResponse sayHello(SayHello sayHello12 ) - this looks like the stand= ard rpc call and the response object does not have an isDone() method to po= ll; Void startSayHello(SayHello sayHello12 ) - this is the callback method whic= h I managed to get working (see code below but don't see how to implement t= he polling mechanism or how to set the mep async property for). My second problem is that I would like to make the service truly asynchrono= us by setting property "org.apache.axis2.jaxws.use.async.mep" to true but I= don't see how it's possible to do this using the objects provided by wsdl2= java. I have included my code below in the hope that I get some feedback but I am= beginning to think that I need look for a web services engine which is a l= ittle more user friendly than axis2 because I don't seem to be getting anyw= here with it. Simple web service: public class HelloWorld { public String sayHello(String name){ return "Hello " + name; } } Simple client (How do I set the async mep property and how do I implement a= polling client using the generated classes): public class HelloWorldClient { public static void main(String[] args) { try { String s =3D new String("Obj"); HelloWorldStub stub =3D new HelloWorldStub(); HelloWorldCallbackHandlerImpl cb =3D new HelloWorldCallbackHand= lerImpl(s); SayHello sayHello =3D new SayHello(); sayHello.setName("Paul Ockleford"); //************** HOW DO I IMPLEMENT THIS GIVEN THE CLASSES GENER= ATED BY WSDL2JAVA ********** Map rc =3D ((BindingProvider) ????).getRequestC= ontext(); rc.put("org.apache.axis2.jaxws.use.async.mep", Boolean.TRUE); stub.startsayHello(sayHello, cb); synchronized (cb) { while (!cb.m_done) { try { cb.wait(100); } catch (Exception e) {} } } if (cb.m_response !=3D null) { String reply =3D cb.m_response.get_return(); System.out.println("received reply: " + reply); } } catch (Exception e) { e.printStackTrace(); } } } Can anybody help me out with some small code snippets to show how to set th= e mep async propery with my code above and also how I would go about implem= enting the polling mechanism for the code above? Thanks, Paul ***************************************************************************= ***************************************** This message may contain confidential information. If you are not the inten= ded 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 ta= ke 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 sta= ff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive informa= tion with NHSmail and GSi recipients NHSmail provides an email address for your career in the NHS and can be acc= essed anywhere ***************************************************************************= ***************************************** --_000_494C599007DDA542A4811051B82E39DA60FA43A8D2NHSPCLIMBC015_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I am still pretty confused by the whole async servic= es with axis 2. I bought deepaks book purely for this but it really doesn&#= 8217;t go into any detail and looks to be pretty much the same as the axis = documentation. I have created a very basic service which echoes a string, it’s just a single method in a pojo a= nd I have deployed this service successfully.

 

I have used wsdl2java to create me some client side = code and I have included the option to create the async bits as well. Now t= rying to follow the documentation I cannot go any further because I donR= 17;t get any of the methods the documentation describes, why is this? What I get is a call back interface and I have imp= lemented the call back successfully but how exactly am I supposed to implem= ent a polling client? On my stub client I only have 2 methods available to = me:

 

SayHelloResponse sayHello(SayHello sayHello12 ) R= 11; this looks like the standard rpc call and the response object does not = have an isDone() method to poll;

 

Void startSayHello(SayHello sayHello12 ) – thi= s is the callback method which I managed to get working (see code below but= don’t see how to implement the polling mechanism or how to set the m= ep async property for).

 

My second problem is that I would like to make the servic=
e truly asynchronous by setting property “org.apache.axis2.jaxws.use.=
async.mep” to true but I don’t see how it’s possible to d=
o this using the objects provided by wsdl2java. 
 
I have included my code below in the hope that I get some=
 feedback but I am beginning to think that I need look for a web services e=
ngine which is a little more user friendly than axis2 because I don’t=
 seem to be getting anywhere with it.
 
Simple web service:
 
public class HelloWorld {
       public String sayHel=
lo(String name){
        return "H=
ello " + name;
    }
}

 

Simple client (How do I set the async mep property a= nd how do I implement a polling client using the generated classes):

 

public class HelloWorldClient {

 

    public static void main(String[] = args) {

        try {

        &nbs= p;   String s =3D new String("Obj");

        &nbs= p;   HelloWorldStub stub =3D new HelloWorldStub();

        &nbs= p;   HelloWorldCallbackHandlerImpl cb =3D new HelloWorldCallbackH= andlerImpl(s);

        &nbs= p;   SayHello sayHello =3D new SayHello();

        &nbs= p;   sayHello.setName("Paul Ockleford");

        &nbs= p;      

        &nbs= p;  //************** HOW DO I IMPLEMENT THIS GIVEN THE CLASSES GENERAT= ED BY WSDL2JAVA **********

        &nbs= p;   Map<String, Object> rc =3D ((BindingProvider) ????).ge= tRequestContext();

        &nbs= p;   rc.put("org.apache.axis2.jaxws.use.async.mep", Boo= lean.TRUE);

 

        &nbs= p;   stub.startsayHello(sayHello, cb);

 

        &nbs= p;    synchronized (cb) {

        &nbs= p;       while (!cb.m_done) {

        &nbs= p;           try {

        &nbs= p;            &= nbsp;  cb.wait(100);

        &nbs= p;           } catch (Exc= eption e) {}

        &nbs= p;       }

        &nbs= p;   }

 

        &nbs= p;   if (cb.m_response !=3D null) {

        &nbs= p;        String reply =3D cb.m_response= .get_return();

        &nbs= p;        System.out.println("recei= ved reply: " + reply);

        &nbs= p;   }

        } catch (= Exception e) {

        &nbs= p;   e.printStackTrace();

        }

    }

}

 

Can anybody help me out with some small code snippet= s to show how to set the mep async propery with my code above and also how = I would go about implementing the polling mechanism for the code above?

 

Thanks,

 

Paul


*********************= ***************************************************************************= ********************

This message may contain confidential information. If you are not the inten= ded 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 ta= ke 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 sta= ff in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive informa= tion with NHSmail and GSi recipients
NHSmail provides an email address for your career in the NHS and can be acc= essed anywhere

***************************************************************************= *****************************************
--_000_494C599007DDA542A4811051B82E39DA60FA43A8D2NHSPCLIMBC015_--