首页 > 解决方案 > 在 android studio 上调用 HTTPS 的 web SOAP Api 并得到 500 错误

问题描述

我正在尝试在具有 HTTPS 协议的 android studio 上调用 SOAP api,我收到错误 500,你们的任何帮助都会让我开心我已经在这个问题上浪费了太多时间,没有从我不知道的任何地方获得任何帮助我做错名称空间的地方是= HTTP 如果有人可以,请打开基本链接

https://183.87.134.37/DemoRitmanpayinapi/RitmanPay.svc?wsdl  // base URL to get data



  public static final String NAMESPACE = "http://tempuri.org/";
public static final String URL = "https://183.87.134.37/DemoRitmanpayinapi/RitmanPay.svc?wsdl";
public static final String SOAP_ACTION = "Ser/IRitmanPay/GetIDType";
public static final String METHOD_NAME = "GetIDType";

这是名称空间和其他信誉

public class getTransferRate extends AsyncTask<String , Object , String> {

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        progressBar.setVisibility(View.VISIBLE);
    }

    @Override
    protected String doInBackground(String... strings) {
        SoapObject soapObject = new SoapObject(NAMESPACE , METHOD_NAME);
        soapObject.addProperty("PartnerCode" , "161333");
        soapObject.addProperty("UserName" , "WAMOBILEAPP");
        soapObject.addProperty("UserPassword" , "WAMOBILEAPP");
        soapObject.addProperty("CountryShortName" , "ind");

        SoapSerializationEnvelope sr = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        sr.dotNet = true;
        sr.bodyOut = soapObject;

        sr.setOutputSoapObject(soapObject);


      // HttpsTransportSE se = new HttpsTransportSE(URL , 30000);

        HttpTransportSE transportSE = new HttpTransportSE(URL , 30000);

        try {

            transportSE.call(SOAP_ACTION , sr);
            Log.e( "doInBackground: ", (String) sr.getResponse());
        }catch ( Exception e) {
            e.printStackTrace();
            Log.e("Ex" , e.toString());
        }

        return null;
    }


    @Override
    protected void onPostExecute(String s) {
        super.onPostExecute(s);
        progressBar.setVisibility(View.GONE);
    }
}

谁能帮我解决我的问题

标签: c#android.netandroid-studiosoap

解决方案


推荐阅读