Return-Path: Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: (qmail 46213 invoked from network); 13 Mar 2011 11:53:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Mar 2011 11:53:32 -0000 Received: (qmail 90545 invoked by uid 500); 13 Mar 2011 11:53:31 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 90358 invoked by uid 500); 13 Mar 2011 11:53:30 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 90348 invoked by uid 99); 13 Mar 2011 11:53:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Mar 2011 11:53:30 +0000 X-ASF-Spam-Status: No, hits=4.3 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of afkham@gmail.com designates 209.85.161.45 as permitted sender) Received: from [209.85.161.45] (HELO mail-fx0-f45.google.com) (209.85.161.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Mar 2011 11:53:26 +0000 Received: by fxm2 with SMTP id 2so2291293fxm.32 for ; Sun, 13 Mar 2011 04:53:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=UNhVQ5apOdgVxmwbeqUH5krWazeg0IgEIuLEbHTYAPI=; b=tX4mqXHIbof4eZl0wthIFhnHjdBtheqQO9+8NiHgBJ9+xPnBBO2ftx4YcQLX4b+YPS 7YbPT/MAZf+U9bNfwlCrMRXjA1QnHUWcFQQZDe8NbU1qcVqc1Vj2Detl7CG0oX3JtoHH GCprlQ7Gn/7ZjL/XIj0qmCUsazRDb9CyyhbKc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=TQdB1NwDnkePqZAWYh24svk6yxDMmBdGjHpRkBfgG/pqtQUupRMjiTKR/DKst/+MhV jIAkXkVFm3iqKP0zI3w84d+AxTJmuEed0dZmh5+IgkAMQ7pk6Gwj6ICgJcGaGMIQCI8m 98iRGgFjUL6FlTlpQ2e1aeFQeyfE5eAfbb8lY= Received: by 10.223.6.73 with SMTP id 9mr88621fay.131.1300017184100; Sun, 13 Mar 2011 04:53:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.102.130 with HTTP; Sun, 13 Mar 2011 04:52:44 -0700 (PDT) In-Reply-To: References: <4D7C431D.8010208@gmail.com> From: Afkham Azeez Date: Sun, 13 Mar 2011 17:22:44 +0530 Message-ID: Subject: Re: Call web services without making stub files. To: java-dev@axis.apache.org, lasanthasridinesh@gmail.com Cc: Deepal jayasinghe Content-Type: multipart/alternative; boundary=00151747b38075d38a049e5bd6a3 --00151747b38075d38a049e5bd6a3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I think what your are looking for is dynamic proxy On Sun, Mar 13, 2011 at 10:03 AM, Lasantha Bandara < lasanthasridinesh@gmail.com> wrote: > ah........ it's great. thank you Deepal. > > For the moment I can proceed with REST clients. But we are making a clien= t > side layer for axis2, so that it can invoke any sophisticated web service= . > In REST architecture style, all resources are accessed with a generic > interface (e.g., HTTP GET, POST, PUT, DELETE), as I have read. This might > be problematic to some extend I think. > > Thank you guys. > > On Sat, Mar 12, 2011 at 8:07 PM, Deepal jayasinghe wro= te: > >> if you are using REST, you do not need addressing module. So remove >> engageModule statement. >> >> Deepal >> >> Hi Gainty; >> >> Thank you very much for your guidance. >> >> going through that I found a code sample from here. >> >> http://axis.apache.org/axis2/java/core/docs/rest-ws.html >> >> But still I have this exception. >> >> Exception in thread "main" org.apache.axis2.AxisFault: Unable to engag= e >> module : addressing >> at >> org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:35= 7) >> at >> org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:34= 2) >> at gsoc.Main.main(Main.java:37) >> >> >> *could you please tell me the purpose of this "engageModule" method?* >> >> Thank you. >> >> On Sat, Mar 12, 2011 at 5:58 PM, Martin Gainty wrot= e: >> >>> a REST client will invoke the client EPR directly... take a look at th= is >>> example: >>> >>> private static String toEpr =3D " >>> http://localhost:8080/axis2/services/MyService"; >>> public static void main(String[] args) throws AxisFault >>> { >>> Options options =3D new Options(); >>> >>> options.setTo(new EndpointReference(toEpr)); >>> >>> options.setTransportInProtocol(Constants.TRANSPORT_HTTP); >>> options.setProperty(Constants.Configuration.ENABLE_REST, >>> Constants.VALUE_TRUE); >>> >>> ServiceClient sender =3D new ServiceClient(); >>> sender.engageModule(Constants.MODULE_ADDRESSING); >>> sender.setOptions(options); >>> OMElement result =3D sender.sendReceive(getPayload()); >>> } >>> >>> is this what you're looking for? >>> Martin Gainty >>> ______________________________________________ >>> Jogi =E9s Bizalmass=E1gi kinyilatkoztat=E1s/Verzicht und >>> Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=E9 >>> >>> Ez az =FCzenet bizalmas. Ha nem =F6n az akinek sz=E1nva volt, akkor k= =E9rj=FCk, >>> hogy jelentse azt nek=FCnk vissza. Semmif=E9le tov=E1bb=EDt=E1sa vagy m= =E1solat=E1nak >>> k=E9sz=EDt=E9se nem megengedett. Ez az =FCzenet csak ismeret cser=E9t = szolg=E1l =E9s >>> semmif=E9le jogi alkalmazhat=F3s=E1ga sincs. Mivel az electronikus =FC= zenetek >>> k=F6nnyen megv=E1ltoztathat=F3ak, ez=E9rt minket semmi felel=F6s=E9g ne= m terhelhet ezen >>> =FCzenet tartalma miatt. >>> >>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene >>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefu= gte >>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachric= ht >>> dient lediglich dem Austausch von Informationen und entfaltet keine >>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von >>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. >>> >>> Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'= =EAtes pas le destinataire pr=E9vu, nous te demandons avec bont=E9 que pour= satisfaire informez l'exp=E9diteur. N'importe quelle diffusion non autoris= =E9e ou la copie de ceci est interdite. Ce message sert =E0 l'information s= eulement et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9ta= nt donn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipulati= on, nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni= . >>> >>> >>> >>> >>> >>> >>> ------------------------------ >>> Date: Sat, 12 Mar 2011 18:43:38 -0800 >>> Subject: Call web services without making stub files. >>> From: lasanthasridinesh@gmail.com >>> To: java-dev@axis.apache.org >>> >>> >>> Dear all; >>> >>> I'm using axis2 for one of my academic projects. We are making some >>> java libraries to improve client side operation. We saw that making stu= bs >>> and import them into the client side program always is somewhat tedious= . So >>> we are trying to add a feature so that web service can be invoked just = using >>> it's URL. >>> >>> In that case, heard that we can do it using wsdl2java file in axis2. >>> But I'm not familiar about the operations provided by that file. Can so= meone >>> help me to find a description about that file. >>> >>> Thank you. >>> -- >>> * >>> Lasantha Bandara, >>> Computer Science and Engineering, >>> University of Moratuwa, >>> Sri Lanka. >>> * >>> blog: http://lasanthasri.blogspot.com/ >>> gtalk: lasanthasridinesh >>> skype: lasanthasridinesh >>> >>> >> >> >> -- >> * >> Lasantha Bandara, >> Computer Science and Engineering, >> University of Moratuwa, >> Sri Lanka. >> * >> blog: http://lasanthasri.blogspot.com/ >> gtalk: lasanthasridinesh >> skype: lasanthasridinesh >> >> >> > > > -- > * > Lasantha Bandara, > Computer Science and Engineering, > University of Moratuwa, > Sri Lanka. > * > blog: http://lasanthasri.blogspot.com/ > gtalk: lasanthasridinesh > skype: lasanthasridinesh > > --=20 *Afkham Azeez* Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, * * *Member; Apache Software Foundation; **http://www.apache.org/* * email: **azeez@wso2.com* * cell: +94 77 3320919 blog: **http://blog.afkham.org* * twitter: **http://twitter.com/afkham_azeez* * linked-in: **http://lk.linkedin.com/in/afkhamazeez* * * *Lean . Enterprise . Middleware* * * --00151747b38075d38a049e5bd6a3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I think what your are looking for is dynamic proxy


On Sun, Mar 13, 2011 at 10:03 AM, Lasantha Bandara <lasanthasridi= nesh@gmail.com> wrote:
ah........ it's great. thank you Deepal= .

For the moment I can proceed with REST clients. But we= are making a client side layer for axis2, so that it can invoke any sophis= ticated web service. In REST architecture style,=A0a= ll resources are accessed with a generic interface (e.g., HTTP GET, POST, P= UT, DELETE), as I have read. This might be=A0problematic=A0to some extend I= think.

Th= ank you guys.

On Sat, Mar 12, 2011 at 8:07 PM, Deepal jayasinghe <deepalk= @gmail.com> wrote:
=20 =20 =20
if you are using REST, you do not need addressing module. So remove engageModule statement.

Deepal

Hi Gainty;

Thank you very much for your guidance.

going through that I found a code sample from here.


But still I have this exception.

Exception in thread "main" org.apache.axis2.AxisFa= ult: Unable to engage module : addressing
=A0=A0 =A0 =A0 =A0at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:357)<= /div>
=A0=A0 =A0 =A0 =A0at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:342)<= /div>
=A0=A0 =A0 =A0 =A0at gsoc.Main.main(Main.java:37)


