LeonardoEth & Rfid Problem

Hello, I need some help, I have arduino leonardoEth and rc522 rfid reader, I want to send rfid data to web service and read response, if response 0 I will turn on the green led, I am reading rfid cards, and send data to webservice, But I couldnt read response, please help. Working Code below

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN         9           
#define SS_PIN          7         

MFRC522 mfrc522(SS_PIN, RST_PIN);   

#include <SPI.h>
#include <Ethernet2.h>


byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

char server[] = "www.webservice.com";   

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);


EthernetClient client;

String read_rfid;
int ledPin = 8;
int val;

void setup() {
    pinMode(ledPin, OUTPUT); 
    // disable SD SPI
    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);

    // disable w5100 SPI
    pinMode(10, OUTPUT);
    digitalWrite(10, HIGH);
    Serial.begin(9600);         
    while (!Serial);            
    SPI.begin();                
    mfrc522.PCD_Init();         

}


void dump_byte_array(byte *buffer, byte bufferSize) {
    read_rfid="";
    for (byte i = 0; i < bufferSize; i++) {
        read_rfid=read_rfid + String(buffer[i], HEX);
    }
}


void sendget() {
  
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    
    Ethernet.begin(mac, ip);
  }
  
  delay(1000);
  Serial.println("connecting...");

  
  if (client.connect(server, 80)) {
    Serial.println("connected");
   
    client.println("GET /Handlers/testws.ashx?rfid=rfid=4669fa413180&Identify=111 HTTP/1.1");
    client.println("Host: www.webservice.com");
    client.println("Connection: close");
    client.println();
    if (client.available()) {
      char c = client.read();
      Serial.print(c);
      if (c == "0")
      {
         digitalWrite(ledPin, HIGH);   
      }
  }
  else {
    
    Serial.println("connection failed");
  }
  if (!client.connected()) {
    Serial.println("disconnecting.");
    client.stop();
    while (true);
}
  }
}

  
void loop() {

     
    if ( ! mfrc522.PICC_IsNewCardPresent())
        return;

    
    if ( ! mfrc522.PICC_ReadCardSerial())
        return;

    dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
    Serial.println(read_rfid);
    if (read_rfid == "4669fa413180")
    {
      sendget();
    }
    delay(2000);

}

Working Code below

So, what is the problem, then?

if (client.available()) {
      char c = client.read();
      Serial.print(c);
      if (c == "0")
      {
         digitalWrite(ledPin, HIGH);   
      }
  }

If you connect to the server, you expect to get just one character back? That does not seem like a reasonable assumption to me.

What do your Serial.print()s tell you is happening?

my code sending rfid data to server without any problem, my server response "0" if this rfid authorized in our database, then gives green light and open electrical locked door. if not response "1" and give red light, not open the electrical locked door,

My serial monitor tell below

4669fa413180 (rfid)
connected (server)
(no response, but I see rfid is coming to my server)

below code worked, but this is only server client :frowning: when I add rfid code, no response again, I think my void loop has problem.

/*
  Web client

 This sketch connects to a website (http://www.google.com)
 using an Arduino Wiznet Ethernet shield.

 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13

 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 

 */

#include <SPI.h>
#include <Ethernet2.h>

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "www.webservice.com";    // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
  //Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
   // Serial.println("connected");
    // Make a HTTP request:
    client.println("GET /Handlers/testws.ashx?rfid=rfid=4669fa413180&Identify=111 HTTP/1.1");
    client.println("Host: www.webservice.com");
    client.println("Connection: close");
    client.println();
  }
  else {
    // kf you didn't get a connection to the server:
    Serial.println("connection failed");
  }
}

void loop()
{
  
  if (client.available()) {
    char c = client.read();
    
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
   // Serial.println();
   // Serial.println("disconnecting.");
    client.stop();
    

    // do nothing forevermore:
    while (true);
  }

}