1

I need to call to a SAP web service using android to get material no using material document no. I am using ksoap2 library. Problem is I don't what exactly the NAMESPACE, SOAP_ACTION mean. I cannot get any response.

METHOD_NAME = "ZSL_GET_MAT_DOC";

URL = "http://SL_S:****@AP.vv.lk:8000/sap/bc/srt/rfc/sap/zsl_get_mat_doc/110/zsl_get_mat_doc/zl_web_svr4";

This is my method.

class RetrieveFeedTask extends AsyncTask<String, Void, String> {
        @Override
        protected String doInBackground(String... strings) {

            // Create SOAP request
            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
            request.addProperty("Materialdocument", "0407000147");

            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.setOutputSoapObject(request);
            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
            try {
                androidHttpTransport.call(SOAP_ACTION, envelope);

                // Get response from envelope
                Object result = envelope.getResponse();

                // Display result
                Toast.makeText(getContext(), result.toString(), Toast.LENGTH_LONG).show();

            } catch (IOException e) {
                e.printStackTrace();
            } catch (XmlPullParserException e) {
                e.printStackTrace();
            }

            return null;
        }
    }
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
D.Madu
  • 507
  • 2
  • 8
  • 28

1 Answers1

0

De Namespace is the namespace of your SOAP WSDL. Most likely this will be

urn:sap-com:document:sap:rfc:functions.

The Action is also mentioned in the WSDL. When using a SAP RFC this will be "name of the RFCRequest". So this will most likely be ZSL_GET_MAT_DOCRequest.

Hope this helps.

Krishna Mohan
  • 1,503
  • 3
  • 22
  • 28