could you please tell me the purpose of this "engageModule" method?

Thank you.

On Sat, Mar 12, 2011 at 5:58 PM, Martin Gainty <mgainty@hotmail.com> wrote:
a REST client will invoke the client EPR directly... take a look at this example:

=A0=A0=A0 private static String toEpr =3D "http://loca= lhost:8080/axis2/services/MyService";
=A0=A0=A0 public static void main(String[] args) throws AxisFault
=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0 Options options =3D new Options();
=A0=A0=A0
=A0=A0 =A0 =A0=A0 options.setTo(new EndpointReference(toEpr))= ;
=A0=A0
=A0 =A0 =A0=A0 options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
=A0=A0=A0=A0=A0=A0=A0 options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);

=A0=A0=A0=A0=A0=A0=A0 ServiceClient sender =3D new ServiceCli= ent();
=A0=A0=A0=A0=A0=A0=A0 sender.engageModule(Constants.MODULE_AD= DRESSING);
=A0=A0=A0=A0=A0=A0=A0 sender.setOptions(options);
=A0=A0=A0=A0=A0=A0=A0 OMElement result =3D sender.sendReceive(getPayload());
=A0 }

is this what you're looking for?
Martin Gainty
______________________________________________
Jogi =E9s Bizalmass=E1gi kinyilatkoztat=E1s/Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=E9
=A0
Ez az =FCzenet bizalmas. =A0Ha nem =F6n az akinek sz=E1nva volt, = akkor k=E9rj=FCk, hogy jelentse azt nek=FCnk vissza. Semmif=E9le tov=E1bb=EDt=E1sa= vagy m=E1solat=E1nak k=E9sz=EDt=E9se nem megengedett. =A0Ez az =FCzenet csak ism= eret cser=E9t szolg=E1l =E9s semmif=E9le jogi alkalmazhat=F3s=E1ga sincs. =A0Mivel az electronikus =FCzenetek k=F6nnyen megv=E1ltoztathat=F3ak, ez=E9rt minket semmi fele= l=F6s=E9g nem terhelhet ezen =FCzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut =EAtre privil=E9gi=
=E9. Si vous n'=EAtes pas le destinataire pr=E9vu, nous te demandons av=
ec bont=E9 que pour satisfaire informez l'exp=E9diteur. N'importe q=
uelle diffusion non autoris=E9e ou la copie de ceci est interdite. Ce messa=
ge sert =E0 l'information seulement et n'aura pas n'importe que=
l effet l=E9galement obligatoire. =C9tant donn=E9 que les email peuvent fac=
ilement =EAtre sujets =E0 la manipulation, nous ne pouvons accepter aucune =
responsabilit=E9 pour le contenu fourni.






