本人利用axis调用一个webservice页面 http://210.43.64.106/Service.asmx
但是异常提示如下:方法 GetXsxx 和 Insert3 使用相同的 SOAPAction“http://www.zf_webservice.com/Insert3”。当 XML Web service 的 RoutingStyle 为 SoapAction 时,SOAPAction 值在 XML Web service 的所有方法中必须是唯一的。可以通过 SoapDocumentMethod 或 SoapRpcMethod 属性的 Action 参数更改 SOAPAction,也可以在 XML Web service 上指定 RequestElement 的 RoutingStyle。还望高手解答!!
但是异常提示如下:方法 GetXsxx 和 Insert3 使用相同的 SOAPAction“http://www.zf_webservice.com/Insert3”。当 XML Web service 的 RoutingStyle 为 SoapAction 时,SOAPAction 值在 XML Web service 的所有方法中必须是唯一的。可以通过 SoapDocumentMethod 或 SoapRpcMethod 属性的 Action 参数更改 SOAPAction,也可以在 XML Web service 上指定 RequestElement 的 RoutingStyle。还望高手解答!!
import java.text.DateFormat;import org.apache.axis.client.Call;import org.apache.axis.client.Service;import javax.xml.namespace.QName;import java.lang.Integer;import javax.xml.rpc.ParameterMode;public class Test{
public static void main(String[]args) {try {String endpoint = "http://210.43.64.106/Service.asmx?wsdl";Service service = new Service();Call call = (Call) service.createCall();call.setTargetEndpointAddress(endpoint);call.setOperationName("XSCheckPassword");call.addParameter("strxh", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);call.addParameter("strxm", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);call.setUseSOAPAction(true);call.setSOAPActionURI("http://www.my.com/Rpc");
String temp = "20084042034";String result = (String)call.invoke(new Object[]{temp,"2008198821"});System.out.println("result is "+result);
}catch (Exception e) {System.err.println(e.toString());}}}
希望能对楼主有所帮助
<HTML>
<HEAD>
<TITLE>webservie演示</TITLE>
</HEAD>
<BODY>
<%
Dim xh,pw
xh=request.form("xh")
pw=request.form("pw")
Dim soapclient
'使用具体的地址
Const WSDL_URL = "http://210.43.64.26/Service.asmx?wsdl"
set soapclient = CreateObject("MSSOAP.SoapClient30")
soapclient.ClientProperty("ServerHTTPRequest") = True
Call soapclient.mssoapinit(WSDL_URL,"","","")
Dim res,username,password
'使用具体的用户名和密码
username=xh
password=pw
res = soapclient.XSCheckPassword(username,password)%>
<% if res=0 THEN%>
<%session("xh")=xh%>
<%response.redirect "vote.asp" %>
<% else %>
<%session("xh")=""%>
<script>javascript:alert('填入不正确');window.history.back(-1);</script><%end if%>
</BODY>
</HTML>