Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1604 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  probleme web service

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

probleme web service

n°1568428
sandrillon​_25
Posté le 01-06-2007 à 10:28:58  profilanswer
 

bonjour,
je voudrais utiliser un web service en .net avec nuSoap, mais cela ne fonctionne pas
 
mon code:
<?php
require_once('../nusoap-0.7.2/lib/nusoap.php');
 
             $soapaction = "http://www.webserviceX.NET/GetWeather";
 $wsdl = "http://www.webservicex.com/globalweather.asmx";
 $namespace = "http://www.webserviceX.NET/";
 $client = new soapclient($wsdl);
 
 $mysoapmsg = $client->serializeEnvelope('<GetWeather xmlns="http://www.webserviceX.NET/"><CityName xsi:type="xsd:string">lyon</CityName><CountryName xsi:type="xsd:string">france</CountryName></GetWeather>','',array(),'document','literal');
 
 $response = $client->send($mysoapmsg, $soapaction);
 
print_r($response);
echo '<h2>Requête</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Réponse</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
 
?>
 
Le réponse que je reçois:
 
Array ( [faultcode] => soap:Server [faultstring] => System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Procedure or Function 'getWeather' expects parameter '@CountryName', which was not supplied. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at WebServicex.GlobalWeather.GetWeather(String CityName, String CountryName) --- End of inner exception stack trace --- [detail] => )  
Requête
POST /globalweather.asmx HTTP/1.0
Host: www.webservicex.com
User-Agent: NuSOAP/0.7.2 (1.94)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: "http://www.webserviceX.NET/GetWeather"
Content-Length: 560
 
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><GetWeather xmlns="http://www.webserviceX.NET/"><CityName xsi:type="xsd:string">lyon</CityName><CountryName xsi:type="xsd:string">france</CountryName></GetWeather></SOAP-ENV:Body></SOAP-ENV:Envelope>
Réponse
HTTP/1.1 500 Internal Server Error.
Connection: close
Date: Fri, 01 Jun 2007 08:24:47 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 925
 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.Data.SqlClient.SqlException: Procedure or Function 'getWeather' expects parameter '@CountryName', which was not supplied.
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at WebServicex.GlobalWeather.GetWeather(String CityName, String CountryName)
   --- End of inner exception stack trace ---</faultstring>
      <detail />
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
 
 
quelqu'un aurait il une idée ?
merci beaucoup
sandrillon
 

mood
Publicité
Posté le 01-06-2007 à 10:28:58  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  probleme web service

 

Sujets relatifs
Problème débutantEquation de la chaleur en 2D. Problème avec mon logiciel.
[PHP][ORACLE] Problème de requête SQL[RESOLU] FPDF probleme mise en page tableau
Problème de compilo en ligne de commande : run-time error R6009probleme web service
Problème à l'appel de mon service web via le browserprog delphi en service : problème certaines fonctions
[Tomcat] problème de déploiment d'un service SOAP[Oracle] Problème d'installation du service Oracle pour MTS
Plus de sujets relatifs à : probleme web service


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR