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 engage module : addressing at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:357) at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:342) 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 <[email protected]> wrote: > a REST client will invoke the client EPR directly... take a look at this > example: > > private static String toEpr = " > http://localhost:8080/axis2/services/MyService"; > public static void main(String[] args) throws AxisFault > { > Options options = new Options(); > > options.setTo(new EndpointReference(toEpr)); > > options.setTransportInProtocol(Constants.TRANSPORT_HTTP); > options.setProperty(Constants.Configuration.ENABLE_REST, > Constants.VALUE_TRUE); > > ServiceClient sender = new ServiceClient(); > sender.engageModule(Constants.MODULE_ADDRESSING); > sender.setOptions(options); > OMElement result = sender.sendReceive(getPayload()); > } > > is this what you're looking for? > Martin Gainty > ______________________________________________ > Jogi és Bizalmassági kinyilatkoztatás/Verzicht und > Vertraulichkeitanmerkung/Note de déni et de confidentialité > > Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy > jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése > nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi > alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen > megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet > 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 être privilégié. Si vous n'êtes pas le > destinataire prévu, nous te demandons avec bonté que pour satisfaire informez > l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci > est interdite. Ce message sert à l'information seulement et n'aura pas > n'importe quel effet légalement obligatoire. Étant donné que les email > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > aucune responsabilité pour le contenu fourni. > > > > > > > ------------------------------ > Date: Sat, 12 Mar 2011 18:43:38 -0800 > Subject: Call web services without making stub files. > From: [email protected] > To: [email protected] > > > 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 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
