Some common HTTP methods and status codes

Some common HTTP methods
Method Description Safe Idempotent
GET
Requests a specific representation of a resource
Yes
Yes
PUT
Create or update a resource with the supplied representation
No
Yes
DELETE
Deletes the specified resource
No
Yes
POST
Submits data to be processed by the identified resource
No
No
HEAD
Similar to GET but only retrieves headers and not the body
Yes
Yes
OPTIONS
Returns the methods supported by the identified resource
Yes
Yes

Some common HTTP status codes
Status Range Description Examples
100
Informational
100 Continue
200
Successful
200 OK
201
Created
202
Accepted
300
Redirection
301 Moved Permanently
304
Not Modified
400
Client error
401 Unauthorized
402
Payment Required
404
Not Found
405
Method Not Allowed
500
Server error
500 Internal Server Error
501
Not Implemented



What is the difference between match_parent and fill_parent?

Matt Ball answered in stackoverflow. which is got more upvoted.
    They're the same thing (in API Level 8+). Use match_parent.

    FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding)
or
fill_parent (renamed match_parent in API Level 8) tells your view to become as big as its parent view group will allow
    fill_parent: The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent.

this also defined in official android site: developer.android.com/reference/android/view/ViewGroup.LayoutParams.html

How to communicate WCF webservices in android applications

- First you have to create wcf webserices, then you have defines some necessary thing to communicate with wcf.

You have to recognize the following in your wsdl file:

Method Name and Soap Action:


Namespace:

URL:

Download ksoap 2 and import in libs folder in android:
           

To download a file from there, right click on "View raw file" and select "Save Link as" (this label differs for different browsers) and you will get the full jar downloaded.

The latest release artifact would be available at

with a direct download url of

Now you have to defines following java code in your android application:

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.widget.TextView;

public class Test extends Activity {

public class SoapTask extends AsyncTask<Void, Void, Void> {
private final ProgressDialog dialog = new ProgressDialog(Test.this);
protected void onPreExecute() {

this.dialog.setMessage("Checking in...");
this.dialog.show();

}

@Override
protected Void doInBackground(Void... arg0) {
try{
WebServiceCallExample();
}catch (Exception e){
e.printStackTrace();
}
return null;
}

protected void onPostExecute(Void result) {
TextView tv = (TextView) findViewById(R.id.Result);
tv.setText(test_string);
if (this.dialog.isShowing()){
this.dialog.dismiss();
}
}

}

private String test_string;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test);
new SoapTask().execute();
}

@SuppressWarnings("deprecation")
public void WebServiceCallExample() {
final String NAMESPACE = "http://tempuri.org/";
final String URL = "http://yoururl.com/testService.svc";
final String METHOD_NAME = "SayHello";
final String SOAP_ACTION = "http://tempuri.org/IWFPService/SayHello";

SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);

/* Set the web service envelope */
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(Request);
System.out.println("Request::" + Request.toString());

AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
try{
androidHttpTransport.call(SOAP_ACTION, envelope);
//SoapObject response = (SoapObject) envelope.getResponse();
SoapPrimitive sp = (SoapPrimitive) envelope.getResponse();

SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
System.out.println("Response::" + resultsRequestSOAP.toString());
test_string = sp.toString();
}catch (Exception e){
e.printStackTrace();
}
}
}


test.xml layout file here:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:orientation="vertical" >


    <TextView
        android:id="@+id/Result"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="7dip"
        android:layout_marginRight="7dip"
        android:gravity="fill_vertical|fill_horizontal"
        android:layout_gravity="center_horizontal"
         android:textSize="24dip" android:text="test"
        android:textStyle="bold" >
    </TextView>

</LinearLayout>


You have got following output:



If you have any Problem please go to these link, which is more helpful for you:
http://stackoverflow.com/questions/tagged/android+ksoap2
https://code.google.com/p/ksoap2-android/wiki/Links
http://www.wsdl2code.com/pages/Example.aspx
http://code.tutsplus.com/tutorials/consuming-web-services-with-ksoap--mobile-21242
http://easywsdl.com/