swilliamrobert 0 Light Poster

Hi,

I want to send parameters to wsdl (xml file). I give sample code below.

--------------- createsession.php ------------------------------------------------

<?php

session_start();
require_once('lib/nusoap.php');
$client = new soapclientw('https://www.domin.com/services/umarketsc?wsdl', true);
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
$sessionResult = $client->call('createsession'); // No parameters
echo 'Session ID : '. $sessionResult;
?>
------------ End code ---------------------------------------------------------------

Sample XML for createsession
-------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:UMARKETSCWS">
<soapenv:Header/>
<soapenv:Body>
<urn:createsession/>
</soapenv:Body>
</soapenv:Envelope>

------------------------------------

I got sessionid response from above xml file.



Another Sampe php code for Login here

--------------------------------------

----------------------login.php---------------------------------
<?php
session_start();
require_once('lib/nusoap.php');
$client = new soapclientw('https://www.domin.com/services/umarketsc?wsdl', true);
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;

$username = 'webonline';
$password = '54321';

$res = strtolower($username).$password;
$res = strtolower(sha1($res));
$res = $sessionResult.$res;
$new_pin = strtoupper(sha1($res));

// below need to write login method using call function in soap

?>

----------------End code here-------------------------------------------------

Sample XML code for Login with three parameters[ sessionid, initator, pin]

--------------------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:UMARKETSCWS" xmlns:std="http://www.utiba.com/delirium/ws/StdQuery" xmlns:misc="http://www.utiba.com/delirium/ws/Misc">
<soapenv:Header/>
<soapenv:Body>
<urn:login>
<urn:loginRequest>
<urn:sessionid></urn:sessionid>
<urn:initiator></urn:initiator>
<urn:pin></urn:pin>

</urn:loginRequest>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>

---------------------------------------------------------------------------------------

Problem :

How can i send three parameters to this xml using call method in SOAP.

1.urn:sessionid
2.initiator
3.pin

<urn:login>
<urn:loginRequest>
<urn:sessionid></urn:sessionid>
<urn:initiator></urn:initiator>
<urn:pin></urn:pin>

</urn:loginRequest>
</urn:login>

please help me.. very urgent.. i am strugling still to pass parameters.


thanks
William

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.