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

  FORUM HardWare.fr
  Programmation
  PHP

  C#/SOAP/PHP5 Probleme webservice

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

C#/SOAP/PHP5 Probleme webservice

n°1666516
Junt
Posté le 05-01-2008 à 19:07:17  profilanswer
 

Bonjour à tous,
 
J'ai un petit soucis pour mettre en place un webservice PHP5 et un client en C# . Je teste avec un simple Hello World.
le webservice est basé sur un wsdl.  
Lorsque j'execute mon client C# j'ai le message suivant :
Incompatibilité de version SOAP possible : l'espace de noms enveloppe http://schemas.xmlsoap.org/wsdl/ était inattendu. http://schemas.xmlsoap.org/soap/envelope/ attendu.
Je suis sous le framework2 de C#, j'ai testé le webservice avec un client perl (SOAP::Lite) et cela fonctionne très bien.  
Avez vous une idée ? :(
Voici le wsdl:  

Code :
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <definitions name="HelloService"
  3.    targetNamespace="http://127.0.0.1/soap/hello.wsdl"
  4.    xmlns="http://schemas.xmlsoap.org/wsdl/"
  5.    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  6.    xmlns:tns="http://127.0.0.1/soap/hello.wsdl"
  7.    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  8.    <message name="SayHelloRequest">
  9.       <part name="firstName" type="xsd:string"/>
  10.    </message>
  11.    <message name="SayHelloResponse">
  12.       <part name="greeting" type="xsd:string"/>
  13.    </message>
  14.    <portType name="Hello_PortType">
  15.       <operation name="sayHello">
  16.          <input message="tns:SayHelloRequest"/>
  17.          <output message="tns:SayHelloResponse"/>
  18.       </operation>
  19.    </portType>
  20.  
  21.    <binding name="Hello_Binding" type="tns:Hello_PortType">
  22.       <soap:binding style="rpc"
  23.          transport="http://schemas.xmlsoap.org/soap/http"/>
  24.       <operation name="sayHello">
  25.          <soap:operation soapAction="sayHello"/>
  26.          <input>
  27.             <soap:body
  28.                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  29.                namespace="urn:examples:helloservice"
  30.                use="encoded"/>
  31.          </input>
  32.          <output>
  33.             <soap:body
  34.                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  35.                namespace="urn:examples:helloservice"
  36.                use="encoded"/>
  37.          </output>
  38.       </operation>
  39.    </binding>
  40.    <service name="HelloService">
  41.       <documentation>WSDL File for HelloService</documentation>
  42.       <port binding="tns:Hello_Binding" name="Hello_Port">
  43.  
  44.          <soap:address
  45. location="http://127.0.0.1/soap/hello_soap.php"/>
  46.       </port>
  47.    </service>
  48. </definitions>


 
Merci d'avance de votre aide  
Cordialement
Junt


Message édité par Junt le 05-01-2008 à 19:20:51
mood
Publicité
Posté le 05-01-2008 à 19:07:17  profilanswer
 

n°1666759
CyberDenix
Posté le 06-01-2008 à 15:01:47  profilanswer
 

Je te poste un wsdl à moi, pas le temps d'épurer mais je crois qu'il te manque des urn:
 

Code :
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <definitions name="provider" targetNamespace="urn:provider" xmlns:typens="urn:provider" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
  3. <message name="__construct"/>
  4. <message name="__constructResponse"/>
  5. <message name="__destruct"/>
  6. <message name="__destructResponse"/>
  7. <message name="getTicket">
  8.  <part name="xml" type="xsd:string"/>
  9. </message>
  10. <message name="getTicketResponse">
  11.  <part name="getTicketReturn" type="xsd:string"/>
  12. </message>
  13. <message name="payTicket">
  14.  <part name="xml" type="xsd:string"/>
  15. </message>
  16. <message name="payTicketResponse">
  17.  <part name="payTicketReturn" type="xsd:string"/>
  18. </message>
  19. <message name="getTicketStatus">
  20.  <part name="xml" type="xsd:string"/>
  21. </message>
  22. <message name="getTicketStatusResponse">
  23.  <part name="getTicketStatusReturn" type="xsd:string"/>
  24. </message>
  25. <portType name="ProviderPortType">
  26.  <documentation>
  27.   This class provides basic web services
  28.  </documentation>
  29.  <operation name="__construct">
  30.   <documentation>
  31.    Constructs the class.
  32.   </documentation>
  33.   <input message="typens:__construct"/>
  34.   <output message="typens:__constructResponse"/>
  35.  </operation>
  36.  <operation name="__destruct">
  37.   <documentation>
  38.    Destroys the class.
  39.   </documentation>
  40.   <input message="typens:__destruct"/>
  41.   <output message="typens:__destructResponse"/>
  42.  </operation>
  43.  <operation name="getTicket">
  44.   <documentation>
  45.    Gets a ticket.
  46.   </documentation>
  47.   <input message="typens:getTicket"/>
  48.   <output message="typens:getTicketResponse"/>
  49.  </operation>
  50.  <operation name="payTicket">
  51.   <documentation>
  52.    Pays a ticket.
  53.   </documentation>
  54.   <input message="typens:payTicket"/>
  55.   <output message="typens:payTicketResponse"/>
  56.  </operation>
  57.  <operation name="getTicketStatus">
  58.   <documentation>
  59.    Get a ticket status.
  60.   </documentation>
  61.   <input message="typens:getTicketStatus"/>
  62.   <output message="typens:getTicketStatusResponse"/>
  63.  </operation>
  64. </portType>
  65. <binding name="ProviderBinding" type="typens:ProviderPortType">
  66.  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  67.  <operation name="__construct">
  68.   <soap:operation soapAction="urn:ProviderAction"/>
  69.   <input>
  70.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  71.   </input>
  72.   <output>
  73.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  74.   </output>
  75.  </operation>
  76.  <operation name="__destruct">
  77.   <soap:operation soapAction="urn:ProviderAction"/>
  78.   <input>
  79.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  80.   </input>
  81.   <output>
  82.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  83.   </output>
  84.  </operation>
  85.  <operation name="getTicket">
  86.   <soap:operation soapAction="urn:ProviderAction"/>
  87.   <input>
  88.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  89.   </input>
  90.   <output>
  91.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  92.   </output>
  93.  </operation>
  94.  <operation name="payTicket">
  95.   <soap:operation soapAction="urn:ProviderAction"/>
  96.   <input>
  97.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  98.   </input>
  99.   <output>
  100.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  101.   </output>
  102.  </operation>
  103.  <operation name="getTicketStatus">
  104.   <soap:operation soapAction="urn:ProviderAction"/>
  105.   <input>
  106.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  107.   </input>
  108.   <output>
  109.    <soap:body namespace="urn:provider" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  110.   </output>
  111.  </operation>
  112. </binding>
  113. <service name="providerService">
  114.  <port name="ProviderPort" binding="typens:ProviderBinding">
  115.   <soap:address location="http://127.0.0.1:8080/soap/provider/main.php"/>
  116.  </port>
  117. </service>
  118. </definitions>


---------------
Directeur Technique (CTO)
n°1666801
Junt
Posté le 06-01-2008 à 17:05:32  profilanswer
 

Salut CyberDenix,
 
Merci pour ta réponse jai le même problème avec ton WSDL.
Je pense que cela vient d'un probleme du framework2 avec SOAP... mais je n'arrive pas à trouver :(
Junt

n°1668467
pot2yaourt
Posté le 09-01-2008 à 17:10:15  profilanswer
 

Salut !
 
Quand tu crée ton service web en PHP, tu peux lui préciser la version de SOAP que tu veux utiliser : 1.1 ou 1.2
 
Sauf erreur, il me semble que les deux versions sont incompatibles entre elles.
Essaye peut-être ça...
 
http://fr.php.net/manual/fr/functi [...] struct.php
 
Lionel.

n°1726950
Hrk
Posté le 30-04-2008 à 15:56:49  profilanswer
 

Salut, est-ce que quelqu'un a trouvé la solution à ce problème ? Je bloque et j'ai exactement la même chose.
 
J'ai généré les proxy à l'aide du "Add web reference" de Visual Studio 2008 (je suis en développement web asp.net si jamais). J'ai eu 2 fichiers wsdl générés (QueryOperationsWebServiceService.wsdl et EPCISServicePortType.wsdl). Voici le fichier principal :
 

Code :
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <wsdl:definitions xmlns:tns="http://query.repository.epcis.accada.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="urn:epcglobal:epcis:wsdl:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="QueryOperationsWebServiceService" targetNamespace="http://query.repository.epcis.accada.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  3.   <wsdl:import namespace="urn:epcglobal:epcis:wsdl:1" location="http://srvepcis01:8080/accada_epcis/query?wsdl=EPCISServicePortType.wsdl" />
  4.   <wsdl:types />
  5.   <wsdl:binding name="QueryOperationsWebServiceServiceSoapBinding" type="ns1:EPCISServicePortType">
  6.     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
  7.     <wsdl:operation name="getQueryNames">
  8.       <soap:operation soapAction="" style="document" />
  9.       <wsdl:input name="getQueryNames">
  10.         <soap:body use="literal" />
  11.       </wsdl:input>
  12.       <wsdl:output name="getQueryNamesResponse">
  13.         <soap:body use="literal" />
  14.       </wsdl:output>
  15.       <wsdl:fault name="ImplementationExceptionResponse">
  16.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  17.       </wsdl:fault>
  18.       <wsdl:fault name="ValidationExceptionResponse">
  19.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  20.       </wsdl:fault>
  21.       <wsdl:fault name="SecurityExceptionResponse">
  22.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  23.       </wsdl:fault>
  24.     </wsdl:operation>
  25.     <wsdl:operation name="unsubscribe">
  26.       <soap:operation soapAction="" style="document" />
  27.       <wsdl:input name="unsubscribe">
  28.         <soap:body use="literal" />
  29.       </wsdl:input>
  30.       <wsdl:output name="unsubscribeResponse">
  31.         <soap:body use="literal" />
  32.       </wsdl:output>
  33.       <wsdl:fault name="ImplementationExceptionResponse">
  34.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  35.       </wsdl:fault>
  36.       <wsdl:fault name="ValidationExceptionResponse">
  37.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  38.       </wsdl:fault>
  39.       <wsdl:fault name="NoSuchSubscriptionExceptionResponse">
  40.         <soap:fault use="literal" name="NoSuchSubscriptionExceptionResponse" namespace="" />
  41.       </wsdl:fault>
  42.       <wsdl:fault name="SecurityExceptionResponse">
  43.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  44.       </wsdl:fault>
  45.     </wsdl:operation>
  46.     <wsdl:operation name="poll">
  47.       <soap:operation soapAction="" style="document" />
  48.       <wsdl:input name="poll">
  49.         <soap:body use="literal" />
  50.       </wsdl:input>
  51.       <wsdl:output name="pollResponse">
  52.         <soap:body use="literal" />
  53.       </wsdl:output>
  54.       <wsdl:fault name="QueryTooComplexExceptionResponse">
  55.         <soap:fault use="literal" name="QueryTooComplexExceptionResponse" namespace="" />
  56.       </wsdl:fault>
  57.       <wsdl:fault name="ImplementationExceptionResponse">
  58.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  59.       </wsdl:fault>
  60.       <wsdl:fault name="QueryParameterExceptionResponse">
  61.         <soap:fault use="literal" name="QueryParameterExceptionResponse" namespace="" />
  62.       </wsdl:fault>
  63.       <wsdl:fault name="ValidationExceptionResponse">
  64.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  65.       </wsdl:fault>
  66.       <wsdl:fault name="QueryTooLargeExceptionResponse">
  67.         <soap:fault use="literal" name="QueryTooLargeExceptionResponse" namespace="" />
  68.       </wsdl:fault>
  69.       <wsdl:fault name="SecurityExceptionResponse">
  70.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  71.       </wsdl:fault>
  72.       <wsdl:fault name="NoSuchNameExceptionResponse">
  73.         <soap:fault use="literal" name="NoSuchNameExceptionResponse" namespace="" />
  74.       </wsdl:fault>
  75.     </wsdl:operation>
  76.     <wsdl:operation name="subscribe">
  77.       <soap:operation soapAction="" style="document" />
  78.       <wsdl:input name="subscribe">
  79.         <soap:body use="literal" />
  80.       </wsdl:input>
  81.       <wsdl:output name="subscribeResponse">
  82.         <soap:body use="literal" />
  83.       </wsdl:output>
  84.       <wsdl:fault name="QueryTooComplexExceptionResponse">
  85.         <soap:fault use="literal" name="QueryTooComplexExceptionResponse" namespace="" />
  86.       </wsdl:fault>
  87.       <wsdl:fault name="ImplementationExceptionResponse">
  88.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  89.       </wsdl:fault>
  90.       <wsdl:fault name="SubscriptionControlsExceptionResponse">
  91.         <soap:fault use="literal" name="SubscriptionControlsExceptionResponse" namespace="" />
  92.       </wsdl:fault>
  93.       <wsdl:fault name="QueryParameterExceptionResponse">
  94.         <soap:fault use="literal" name="QueryParameterExceptionResponse" namespace="" />
  95.       </wsdl:fault>
  96.       <wsdl:fault name="ValidationExceptionResponse">
  97.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  98.       </wsdl:fault>
  99.       <wsdl:fault name="DuplicateSubscriptionExceptionResponse">
  100.         <soap:fault use="literal" name="DuplicateSubscriptionExceptionResponse" namespace="" />
  101.       </wsdl:fault>
  102.       <wsdl:fault name="SecurityExceptionResponse">
  103.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  104.       </wsdl:fault>
  105.       <wsdl:fault name="NoSuchNameExceptionResponse">
  106.         <soap:fault use="literal" name="NoSuchNameExceptionResponse" namespace="" />
  107.       </wsdl:fault>
  108.       <wsdl:fault name="SubscribeNotPermittedExceptionResponse">
  109.         <soap:fault use="literal" name="SubscribeNotPermittedExceptionResponse" namespace="" />
  110.       </wsdl:fault>
  111.       <wsdl:fault name="InvalidURIExceptionResponse">
  112.         <soap:fault use="literal" name="InvalidURIExceptionResponse" namespace="" />
  113.       </wsdl:fault>
  114.     </wsdl:operation>
  115.     <wsdl:operation name="getVendorVersion">
  116.       <soap:operation soapAction="" style="document" />
  117.       <wsdl:input name="getVendorVersion">
  118.         <soap:body use="literal" />
  119.       </wsdl:input>
  120.       <wsdl:output name="getVendorVersionResponse">
  121.         <soap:body use="literal" />
  122.       </wsdl:output>
  123.       <wsdl:fault name="ImplementationExceptionResponse">
  124.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  125.       </wsdl:fault>
  126.       <wsdl:fault name="ValidationExceptionResponse">
  127.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  128.       </wsdl:fault>
  129.       <wsdl:fault name="SecurityExceptionResponse">
  130.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  131.       </wsdl:fault>
  132.     </wsdl:operation>
  133.     <wsdl:operation name="getStandardVersion">
  134.       <soap:operation soapAction="" style="document" />
  135.       <wsdl:input name="getStandardVersion">
  136.         <soap:body use="literal" />
  137.       </wsdl:input>
  138.       <wsdl:output name="getStandardVersionResponse">
  139.         <soap:body use="literal" />
  140.       </wsdl:output>
  141.       <wsdl:fault name="ImplementationExceptionResponse">
  142.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  143.       </wsdl:fault>
  144.       <wsdl:fault name="ValidationExceptionResponse">
  145.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  146.       </wsdl:fault>
  147.       <wsdl:fault name="SecurityExceptionResponse">
  148.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  149.       </wsdl:fault>
  150.     </wsdl:operation>
  151.     <wsdl:operation name="getSubscriptionIDs">
  152.       <soap:operation soapAction="" style="document" />
  153.       <wsdl:input name="getSubscriptionIDs">
  154.         <soap:body use="literal" />
  155.       </wsdl:input>
  156.       <wsdl:output name="getSubscriptionIDsResponse">
  157.         <soap:body use="literal" />
  158.       </wsdl:output>
  159.       <wsdl:fault name="ImplementationExceptionResponse">
  160.         <soap:fault use="literal" name="ImplementationExceptionResponse" namespace="" />
  161.       </wsdl:fault>
  162.       <wsdl:fault name="ValidationExceptionResponse">
  163.         <soap:fault use="literal" name="ValidationExceptionResponse" namespace="" />
  164.       </wsdl:fault>
  165.       <wsdl:fault name="SecurityExceptionResponse">
  166.         <soap:fault use="literal" name="SecurityExceptionResponse" namespace="" />
  167.       </wsdl:fault>
  168.       <wsdl:fault name="NoSuchNameExceptionResponse">
  169.         <soap:fault use="literal" name="NoSuchNameExceptionResponse" namespace="" />
  170.       </wsdl:fault>
  171.     </wsdl:operation>
  172.   </wsdl:binding>
  173.   <wsdl:service name="QueryOperationsWebServiceService">
  174.     <wsdl:port name="QueryOperationsWebServicePort" binding="tns:QueryOperationsWebServiceServiceSoapBinding">
  175.       <soap:address location="http://srvepcis01:8080/accada_epcis/query" />
  176.     </wsdl:port>
  177.   </wsdl:service>
  178. </wsdl:definitions>


 
Merci pour votre aide

n°1732232
Hrk
Posté le 15-05-2008 à 15:03:17  profilanswer
 

Il suffit en fait de ne pas mettre le "?wsdl" dans le string de l'adresse auquel on se connecte... Faute toute bête, mais l'erreur n'est vraiment pas très explicite..


Message édité par Hrk le 15-05-2008 à 15:03:47

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

  C#/SOAP/PHP5 Probleme webservice

 

Sujets relatifs
Problème sur un script PHP de calendrier[BASH] Probleme cron et autres [Résolu]
Probleme de "logique de script"probleme php 5.2.5
probleme de avec la validation html (validateur W3)Problème IIS 5 et ASP sur Windows 2000 pro
[JS] Problème de value et d'incertion de lien dans inner.HTMLProblème d'utilisation d'une classe
[HTML] probleme redirection ok sous firefox mais pas sous IEProblème pour faire un glisser deposer dans flash!
Plus de sujets relatifs à : C#/SOAP/PHP5 Probleme webservice


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