ǰλãҳ > 使用axis自动生成webservice客户端代?- 百度文库
а빺أлл
AXISɿͻļʹÿwebserviceӼҵĸ˴룬 ߣ
Myeclipse7.0axis1.4tomcat5.5jdk1.5
һ axisjarҵaxis-bin-1_4.zipѹaxislibĿ¼һ
Ҫã
myeclip seдԼwebservicẹڵĿУ
CĿ¼´һļҵwsdltojava.bat£
set Axis_Lib=E:\\jar\\axis\\asixTool\\axis-bin-1_4\\axis-1_4\\lib set Java_Cmd=java - set Axis_Servlet=
%Java_Cmd% -u %Axis_Servlet%
עɫҵaxisĿ¼ҲǸղҽѹaxis ɫҵwebserviceķʵַIJô Ȼ˫ļ¼ļ 1Ŀ¼ǣC:\\localhost\\myAxis\\services\\HelloWorld 2
ġ ĸļĿͻˣͻ
м ¼룺
HelloWorld.java
package ;
public class HelloWorld { }
public String hello(){ }
return \+\;
ͻˣͨղɵĸļ HelloWorld.java /**
* HelloWorld.java *
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */
package ;
public interface HelloWorld extends { public hello() throws ; }
HelloWorldService.java /**
* HelloWorldService.java *
* This file was auto-generated from WSDL
1ҳ
а빺أлл
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */
package ;
public interface HelloWorldService extends { public getHelloWorldAddress(); public getHelloWorld() throws ;
public getHelloWorld( portAddress) throws ; }
HelloWorldServiceLocator.java /**
* HelloWorldServiceLocator.java *
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */
package ;
public class HelloWorldServiceLocator extends implements { public HelloWorldServiceLocator() { }
public HelloWorldServiceLocator( config) { super(config); }
public HelloWorldServiceLocator( wsdlLoc, sName) throws { super(wsdlLoc, sName); }
// Use to get a proxy class for HelloWorld private HelloWorld_address = \ public getHelloWorldAddress() { return HelloWorld_address; }
// The WSDD service name defaults to the port name. private HelloWorldWSDDServiceName = \ public getHelloWorldWSDDServiceName() { return HelloWorldWSDDServiceName; }
public void setHelloWorldWSDDServiceName( name) { HelloWorldWSDDServiceName = name; }
public getHelloWorld() throws { endpoint; try {
endpoint = new ; }
catch ( e) {
2ҳ
а빺أлл
throw new ; }
return getHelloWorld(endpoint); }
public getHelloWorld( portAddress) throws { try {
_stub = new , this);
_stub.setPortName(getHelloWorldWSDDServiceName()); return _stub; }
catch ( e) {
return null; } }
public void setHelloWorldEndpointAddress( address) { HelloWorld_address = address; } /**
* For the given interface, get the stub implementation. * If this service has no port for the given interface, * then ServiceException is thrown. */
public getPort(Class serviceEndpointInterface) throws { try { if ( {
_stub = new , this);
_stub.setPortName(getHelloWorldWSDDServiceName()); return _stub; } }
catch ( t) {
throw new ; }
throw new \is no stub implementation for the interface: (serviceEndpointInterface == null ? \ } /**
* For the given interface, get the stub implementation. * If this service has no port for the given interface, * then ServiceException is thrown. */
public getPort( portName, Class serviceEndpointInterface) throws { if (portName == null) {
return getPort(serviceEndpointInterface);
3ҳ
\+
92ƪĵ