package com.iip.kma.test;import javax.xml.namespace.QName;import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
public class WebServiceTest {
private static EndpointReference targetEPR =
new EndpointReference(
"http://localhost:8989/axis2/services/SpringAwareService");
public static void main(String[] args1) throws AxisFault{
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
options.setTo(targetEPR);
QName opFindEntry = new QName("http://logic.kma.iip.com", "getAppNodeList");
Object[] opFindEntryArgs = new Object[] {"4", "1", "1"};
Class[] returnTypes = new Class[] { String.class };
Object[] response = serviceClient.invokeBlocking(opFindEntry,
opFindEntryArgs, returnTypes);
String result = (String) response[0];
System.out.println("begin.");
System.out.println(result);
System.out.println("ok");
}
}
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
public class WebServiceTest {
private static EndpointReference targetEPR =
new EndpointReference(
"http://localhost:8989/axis2/services/SpringAwareService");
public static void main(String[] args1) throws AxisFault{
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
options.setTo(targetEPR);
QName opFindEntry = new QName("http://logic.kma.iip.com", "getAppNodeList");
Object[] opFindEntryArgs = new Object[] {"4", "1", "1"};
Class[] returnTypes = new Class[] { String.class };
Object[] response = serviceClient.invokeBlocking(opFindEntry,
opFindEntryArgs, returnTypes);
String result = (String) response[0];
System.out.println("begin.");
System.out.println(result);
System.out.println("ok");
}
}
解决方案 »
- IE小问题
- FCKeditor2.6 怪啊..!!在线!!
- 关于web.xml配置的问题
- 采用spring框架,部署web程序时出现如下问题,望高手解答.
- 批量上传txt文件,并将文件中的内容导入db2数据库中
- 想写一本关于ECLIPSE使用的书籍,不知国内有没有市场?请教
- hibernate one to many 问题!
- salary?
- 如何使用jndi连接数据库啊?给一段代码
- 请问运行编译EJB,需要在什么环境下,如何配置,请给出详细的说明,谢谢!在线......
- Xfrie 开发webservice 的问题
- 求助,用struts2配置了多个struts.xml,可是提示There is no Action mapped for namespace / and action name test. - [unknown location]
Object[] opFindEntryArgs = new Object[] {"4", "1", "1"};
Class[] returnTypes = new Class[] { String.class };
Object[] response = serviceClient.invokeBlocking(opFindEntry,
opFindEntryArgs, returnTypes);
这个里面的"http://logic.kma.iip.com",地址是什么地址?
还有我要response三个参数怎么接收?
opFindEntryArgs 定义的就是接口的输入参数,不管有多少个,都以对象数组的形式传送,
{"4", "1", "1"}这里就是传递了三个字符串作为参数。至于接口的输出,肯定只能是只有一种类型。
这是我的wsdl请帮忙看看.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:SPInterfaceServer" xmlns:impl="urn:SPInterfaceServer" xmlns:intf="urn:SPInterfaceServer" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:SPInterfaceServer">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="AgentDRRequest">
<sequence>
<element name="comment" nillable="true" type="soapenc:string"/>
<element name="contentName" nillable="true" type="soapenc:string"/>
<element name="customerName" nillable="true" type="soapenc:string"/>
<element name="extendParam" nillable="true" type="soapenc:string"/>
<element name="icpCode" nillable="true" type="soapenc:string"/>
<element name="productInfo" nillable="true" type="soapenc:string"/>
<element name="spAccount" nillable="true" type="soapenc:string"/>
<element name="userIp" nillable="true" type="soapenc:string"/>
</sequence>
</complexType>
<complexType name="AgentDRResponse">
<sequence>
<element name="extendParam" nillable="true" type="soapenc:string"/>
<element name="message" nillable="true" type="soapenc:string"/>
<element name="returnCode" type="xsd:int"/>
</sequence>
</complexType>
</schema>
</wsdl:types> <wsdl:message name="collectAgentDRRequest"> <wsdl:part name="in0" type="impl:AgentDRRequest"/> </wsdl:message> <wsdl:message name="collectAgentDRResponse"> <wsdl:part name="collectAgentDRReturn" type="impl:AgentDRResponse"/> </wsdl:message> <wsdl:portType name="SPInterfaceServer"> <wsdl:operation name="collectAgentDR" parameterOrder="in0"> <wsdl:input name="collectAgentDRRequest" message="impl:collectAgentDRRequest"/> <wsdl:output name="collectAgentDRResponse" message="impl:collectAgentDRResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="SPInterfaceServerSoapBinding" type="impl:SPInterfaceServer"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="collectAgentDR"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="collectAgentDRRequest"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SPInterfaceServer"/> </wsdl:input> <wsdl:output name="collectAgentDRResponse"> <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:SPInterfaceServer"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="SPInterfaceServerService"> <wsdl:port name="SPInterfaceServer" binding="impl:SPInterfaceServerSoapBinding"> <wsdlsoap:address location=" http://localhost:8190/aaa/services/SPInterfaceServer"/> </wsdl:port> </wsdl:service></wsdl:definitions>