title: One WCF service – two clients; One client does not work
body: <p>I have one WCF service and two console app clients.  </p>
  
  <p>Service: The service code is created from a wsdl contact using WCSF Blue tool.</p>
  
  <p>Client 1: This client is using wsdl that is obtained by browsing the svc file. This browsed wsdl file is slightly different from the contract wsdl file.</p>
  
  <p>Client 2: This client is created using the original wsdl contract.</p>
  
  <p>Cleint1 is working fine. Client 2 is not working. What all could be potential issues?</p>
  
  <p>App.Config file of both the clients look similar – only the name changes. I think, the problem will be in the client C# code generated – most probably in the <strong>Action</strong> – <strong>ReplyAction</strong>.  What need to be corrected  here?</p>
  
  <p>One noticeable difference is in Action and ReplyAction</p>
  
  <p>Client 1:</p>
  
  <blockquote>
    <p>Action="urn:lijo:demos:multiplyservice:calculation:v1/ICalculationService/GetMultiplied", ReplyAction="urn:lijo:demos:multiplyservice:calculation:v1/ICalculationService/GetMultipliedRe" +
                "sponse"</p>
  </blockquote>
  
  <p>Client 2:</p>
  
  <blockquote>
    <p>Action="urn:lijo:demos:multiplyservice:calculation:v1:getMultipliedIn", ReplyAction="*"</p>
  </blockquote>
  
  <p><strong>Trace Message</strong></p>
  
  <blockquote>
    <p>The message with Action 'urn:lijo:demos:multiplyservice:calculation:v1:getMultipliedIn' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</p>
  </blockquote>
  
  <p><strong>EDIT</strong></p>
  
  <p>This can be corrected by changing the Action and ReplyAction as below (Copied it from Service).</p>
  
  <pre><code>  [System.ServiceModel.OperationContractAttribute(Action = "urn:lijo:demos:multiplyservice:calculation:v1/ICalculationService/getMultiplied", ReplyAction = "urn:lijo:demos:multiplyservice:calculation:v1/ICalculationService/getMultipliedRe" +
          "sponse")]
  </code></pre>
  
  <p>Note: It is important to ensure that the casing in the service is correct (i.e, getMultiplied not GetMultiplied)</p>
  
  <p>Copying from the service is not a good option, though it works. What would be the correct Action and ReplyAction?</p>
  
  <p>Also, Can you please point out how to <strong>modify the wsdl so that the ReplyAction will be correct</strong> in the generated client proxy? That is the essential part to mark it as answered.</p>
  
  <p><a href="http://shishkin.wordpress.com/2007/03/21/wcf-actions-asterisk-and-metadata/" rel="nofollow noreferrer">WCF: Actions, Asterisk and Metadata</a></p>
  
  <blockquote>
    <p>WsdlExporter, which is used for metadata publishing, ignores operations with asterisk actions (both Action and ReplyAction).</p>
  </blockquote>
  
  <p>From <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.replyaction.aspx" rel="nofollow noreferrer">MSDN -ReplyAction Property</a></p>
  
  <blockquote>
    <p>Specifying an asterisk in the service instructs WCF not to add a reply action to the message, which is useful if you are programming against messages directly. </p>
  </blockquote>
  
  <p><strong>REFERENCES</strong>:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/4214815/wcf-metadata-missing-operations">WCF metadata missing operations</a></li>
  </ol>
  
  <hr>
  
  <p><strong>RestaurantData.xsd</strong> </p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;?xml version="1.0" encoding="utf-8" ?&gt;
   &lt;xs:schema id="RestaurantData" targetNamespace="urn:lijo:demos:multiplyservice:data:v1"
      elementFormDefault="qualified" xmlns="urn:lijo:demos:multiplyservice:data:v1"
      xmlns:mstns="urn:lijo:demos:multiplyservice:data:v1" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
    &lt;xs:complexType name="multipliedResult"&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="resultNumber" type="xs:int" /&gt;
     &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
  
    &lt;/xs:schema&gt;
  </code></pre>
  
  <p><strong>Original Contract wsdl</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;definitions xmlns:import0="urn:lijo:demos:multiplyservice:messages:v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:import1="urn:lijo:demos:multiplyservice:data:v1" xmlns:tns="urn:lijo:demos:multiplyservice:calculation:v1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="CalculationService" targetNamespace="urn:lijo:demos:multiplyservice:calculation:v1" xmlns="http://schemas.xmlsoap.org/wsdl/"&gt;
  
   &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /&gt;
   &lt;types&gt;
   &lt;xsd:schema&gt;
    &lt;xsd:import schemaLocation="C:\toolbox\LijosServiceApp\NewService\RestaurantMessages.xsd" namespace="urn:lijo:demos:multiplyservice:messages:v1" /&gt;
    &lt;xsd:import schemaLocation="C:\toolbox\LijosServiceApp\NewService\RestaurantData.xsd" namespace="urn:lijo:demos:multiplyservice:data:v1" /&gt;
  &lt;/xsd:schema&gt;
  &lt;/types&gt;
  &lt;message name="getMultipliedIn"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /&gt;
  &lt;part name="parameters" element="import0:getMultiplied" /&gt;
  &lt;/message&gt;
  &lt;message name="getMultipliedOut"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /&gt;
  &lt;part name="parameters" element="import0:getMultipliedResponse" /&gt;
  &lt;/message&gt;
  &lt;portType name="CalculationServiceInterface"&gt;
  &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /&gt;
  &lt;operation name="getMultiplied"&gt;
    &lt;wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /&gt;
    &lt;input message="tns:getMultipliedIn" /&gt;
    &lt;output message="tns:getMultipliedOut" /&gt;
  &lt;/operation&gt;
  &lt;/portType&gt;
  &lt;binding name="BasicHttpBinding_CalculationServiceInterface" type="tns:CalculationServiceInterface"&gt;
  &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
  &lt;operation name="getMultiplied"&gt;
    &lt;soap:operation soapAction="urn:lijo:demos:multiplyservice:calculation:v1:getMultipliedIn" style="document" /&gt;
    &lt;input&gt;
      &lt;soap:body use="literal" /&gt;
    &lt;/input&gt;
    &lt;output&gt;
      &lt;soap:body use="literal" /&gt;
    &lt;/output&gt;
   &lt;/operation&gt;
   &lt;/binding&gt;
   &lt;service name="CalculationServicePort"&gt;
   &lt;port name="CalculationServicePort" binding="tns:BasicHttpBinding_CalculationServiceInterface"&gt;
    &lt;soap:address location="http://localhost/CalculationService" /&gt;
   &lt;/port&gt;
   &lt;/service&gt;
   &lt;/definitions&gt;
  </code></pre>