slt,
J'ai développé sous VS 2010 une application winform qui permet d'utilisé un service wcf que j'ai
déjat créer avec wcf service library.
j'ai tester le service il marche sans problème mais je n'arrive pas à l'utilisé depuit mon API.
le fichier config générer est le suivant:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors />
<diagnostics>
<endToEndTracing propagateActivity="false" activityTracing="false"
messageFlowTracing="false" />
</diagnostics>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Services"
closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00"
bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession ordered="true"
inactivityTimeout="00:10:00"
enabled="false"
/>
<security mode="Message">
<transport
clientCredentialType="Windows" proxyCredentialType="None"
realm=""
/>
<message
clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default"
/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8732/Design_Time_Addresses/GlobalServices/Service1/mex"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_Services"
contract="GlobalServices.Services" name="WSHttpBinding_Services">
<identity>
<dns value="localhost"
/>
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
est pour l'appel j'ai utiliser la fonction suivante:
public void ServerStart()
{
try
{
serviceclient = new ServicesClient();
serviceclient.Open();
}
catch (Exception EX)
{
serviceclient.Close();
MessageBox.Show(EX.Message);
}
}