Posted by viswanath.sodisetti on 07/05/07 13:13
Hi,
I am new to php.I am trying to make a Webservice call thru php. The
method requires XML as input. On the webservice logs its saying Blank
Input.Any ideas why XML i built is not going thru the call.
Any help will be greatly appreciated.
Thanks in advance
~v
Code i am using is below.
$date = gmdate("j M Y H:i:s") . " GMT";
$dom_doc = new DOMDocument('1.0','UTF-8');
$top_node = $dom_doc->createElementNS($this->post_url,"sInputXml");
$dom_doc->appendChild($top_node);
$parent_node = $dom_doc->createElement("Pmaster");
$top_node->appendChild($parent_node);
$node = $dom_doc->createElement("ReForm");
$parent_node->appendChild($node);
$node->appendChild($dom_doc->createTextNode($this->ReForm));
$node = $dom_doc->createElement("CId");
$parent_node->appendChild($node);
$node->appendChild($dom_doc->createTextNode($this->CId));
$node = $dom_doc->createElement("SId");
$parent_node->appendChild($node);
$node->appendChild($dom_doc->createTextNode($this->SId));
$node = $dom_doc->createElement("CrId");
$parent_node->appendChild($node);
$node->appendChild($dom_doc->createTextNode($this->CrId));
$node = $dom_doc->createElement("StyId");
$parent_node->appendChild($node);
$node->appendChild($dom_doc->createTextNode($this->StyId));
$node = $dom_doc->createElement("Email");
$parent_node->appendChild($node);
$node->appendChild($dom_doc->createCDATASection($this->Email));
echo "<pre>";
echo htmlspecialchars($dom_doc->saveXML());
echo "</pre>";
$soap_client = new SoapClient($this->wsdl,
array(
"trace" => 1,
"exceptions" => 0
)
);
try {
$xmlResponse = $soap_client->updateEmail($dom_doc->saveXML());
} catch (SoapFault $sf) {
echo "<pre>";
print_r($sf);
echo "</pre>";
}
echo "<pre>";
print htmlspecialchars($soap_client->__getLastRequestHeaders() );
print "<br>----------------------<br>\n";
print htmlspecialchars($soap_client->__getLastRequest() );
print "<br>----------------------<br>\n";
print htmlspecialchars($soap_client->__getLastResponse());
print "<br>----------------------<br>\n";
print htmlspecialchars($soap_client->__getLastResponseHeaders() );
print "<br>----------------------<br>\n";
echo "</pre>";
echo "<pre>";
print_r($xmlResponse);
echo "</pre>";
[Back to original message]
|