TestClient是不是要用call.addParameter("str",XMLType.XSD_STRING, ParameterMode.IN)
设置服务调用方法的传入参数类型

解决方案 »

  1.   

    代码如下:import javax.xml.rpc.ParameterMode;
    import javax.xml.rpc.encoding.XMLType;import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;public class TestClient {
    public static void main(String[] args) throws Exception {
    String endpoint = "http://localhost:" + "7001"
    + "/web/services/Test";
    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(org.apache.axis.encoding.XMLType.XSD_STRING);    
    String arg ="test";
    String res = (String) call.invoke(new Object[] {arg});
    }
    }
      

  2.   

    axis的运行需要如下组件包
      axis.jar
      jaxrpc.jar
      saaj.jar
      commons-logging.jar
      commons-discovery.jar
      wsdl4j.jar
    看看你都有了没
      

  3.   

    空值错误啊
    debug跟踪看看哪里的值是null,然后在解决啊