用Axis开发Web Service的三种部署方式测试
来源:互联网 发布:wampserver php.ini 编辑:程序博客网 时间:2024/05/17 18:03
package com.norteksoft.casc;
import gongya.SoapSever.Hello_jws.HelloService;
import gongya.SoapSever.Hello_jws.HelloServiceLocator;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.client.ServiceFactory;
public class Bussines
{
public static String DII(String name)
{
String endPoint="http://gongya/SoapSever/Hello.jws";
String rv="";
Service service=new Service();
Call call=null;
try
{
call=(Call) service.createCall();
call.setOperationName(new QName(endPoint,"test"));
call.setTargetEndpointAddress(new URL(endPoint));
rv=(String) call.invoke(new Object[] {name});
}
catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (ServiceException e) {
e.printStackTrace();
}
catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return rv;
}
public static String dproxy(String name)
{
String wsdlURl="http://gongya/SoapSever/Hello.jws?wsdl";
String naspaceURL="http://gongya/SoapSever/Hello.jws";
String portName="Hello";
String serviceName="HelloService";
try
{
QName pName=new QName(naspaceURL, portName);
QName sName=new QName(naspaceURL, serviceName);
javax.xml.rpc.ServiceFactory serviceFactory = (ServiceFactory) ServiceFactory.newInstance();
javax.xml.rpc.Service service=serviceFactory.createService(new URL(wsdlURl),sName);
SoapClientInterface proxy=(SoapClientInterface) service.getPort(pName,SoapClientInterface.class);
return proxy.test(name);
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
public static String stubs(String name)
{
HelloServiceLocator helloLocal=new HelloServiceLocator();
try
{
return helloLocal.getHello().test(name);
}
catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
// Hello hello;
public static void main (String[] args)
{
HelloService hello=new HelloServiceLocator();
char[] temp=new char[100];
int i=0;
while(true)
{
try {
int c=System.in.read();
if(c!='/n'&&c!=' ')
{
temp[i++]=(char) c;
}
else
{
String name=new String(new String(temp,0,i-1).getBytes("ISO8859_1"),"GBK");
if("exit".equalsIgnoreCase(name))
{
System.out.println("bye");
System.exit(0);
}
System.out.print(Bussines.stubs(name));
// System.out.println("/n");
//System.out.println("/n");
i=0;
}
}
catch (IOException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
- 用Axis开发Web Service的三种部署方式测试
- Axis部署和开发web service支持的三种方式
- axis支持三种web service的部署和开发
- Axis开发Web Service实例(三种方式)
- Axis开发Web Service实例(三种方式)
- Axis开发Web Service实例 三种方式
- Axis开发Web Service实例(三种方式)
- Axis的三种Web Service的部署和开发实例【转】
- Axis的Stubs方式开发web Service
- 用Axis开发Web Service
- 用Axis开发Web Service
- Axis部署开发webservice (三种方式全)
- Axis 开发web service
- Axis开发Web Service的实例
- 基于Axis的WebService测试,开发,部署
- AXIS的Web Service
- axis的部署方式
- Axis Web Service开发之旅 (三) --将Spring的装配JavaBean发布成WebService
- grub三步通
- 2.6内核中网络模块调用入口
- 一个有关扑克牌牌型分析的问题 选择自 sodme 的 Blog
- 特殊用途的IP地址介绍
- 小技巧积累
- 用Axis开发Web Service的三种部署方式测试
- 僵尸进程
- 一个用JAVA开发的会话密钥程序
- 四种解析xml方式
- checkbox
- 春天微笑
- 今天发飙了
- 升級asp.net2.04/26
- 我们永远的怀念你——我的父亲