无法调用我的web服务在android中的信任问题

时间:2015-08-05 10:23:56

标签: java android ssl soap https

我在android中编写了一个方法来调用我的webservice。

public void HelloWorld() {
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

    try {
        androidHttpTransport.call(SOAP_ACTION, envelope);
        SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
        Log.e("ali", response.toString());

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

但是当我调用这个函数时,它会返回:

javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚。

我该如何解决这个问题 提前谢谢