0

httpTransport.callこのコード行には例外があります. しかし ex は null

private static String CallServiceMethod(String methodName,String Json) throws Exception
 {      
Object response = null;
        try
        {       
        SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,methodName);

        PropertyInfo propertyInfo = new PropertyInfo();
        propertyInfo.setName("Json");
        propertyInfo.setValue(Json);
        propertyInfo.setType(String.class);
        request.addProperty(propertyInfo);

        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
        envelope.dotNet = true;

        envelope.setOutputSoapObject(request);
        HttpTransportSE httpTransport = new HttpTransportSE(SystemConfiguration.ServiceUrl);        
        httpTransport.call(WSDL_TARGET_NAMESPACE + methodName, envelope); //Error
        response = envelope.getResponse();
        }
        catch (Exception ex)
        {
            //TODO:Log
            String x = ex.getMessage(); //why ex is null???
        }
        return response.toString();

    }  
4

2 に答える 2

0

次のようなものを使用してみてください-

catch(Exception ex)
{
    Toast.makeText(this, "Exception ex1  = " + ex.toString(), Toast.LENGTH_LONG).show();
     Log.d(TAG, "Exception ex1  = " + ex.toString());
     return  "Exception ex1  = " + ex.toString();
}
  `
于 2013-08-21T04:15:39.090 に答える