java 调用 net做的Web Services问题,请教高手!
java 调用 net做的Web Services问题:
net Web Services 的借口函数
public string Test(string str)
{
string resStr = "" ;
retrun resStr = "[diaoyong:]"+str;
}
java调用程序
<%@ page language="java" %>
<%@ page import="javax.xml.namespace.QName" %>
<%@ page import="org.apache.axis.encoding.XMLType" %>
<%@ page import="org.apache.axis.client.Service" %>
<%@ page import="org.apache.axis.client.Call" %>
<%@ page import="javax.xml.rpc.ParameterMode" %>
<%
String endpoint = "http://url/nbdctest/test.asmx?wsdl";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( "Test" );
call.addParameter( "str", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_STRING );
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://tempuri.org/Test");
String str= new String( "test" );
Object status = call.invoke( new Object[] {str} );
System.out.println( ">> begin JWTSSendLog" );
System.out.println( "status=" + status.toString() );
out.println( "status=" + status.toString() );
System.out.println( ">> end " );
%>
结果:[diaoyong:];
说明:java传递过去的参数值为空,
请问各位兄弟:为什么java传递到net服务接口中的参数值为空呢?是否字符格式的问题