Date: Sat, 12 Mar 2011 18:43:38 -0800
Subject: Call web services without making stub files.
From: lasanthasridinesh@gmail.com
To: java-dev@axis.apache.org


Dear all;

I'm using axis2 for one of my academic projects. We are making some java libraries to improve client side operation. We saw that making stubs and import them into the client side program always is somewhat tedious. So we are trying to add a feature so that web service can be invoked just using it's URL.

In that case, heard that we can do it using wsdl2java file in axis2. But I'm not familiar about the operations provided by that file. Can someone help me to find a=A0description=A0about that file.

Thank you.
--
Lasantha Bandara,
Computer Science and Engineering,
University of Moratuwa,
Sri Lanka.

gtalk: lasanthasridinesh
skype: lasanthasridinesh




--
Lasantha Bandara,
Computer Science and Engineering,
University of Moratuwa,
Sri Lanka.

gtalk: lasanthasridinesh
skype: lasanthasridinesh





--
Lasantha Bandara,
Compu= ter Science and Engineering,
University of M= oratuwa,
Sri Lanka.

blog:=A0http://lasanthasri.blogspot.com/
gtalk: lasanthasridinesh
skype: lasanthasridinesh




--
Afkham Azeez
= Senior= Software Architect & Senior Manager;=A0WSO2, Inc.;=A0http://wso2.com,=A0


--00151747b38075d38a049e5bd6a3--