call.invoke will invoke the service. But you really don't have to do this much work. You can take your WSDL, feed it to wsdl2java and emit a client proxy that fully manages the SOAP interaction for you. It will generate the individual interface and the GeoCode and GeoIndividualInputs beans for you. You populate the GeoIndividualInputs bean, then invoke the individual interface, and you get back a GeoCode bean.
Simple. Anne On 6/7/05, Kiran Kumar <[EMAIL PROTECTED]> wrote: > Thank You Ephemeris Lappis for your response. > > I am not using 'wrapped' style web service. If it was the case I would pass > the input parameters in the way you described in your example. > > My service end point method signature is something like > > public Geocode individual(Gcindividualinputs gcindividualinputs) throws > java.rmi.RemoteException ; > > Here the input is being received as an object (Gcindividualinputs is being > generated by WSDL2Java file) so I will have to send the input in 'xml' format > which maps to Gcindividualinputs value object at run time by Axis. > > The issue is, I was able to form SOAPEnvelope with the 'xml' format but I am > unable to find an API to invoke the service using the SOAPEnvelope that I > created. please scroll down , you will see my sample client that I was > trying to write. > > > Thanks > Kiran > ------------------------------------------------- > Ph: 312 742 9630 > Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ________________________________ > > From: Ephemeris Lappis [mailto:[EMAIL PROTECTED] > Sent: Tue 6/7/2005 12:37 PM > To: [email protected] > Subject: RE: how to call a document style web service? > > > Hello. > I suppose that if you have the wsdl for your web service, you can generate > the client stubs, and use them to call it. If you want, you can also build a > call by yourself using dynamic invocation, setting appropriate style, etc. > > Here are few lines from an old test program that builds a literal call to a > service operation named "evaluate" that takes a string as argument and also > returns a string. You must adapt the namespaces, names, parameters and > endoint URL according to your real service. I'm not sure this code work as is > with recent versions, but this is a base idea... You must also take care > about the classes you use. In my example, it seems that i were using axis > specific classes (Call, Service), but i think it should be better to only use > the jaxrpc API to ensure future compliance... > > I hope this can help you... > > > > -- > Ephemeris Lappis > > > String endpoint = > "http://alhambra:9999/j2ee14-three-services-ejb/First-Class-WS/FirstClassWS"; > > QName operationQName = new QName("http://ws.moon.net/three", "evaluate"); > QName resultQName = new QName("http://ws.moon.net/three", "evaluateReturn"); > > Service service = new Service(); > Call call = (Call) service.createCall(); > > call.setProperty(javax.xml.rpc.Call.SOAPACTION_USE_PROPERTY, new > Boolean(true)); > call.setProperty(javax.xml.rpc.Call.OPERATION_STYLE_PROPERTY, "literal"); > call.setProperty(javax.xml.rpc.Call.OPERATION_STYLE_PROPERTY, "document"); > > call.setTargetEndpointAddress(new java.net.URL(endpoint)); > call.setOperationName(operationQName); > call.addParameter("evaluate", operationQName, String.class, > ParameterMode.IN); > call.setReturnType(resultQName, String.class); > > Object[] input = { "Philippe" }; > > Object result = call.invoke(input); > > > -----Original Message----- > From: Kiran Kumar [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 07, 2005 6:39 PM > To: [email protected] > Subject: RE: how to call a document style web service? > > > Hello all.. I am really stuck.. please point me to some example on > how to call webservice using soap envelope.. I searched through google, but > could not find any example... > > Thank You, Kiran > > ________________________________ > > From: Kiran Kumar [mailto:[EMAIL PROTECTED] > Sent: Tue 6/7/2005 8:15 AM > To: [email protected] > Subject: how to call a document style web service? > > > Helo all, > > I am using axis 1.2 (java).. I built a document style > webservice, which has following method.. > > > public Geocode onfromto(OnfromtoInputs inputs); > > I started writing a client to call this web service > method.. but I could not find any API to call a web > service method with soap envelope.. can you please throw > some light on this ... ? > > Thanks for your time, GK. > > ==== I started writing a client something like this.. > > > // create envelope > SOAPEnvelope env = new SOAPEnvelope(); > > // create body > SOAPBody body = env.addBody(); > > // Create body > Name bodyName = > env.createName("onfromto","m","http://mydomain.domain/onfromto > <http://mydomain.domain/onfromto> "); > SOAPBodyElement bodyElement = > body.addBodyElement(bodyName); > > Name nameAddress = env.createName("address"); > SOAPElement eleAddress = > bodyElement.addChildElement(nameAddress); > eleAddress.addTextNode("2425 springdale"); > > Name nameGeoCodingTarget = env.createName("codingtarget"); > SOAPElement eleGeo = > bodyElement.addChildElement(nameGeoCodingTarget); > eleGeo.addTextNode("0"); > > Service service = new Service(); > Call call = (Call) service.createCall(); > call.setTargetEndpointAddress(strEndpoint); > > How to invoke with soap envelop.... ? > > ===== > > Thanks for your time > Kiran > <mailto:[EMAIL PROTECTED]> > ------------------------------------------------ > > This e-mail, and any attachments thereto, is confidential and is > intended only for the individual(s) named. If you are not the intended > recipient, please let us know by e-mail reply and delete it from your system; > do not copy/save this e-mail or disclose its contents to anyone. E-mail > transmissions cannot be guaranteed to be secure or error-free as the > transmission could be interrupted, corrupted, lost, destroyed, altered, > arrive late or contain viruses. ObjectWave does not accept liability for any > errors or omissions in the contents of this e-mail which arise as a result of > e-mail transmission. The views expressed in this e-mail do not necessarily > reflect those of ObjectWave or its affiliates. > > ------------------------------------------------ > > ------------------------------------------------ > > This e-mail, and any attachments thereto, is confidential and is > intended only for the individual(s) named. If you are not the intended > recipient, please let us know by e-mail reply and delete it from your system; > do not copy/save this e-mail or disclose its contents to anyone. E-mail > transmissions cannot be guaranteed to be secure or error-free as the > transmission could be interrupted, corrupted, lost, destroyed, altered, > arrive late or contain viruses. ObjectWave does not accept liability for any > errors or omissions in the contents of this e-mail which arise as a result of > e-mail transmission. The views expressed in this e-mail do not necessarily > reflect those of ObjectWave or its affiliates. > > ------------------------------------------------ > > >
