A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Web Services
Author
Web Services with Axis2
Binu Smera
Greenhorn
Joined: Aug 13, 2002
Posts: 6
posted
Sep 17, 2008 06:16:00
0
Please give me a sample Client with Axis2
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12265
1
posted
Sep 17, 2008 07:25:00
0
If you downloaded the usual AXIS package it should be loaded with examples of both server and client code.
Dan Drillich
Ranch Hand
Joined: Jul 09, 2001
Posts: 1121
posted
Sep 17, 2008 08:17:00
0
Binu,
As William said, it's all there.
For example, \axis2-1.4\samples\jaxws-samples\src\main\org\apache\axis2\jaxws\samples\client\echo\EchoService.java is -
package org.apache.axis2.jaxws.samples.client.echo; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import java.net.MalformedURLException; import java.net.URL; @WebServiceClient(name = "EchoService", targetNamespace = "http://org/apache/axis2/jaxws/samples/echo/", wsdlLocation = "WEB-INF/wsdl/Echo.wsdl") public class EchoService extends Service { private final static URL ECHOSERVICE_WSDL_LOCATION; static { URL url = null; try { url = new URL("file:/WEB-INF/wsdl/Echo.wsdl"); } catch (MalformedURLException e) { e.printStackTrace(); } ECHOSERVICE_WSDL_LOCATION = url; } public EchoService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public EchoService() { super(ECHOSERVICE_WSDL_LOCATION, new QName ("http://org/apache/axis2/jaxws/samples/echo/", "EchoService")); } /** * @return returns EchoServicePortType */ @WebEndpoint(name = "EchoServicePort") public EchoServicePortTypeClient getEchoServicePort() { return (EchoServicePortTypeClient) super.getPort(new QName("http://org/apache/axis2/jaxws/samples/echo/", "EchoServicePort"), EchoServicePortTypeClient.class); } }
Regards,
Dan
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
john mayer
Greenhorn
Joined: Sep 16, 2008
Posts: 4
posted
Sep 20, 2008 03:20:00
0
Good thanks for help us..
<a href="http://www.mag-corp.com" target="_blank" rel="nofollow">http://www.mag-corp.com</a> | <a href="http://www.octopusmtr.co.uk" target="_blank" rel="nofollow">http://www.octopusmtr.co.uk</a>
I agree. Here's the link:
http://aspose.com/file-tools
subject: Web Services with Axis2
Similar Threads
Web Services
SOAP HEader
Is it possible to return an array of objects from a web service?
server downloads
Web service with Eclipse + AXIS2
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter