I have the Wifi Shield WLS06201P connected to my Mega:
Remove the header jumpers from the TX/RX pins
Jumper WIFI_TX to Mage Pin 10 (black wire in photo)
Jumper WIFI_RX to Mega Pin 11 (yellow wirein photo)
Alter the definition of WiFly class for pins 10,11: WiflyClass Wifly(10,11);
What this does is allow the shield’s library, which uses the SoftwareSerial class, to communicate with the Mega using pins 10 and 11. The Mega doesn’t support SoftwareSerial on pins 0-7: “Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69”
The WiFly device is now pingable. I have some garbage in my serial port monitor, but those characters are the “connection refused” TCPIP packet returned from the computer I am connecting to. Now I can get to work on a communication protocol between the Mega and other computers.