Making Webservice call (SOAP Client) Call Using PHP.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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

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");

        $parent_node = $dom_doc->createElement("Pmaster");

        $node = $dom_doc->createElement("ReForm");

        $node = $dom_doc->createElement("CId");

        $node = $dom_doc->createElement("SId");

        $node = $dom_doc->createElement("CrId");

        $node = $dom_doc->createElement("StyId");

        $node = $dom_doc->createElement("Email");

        echo "<pre>";
        echo htmlspecialchars($dom_doc->saveXML());
        echo "</pre>";

        $soap_client = new SoapClient($this->wsdl,
                "trace" => 1,
                "exceptions" => 0

        try {
            $xmlResponse = $soap_client->updateEmail($dom_doc->saveXML());
        } catch (SoapFault $sf) {
            echo "<pre>";
            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>";
        echo "</pre>";

Re: Making Webservice call (SOAP Client) Call Using PHP.

You may like to check out the nusoap library which makes soap requests

Alternatively as of PHP5 there is a SOAP extension to the language

Site Timeline