Bonjour à tous...

Je souhaite faire un client .NET d'appel à un WebService Delphi.

Si je passe par l'assistant "Add Service Reference..." cela fonctionne sans problème. Cependant, je préfèrerais faire l'appel grâce à WCF.

J'ai donc pour cela développé simplement l'interface mais cela ne fonctionne pas. Je me suis ensuite inspiré du code généré par l'assistant et je suis arrivé à un point où le serveur reçoit le message du client (confirmé par le mode Debug coté Delphi) mais le client ne reçoit pas la réponse.

Voici la WSDL du Web Service Delphi

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IWsFMFBservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
  <message xmlns="http://schemas.xmlsoap.org/wsdl/" name="echoRequest">
    <part xmlns="http://schemas.xmlsoap.org/wsdl/" name="Value" type="xs:string"/>
  </message>
  <message xmlns="http://schemas.xmlsoap.org/wsdl/" name="echoResponse">
    <part xmlns="http://schemas.xmlsoap.org/wsdl/" name="return" type="xs:string"/>
  </message>
  <portType xmlns="http://schemas.xmlsoap.org/wsdl/" name="IWsFMFB">
    <operation xmlns="http://schemas.xmlsoap.org/wsdl/" name="echo">
 
      <input message="tns:echoRequest"/>
      <output message="tns:echoResponse"/>
    </operation>
  </portType>
  <binding xmlns="http://schemas.xmlsoap.org/wsdl/" name="IWsFMFBbinding" type="tns:IWsFMFB">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation xmlns="http://schemas.xmlsoap.org/wsdl/" name="echo">
      <soap:operation soapAction="urn:WsFMFBIntf-IWsFMFB#echo" style="rpc"/>
      <input>
 
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WsFMFBIntf-IWsFMFB"/>
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WsFMFBIntf-IWsFMFB"/>
      </output>
    </operation>
  </binding>
  <service xmlns="http://schemas.xmlsoap.org/wsdl/" name="IWsFMFBservice">
    <port xmlns="http://schemas.xmlsoap.org/wsdl/" name="IWsFMFBPort" binding="tns:IWsFMFBbinding">
 
      <soap:address location="http://localhost:1024/soap/IWsFMFB"/>
    </port>
  </service>
</definitions>
Et le code de mon interface :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
[ServiceContract(Namespace = "urn:WsFMFBIntf-IWsFMFB")]
[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)]
interface IWCF
{
    [OperationContract(Action = "urn:WsFMFBIntf-IWsFMFB#echo")]
    string echo(string Value);
}
Je pense que je dois utiliser le ReplyAction mais je ne vois pas comment...

Par avance merci pour votre aide.
Tetranos