java怎样调用.net写的webservice
2个回答
推荐于2016-06-19
展开全部
可以自己加批处理如下
set Axis_Lib=.\lib
set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
set Output_Path=.\source
set Package= com.msclient
%Java_Cmd% org.apache.axis.wsdl.WSDL2Java -o%Output_Path% -p%Package% http://localhost:8987/Service1.asmx?WSDL
生成客户端java类如下(CallService是我写的调用测试类,可忽略)public static void main(String[] args) throws ServiceException, RemoteException {
// TODO Auto-generated method stub
Service1 _Service1 = new Service1Locator();
Service1Soap_PortType _Service1Soap_PortType;
String resultStr = null;
_Service1Soap_PortType = _Service1.getService1Soap();
resultStr = _Service1Soap_PortType.helloWorld("zybaby");
System.out.println(resultStr);
}
set Axis_Lib=.\lib
set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
set Output_Path=.\source
set Package= com.msclient
%Java_Cmd% org.apache.axis.wsdl.WSDL2Java -o%Output_Path% -p%Package% http://localhost:8987/Service1.asmx?WSDL
生成客户端java类如下(CallService是我写的调用测试类,可忽略)public static void main(String[] args) throws ServiceException, RemoteException {
// TODO Auto-generated method stub
Service1 _Service1 = new Service1Locator();
Service1Soap_PortType _Service1Soap_PortType;
String resultStr = null;
_Service1Soap_PortType = _Service1.getService1Soap();
resultStr = _Service1Soap_PortType.helloWorld("zybaby");
System.out.println(resultStr);
}
2015-09-26
展开全部
最好是根据.net的结构,使用POST xml去调用
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询