Glad it works, although I did not think it would work with any earlier
version of nusoap.php that does not define the nusoap_client class. You
should consider getting the current version from CVS in order to have
all new features and bug fixes.
Scott Nichol
----- Original Message -----
From: "Gautier MERCUZOT" <gautier.mercuzot@xxxxxxxxx>
To: "Scott Nichol" <snicholnews@xxxxxxxxxxxxxxx>
Sent: Friday, May 04, 2007 9:10 AM
Subject: RE: [Nusoap-general] Please help me !
That work perfectly !!!
But, I've just changed the name class in the 4th line into :
$client = new
soapclient('http://www.xxxx.fr/webservice/Web_Services.asmx?WSDL',
because the nusoap_client is an undefined class.
Thank you very much.
A French php newbie.
-----Message d'origine-----
De : Scott Nichol [mailto:snicholnews@xxxxxxxxxxxxxxx]
Envoyé : vendredi 4 mai 2007 13:56
À : Gautier MERCUZOT
Cc : nusoap-general@xxxxxxxxxxxxxxxxxxxxx
Objet : Re: [Nusoap-general] Please help me !
Since the service provides WSDL, your client should use it. Here is
code that does that. Note that you should use the newest CVS revision
of nusoap.php for this code to work.
<?php
require_once('path-to/nusoap.php');
$client = new
nusoap_client('http://www.xxxx.fr/webservice/Web_Services.asmx?WSDL',
'wsdl');
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$proxy = $client->getProxy();
$privatekey = 'xxxxxxxx';
$ense = 'Carouf';
$ncmr = '15503432';
$key = strtoupper(md5($ense.$ncmr.$privatekey));
$params = array(
'ENSE' => $ense,
'NCMR' => $ncmr,
'SKEY' => $key
);
$result = $proxy->TracingColisDetaille($params);
if ($proxy->fault) {
echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';
} else {
$err = $proxy->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
}
}
// Display the request and response
echo '<h2>Request</h2><pre>' . htmlspecialchars($proxy->request,
ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($proxy->response,
ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Client Debug</h2><pre>' .
htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
echo '<h2>Proxy Debug</h2><pre>' . htmlspecialchars($proxy->getDebug(),
ENT_QUOTES) . '</pre>';
?>
Scott Nichol
----- Original Message -----
From: "Gautier MERCUZOT" <gautier.mercuzot@xxxxxxxxx>
To: "Scott Nichol" <snicholnews@xxxxxxxxxxxxxxx>
Sent: Friday, May 04, 2007 5:17 AM
Subject: RE: [Nusoap-general] Please help me !
Please see :
http://www.mondialrelay.fr/webservice/Web_Services.asmx?op=TracingColisDetaille
Thank you.
-----Message d'origine-----
De : Scott Nichol [mailto:snicholnews@xxxxxxxxxxxxxxx]
Envoyé : jeudi 3 mai 2007 15:33
À : Gautier MERCUZOT; nusoap-general@xxxxxxxxxxxxxxxxxxxxx
Objet : Re: [Nusoap-general] Please help me !
Can you provide either the WSDL for the web service or an example of a
valid SOAP request for the service?
Scott Nichol
----- Original Message -----
From: "Gautier MERCUZOT" <gautier.mercuzot@xxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, May 03, 2007 5:05 AM
Subject: [Nusoap-general] Please help me !
Hello,
I'm building a Soap Client but I've problem with parameters. Can you
help me :
Source :
<?
// Affiche le contenu d'un tableau
function AA($table)
{
echo '<pre>';
print_r($table);
echo '</pre>';
}
require_once ('lib/nusoap.php');
// Variables locales
$WS = 'http://www.xxxxx.fr/webservice/Web_Services.asmx';
$operation = 'TracingColisDetaille';
$soapaction = 'http://www.xxxxx.fr/webservice/';
$method =
'http://www.xxxxx.fr/webservice/TracingColisDetaille';
// Paramètres de Test
$privatekey = 'xxxxxxxx';
$ense = 'Carouf';
$ncmr = '15503432';
$key = strtoupper(md5($ense.$ncmr.$privatekey));
// Création de connexion au webservice
$client = new soapclient($WS);
// Passage des paramètres en tableau
$parameters = array(
'ENSE'=>$ense,
'NCMR'=>$ncmr,
'SKEY'=>$key);
AA($parameters);
// Appel de la méthode
$Result = $client->call($operation, $parameters,
$soapaction, $method);
// Affiche du contenu renvoyé par le Webservice
if (!$error = $client->getError())
{AA($Result);}
else
{AA($error);}
?>
Result :
Array
(
[ENSE] => Carouf
[NCMR] => 15503432
[SKEY] => 41A8F2D6CB2DCB7CB43D597C90249709
)
Array
(
[STAT] => 99
)
99 is an error code to qualifie a trouble with parameters.
Please help me. I really want to understand my mistake.
Thank You to the Nusoap team !
G.Mercuzot.
--------------------------------------------------------------------------------
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
--------------------------------------------------------------------------------
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/nusoap-general
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
|