2016-03-07 187 views
0

当正从我得到了如下的错误服务器响应:javax.net.ssl.SSLHandshakeException:javax.net.ssl.SSLProtocolException:SSL握手中止:SSL = 0x52e57148:

的javax。 net.ssl.SSLHandshakeException:javax.net.ssl.SSLProtocolException:SSL握手中止:SSL = 0x52e57148:失败在SSL库,通常一个协议错误

我的代码是:

private static String NAMESPACE = "https://tempuri.org/"; 
private static String URL = "https://192.168.1.6:4800/WebServices/UserLogin.asmx"; 
private static String SOAP_ACTION = "https://tempuri.org/"; 

public static String invokeWS(String jsonObjSend, String webMethName) { 
    String resTxt = null; 

    // Create request 
    SoapObject request = new SoapObject(NAMESPACE, webMethName); 
    // Property which holds input parameters 
    PropertyInfo jsonObj = new PropertyInfo(); 
    // Set Name 
    jsonObj.setName("jsdata"); 
    // Set Value 
    jsonObj.setValue(jsonObjSend.toString()); 
    // Set dataType 
    // jsonObj.setType(JSONObject.class); 
    jsonObj.setType(String.class); 
    // Add the property to request object 
    request.addProperty(jsonObj); 

    // Create envelope 
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
      SoapEnvelope.VER11); 
    new MarshalBase64().register(envelope); 
    envelope.dotNet = true; 
    // Set output SOAP object 
    envelope.setOutputSoapObject(request); 
    // Create HTTP call object 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

    try { 
     // Invole web service 
     androidHttpTransport.call(SOAP_ACTION+webMethName, envelope); 
     // Get the response 

     SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); 
     // Assign it to fahren static variable 
     resTxt = response.toString(); 

     System.out.println("Response is: " + resTxt); 

    } catch (Exception e) { 
     e.printStackTrace(); 
     resTxt = "Null"; 
    } 

    return resTxt; 
} 

回答

-6

只是通过使https到http它得到resloved

+0

这是一种解决方法,但不是一个真正的答案。如果您找到了实际的解决方案,请添加它。 –