Note that there are some explanatory texts on larger screens.

plurals
  1. POConsuming WCF service through KSOAP2 on Android gives errors
    primarykey
    data
    text
    <p>I have the following <a href="http://50.19.226.15/Office365Admin/MsOnline.svc?wsdl" rel="nofollow">WCF webservice</a></p> <p>I want to consume it in android client.My code so far is</p> <pre><code>public class SOAP_TestActivity extends Activity { private final String NAMESPACE = "http://tempuri.org/"; private final String URL = "http://50.19.226.15/Office365Admin/MsOnline.svc"; private final String SOAP_ACTION = "http://tempuri.org/IMsOnline/ValidateUser"; private final String METHOD_NAME = "ValidateUser"; private final String user_id= "khurram@office365trial.com.au"; private final String password= "friday@123"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button signin = (Button) findViewById(R.id.regsubmitbtn); signin.setOnClickListener(new OnClickListener() { public void onClick(View v) { boolean auth=doLogin(); System.out.println(auth); Toast.makeText(getApplicationContext(), String.valueOf(auth), Toast.LENGTH_SHORT).show(); } }); } private boolean doLogin() { boolean result=false; SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("userid", user_id); request.addProperty("password",password); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); Log.d("myApp", request.toString()); System.out.println(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); androidHttpTransport.debug = true; try { androidHttpTransport.call(SOAP_ACTION, envelope); SoapPrimitive soapPrimitiveResults = (SoapPrimitive)envelope.getResponse(); Log.d("myApp", soapPrimitiveResults.toString()); System.out.println("myApp" +soapPrimitiveResults); if(soapPrimitiveResults.toString().equalsIgnoreCase("true")) { result = true; } }catch(SocketException ex) { Log.e("Error : " , "Error on soapPrimitiveData() " + ex.getMessage()); ex.printStackTrace(); } catch (Exception e) { Log.e("Error : " , "Error on soapPrimitiveData() " + e.getMessage()); e.printStackTrace(); } return result; } } </code></pre> <p>This code works without any exception but I am not able to login into my application as the method <code>ValidateUser</code> always return false.This same webservice has been consumed in Windows Phone and is working without any problem.Also the username and password are 100% correct.</p> <p>Looks like there is some problem in the <code>NAMESPACE</code> and <code>SOAP_ACTION</code>. I have gone through some tutorials and they say that the <code>SOAP_ACTION</code> is made by concatenating <code>NAMESPACE</code> with <code>METHOD_NAME</code>.So if I follow the tutorials my <code>SOAP_ACTION</code> should be </p> <p><code>"http://tempuri.org/ValidateUser"</code></p> <p>but the <code>SOAP_ACTION</code> given in the <code>WSDL link</code>for the method <code>"ValidateUser"</code> is</p> <p><code>"http://tempuri.org/IMsOnline/ValidateUser"</code>.</p> <p>I am new to WCF Webservices and SOAP.Can anybody please tell me how to implement the methods given in <code>WSDL Document(link is at the top)</code>. Looks like missing something important but don't know what.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload