Hello World! XML; try { $client = new WSClient(array( "to" => "http://localhost/samples/echo_service.php" )); $header1 = new WSHeader(array( "ns" => "http://test.org", "name" => "header1", "data" => "value1", "mustUnderstand" => false)); $msg = new WSMessage($requestPayloadString , array( "inputHeaders" => array($header1))); $client->request($msg); $sentMsg = $client->getLastRequest(); $recvMsg = $client->getLastResponse(); echo "\nSent message \n"; echo htmlspecialchars($sentMsg); echo "\n\n Received message \n"; echo htmlspecialchars($recvMsg); } catch (Exception $e) { if ($e instanceof WSFault) { printf("Soap Fault: %s\n", $e->Reason); } else { printf("Message = %s\n",$e->getMessage()); } } ?>