SoapFault-故障代码:';SOAP-ENV:android中的例外

SoapFault-故障代码:';SOAP-ENV:android中的例外,android,web-services,soap,localhost,ksoap2,Android,Web Services,Soap,Localhost,Ksoap2,我知道在SO中已经存在相同类型的问题,但我没有找到解决方案。我知道了 SoapFault - faultcode: 'SOAP-ENV:Server' faultstring: 'Procedure 'login' not present' faultactor: 'null' detail: null 尝试从本地服务器获取响应时出现异常 我的wsdl代码应该如下所示: <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/ht

我知道在SO中已经存在相同类型的问题,但我没有找到解决方案。我知道了

SoapFault - faultcode: 'SOAP-ENV:Server' faultstring: 'Procedure 'login' not present' faultactor: 'null' detail: null
尝试从本地服务器获取响应时出现异常

我的wsdl代码应该如下所示:

<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"   
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xs0="http://www.processmaker.com"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"   
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
targetNamespace="http://www.processmaker.com">
<types>
<xs:schema elementFormDefault="qualified"     
targetNamespace="http://www.processmaker.com">
<xs:element name="login">
<xs:complexType>
<xs:sequence>
<xs:element name="userid" type="xs:string"/>
<xs:element name="password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</definitions>

我的类文件是:

public class MainActivity extends Activity {
String str = null;

SoapObject request;
TextView tv;

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    tv = (TextView) findViewById(R.id.textView1);
    myasynctask MAT = new myasynctask();
    MAT.execute();
}


    class myasynctask extends AsyncTask<String, Void, String> {

String str;
private static final String SOAP_ACTION = "http://www.processmaker.com/login";
private static final String METHOD_NAME = "login";
private static final String NAMESPACE = "http://www.processmaker.com/";
private static final String URL = "http://10.0.2.2:80/sysworkflow/en/classic/services/soap2";

@Override
protected String doInBackground(String... params) {
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    request.addProperty("userid", "admin");
    request.addProperty("password", "admin");

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);

    HttpTransportSE ht = new HttpTransportSE(URL);

    try {
        ht.call(SOAP_ACTION, envelope);
        final SoapPrimitive response = (SoapPrimitive) envelope
                .getResponse();
        str = response.toString();

    } catch (Exception e) {
        e.printStackTrace();

    }
    //Log.d("WebRespone", str);
    return str;
}


@Override
public void onPostExecute(String result) {
// TODO Auto-generated method stub
Toast.makeText(MainActivity.this, result, Toast.LENGTH_LONG).show();
tv.setText(result);
super.onPostExecute(result);
}

@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
}

}
公共类MainActivity扩展活动{
字符串str=null;
SoapObject请求;
文本视图电视;
@SuppressLint(“新API”)
@凌驾
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv=(TextView)findViewById(R.id.textView1);
myasynctask MAT=新建myasynctask();
MAT.execute();
}
类myasynctask扩展了AsyncTask{
字符串str;
私有静态最终字符串SOAP_ACTION=”http://www.processmaker.com/login";
私有静态最终字符串方法\u NAME=“login”;
私有静态最终字符串命名空间=”http://www.processmaker.com/";
私有静态最终字符串URL=”http://10.0.2.2:80/sysworkflow/en/classic/services/soap2";
@凌驾
受保护的字符串doInBackground(字符串…参数){
SoapObject请求=新的SoapObject(名称空间、方法名称);
addProperty(“userid”、“admin”);
addProperty(“密码”、“管理员”);
SoapSerializationEnvelope=新的SoapSerializationEnvelope(
第11版);
envelope.dotNet=true;
envelope.setOutputSoapObject(请求);
HttpTransportSE ht=新的HttpTransportSE(URL);
试一试{
ht.呼叫(SOAP_动作、信封);
最终SoapPrimitive响应=(SoapPrimitive)信封
.getResponse();
str=response.toString();
}捕获(例外e){
e、 printStackTrace();
}
//Log.d(“WebRespone”,str);
返回str;
}
@凌驾
public void onPostExecute(字符串结果){
//TODO自动生成的方法存根
Toast.makeText(MainActivity.this,result,Toast.LENGTH_LONG.show();
tv.setText(结果);
super.onPostExecute(结果);
}
@凌驾
受保护的void onPreExecute(){
//TODO自动生成的方法存根
super.onPreExecute();
}
}
}

请帮助我解决此问题…

替换

private static final String NAMESPACE = "http://www.processmaker.com/";


方法名称中也可能存在不匹配错误。就像你有一个名为
notifyme
的方法名,你可能写得像
notify\u me

你能共享wsdl url吗,即url。当我试图查看所有方法时,看不到任何东西?@AmitGupta这是本地主机url…如果你愿意,我准备好共享我的完整WSDL代码…我只在这里输入我想要的…这只是登录…试试这个,HttpTransportSE ht=new HttpTransportSE(url,10000);
private static final String NAMESPACE = "http://www.processmaker.com";