ESP8266 in station mode not able to connect to server using HTTP

I’m facing problem when ESP8266 is in station mode,
steps:

  1. config into station mode
    WiFi.mode(WIFI_STA);

  2. wifi begin
    WiFi.begin((const char*)ssid,(const char*)password);

  3. wifi IP, gateway and subnet config
    WiFi.config(apIP, WiFi.gatewayIP(),WiFi.subnetMask());

  4. wait for retry
    while ((WiFi.status()!= WL_CONNECTED)&&(retry++ < 200)){
    delay(100);
    #ifdef debug
    Serial.print(".");
    #endif
    }

  5. connect to server
    if(client.connect(url_server, 80))

Not able to connect to server

Observation:

If I try reading the configured IP after wifi successful connection
configuration I could see is 0.0.0.0(gateway),192.168.1.11(shield IP)
and subnet mask is 0.0.0.0.

Regards
mahesh

Use an example like this one.