grps.GetIPAddress returns ip of 0.0.0.0

I'm trying to run the following example program with my new gsm shield:

/*
  Basic Web Server

 A simple web server that replies with nothing, but prints the client's request
 and the server IP address.

 Circuit:
 * GSM shield attached

 created 
 by David Cuartielles
 modified 21 Nov 2012
 by Tom Igoe

 http://arduino.cc/en/Tutorial/GSMToolsTestWebServer

 This example code is part of the public domain
 */
 #include <GSM.h>

// PIN Number
#define PINNUMBER ""

// APN data
#define GPRS_APN       "bluevia.movistar.es" // replace your GPRS APN
#define GPRS_LOGIN     ""    // replace with your GPRS login
#define GPRS_PASSWORD  "" // replace with your GPRS password


// initialize the library instance
GPRS gprs;
GSM gsmAccess();     // include a 'true' parameter for debug enabled
GSMServer server(80); // port 80 (http default)

// timeout
const unsigned long __TIMEOUT__ = 10*1000;

void setup()
{
  // initialize serial communications
  Serial.begin(9600);
Serial.println("starting,..");
  // connection state
  boolean connected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(!connected)
  {
    if((gsmAccess.begin(PINNUMBER)==GSM_READY) &
        (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD)==GPRS_READY))
      connected = true;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("Connected to GPRS network");

  // start server
  server.begin();

  //Get IP.
  IPAddress LocalIP = gprs.getIPAddress();
  Serial.println("Server IP address=");
  Serial.println(LocalIP);
}

void loop(){
  GSMClient client = server.available();

 if (client) {
   if (client.available()) {
    Serial.write(client.read()); 
   }
}

}

gprs.getIPAddress always returns an IP of 0.0.0.0, which can't be correct. Am I missing something, or is there someway to communicate with the arduino using 0.0.0.0 as an ip?

There is an error in your code with connection while.

I fixed for you:

/*
Basic Web Server

A simple web server that replies with nothing, but prints the client's request
and the server IP address.

Circuit:

  • GSM shield attached

created
by David Cuartielles
modified 21 Nov 2012
by Tom Igoe

This example code is part of the public domain
*/
#include <GSM.h>

// PIN Number
#define PINNUMBER ""

// APN data
#define GPRS_APN "bluevia.movistar.es" // replace your GPRS APN
#define GPRS_LOGIN "" // replace with your GPRS login
#define GPRS_PASSWORD "" // replace with your GPRS password

// initialize the library instance
GPRS gprs;
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSMServer server(80); // port 80 (http default)

// timeout
const unsigned long TIMEOUT = 10*1000;

void setup()
{
// initialize serial communications
Serial.begin(9600);
Serial.println("starting,..");
// connection state
boolean notconnected = true;

// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notconnected)
{
if((gsmAccess.begin(PINNUMBER)==GSM_READY) &
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD)==GPRS_READY))
notconnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}

Serial.println("Connected to GPRS network");

// start server
server.begin();

//Get IP.
IPAddress LocalIP = gprs.getIPAddress();
Serial.println("Server IP address=");
Serial.println(LocalIP);
}

void loop(){
GSMClient client = server.available();

if (client) {
if (client.available()) {
Serial.write(client.read());
}
}

}

That made it work! I feel so dumb now looking at that coding mistake. Thanks so much for your help.

actually even i'm trying to create a gsm server but i'm to getting server ip address 0.0.0.0 so please respond in words i didn't understood the above solution