非常感激您进来关注我的问题:异常如下:
Server was unable to process request. ---> Root element is missing.下面是我的10行代码。
org.apache.axis.client.Service service = new org.apache.axis.client.Service();
org.apache.axis.client.Call call = (org.apache.axis.client.Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL("http://passport.cga.com.cn/AccountService/HFPTAccTokenAuth.asmx") );
call.setOperationName("TokenAuth");
call.addParameter("appid",org.apache.axis.Constants.XSD_INT,javax.xml.rpc.ParameterMode.IN);
call.addParameter("token",org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN);
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://www.cga.com.cn.auth.PTAccToken/TokenAuth");
Boolean isSucceed = (Boolean) call.invoke( new Object[] {123,"testtoken"} );请问,如何才能修改它到正常呢? 谢谢您!

解决方案 »

  1.   

    org.apache.axis.client.Service service = new org.apache.axis.client.Service(); 
    org.apache.axis.client.Call call = (org.apache.axis.client.Call) service.createCall(); 
    call.setTargetEndpointAddress( new java.net.URL("http://passport.cga.com.cn/AccountService/HFPTAccTokenAuth.asmx?WSDL") ); 
    call.setOperationName("TokenAuth"); 
    call.addParameter("appid",org.apache.axis.Constants.XSD_INT,javax.xml.rpc.ParameterMode.IN); 
    call.addParameter("token",org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN); 
    call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN); 
    call.setUseSOAPAction(true); 
    call.setSOAPActionURI("http://www.cga.com.cn.auth.PTAccToken/TokenAuth"); 
    Boolean isSucceed = (Boolean) call.invoke( new Object[] {123,"testtoken"} ); 
      

  2.   

    注意红色部分最后有"?WSDL",这个才是服务描述文件的地址,也是通过这个来生成客户端的。你的那个不是,你从浏览器里就可以看出2者的区别了。
      

  3.   

    谢谢这位大哥。
    可是我加了wsdl后也不正常。我的是用的axis1.4。
      

  4.   

    不好意思,我也不知道错误在何,有朋友直接用axis2把这个验证给做了。
    不需要答案了,谢谢各位大哥。