3 Java金币
错误提示:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/ }Server
faultSubcode:
faultString: 服务器无法处理请求。 ---> A type specific Set(position, val) should be called because the Type can not be guessed from a null value.
源码:
package cn.yicha.service;
import java .net.URL;
import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class CallService {
public String CallService(String name) {
String endpoint = "http://111.122.10.223:85/PLMService/LogonService.asmx?wsdl"; /
String result="";
try{
Service service = new Service();
Call call = (Call)service.createCall();
call.setSOAPActionURI("http://tempuri.org/CreateVerification");
call.setOperationName(new QName(endpoint, "CreateVerification"));
call.addParameter(new QName("http://tempuri.org/","sUserCode"),
org.apache.axis.encoding.XMLType.XSD_STRING,
javax.xml.RPC .ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setTargetEndpointAddress(new URL(endpoint));
result= (String) call.invoke(new Object[]{name});
return result;
}catch (Exception e) {
e.printStackTrace();
}
return result;
}
}
jsp:
<%@ page language="java" import="java.util.*,cn.yicha.service.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>
<body>
<%
String name="dabao";
CallService cals= new CallService();
String m_valcode=cals.CallService(name);
response.sendRedirect("http://122.128.120.224:86/PLM/Common/WebServices.aspx?Operate=validlogin&UserCode="+name+"&ValidCode=" + m_valcode + "&GotoUrl=");
%>
</body>
</html>
我来回答