1
votes

I have a WCF Service with a method decorated with [OperationContract(IsOneWay=true)].

[ServiceContract]
public interface IService
{
    [OperationContract(IsOneWay=true)]
    void DoThis(DateTime value);
} 

When I call this method, no exception was raised. However, nothing inside the WCF method was executed such as database operations (insert, update, ...)

What am I missing?

My WCF Configuration

<system.serviceModel>
    <bindings>
          <basicHttpBinding>
              <binding closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
                 maxBufferSize="50000000" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000">
                  <readerQuotas maxDepth="500000000" maxStringContentLength="500000000" maxArrayLength="500000000"
                        maxBytesPerRead="500000000" maxNameTableCharCount="500000000" />
              </binding>
          </basicHttpBinding>
      </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
      <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="6553600"/>
      <serviceThrottling maxConcurrentCalls="500" maxConcurrentInstances="500" maxConcurrentSessions="500"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

How I call my service:

MyService proxy = new MyService();
proxy.DoThis(DateTime.Now);

Other WCF methods work as expected, just without the [OperationContract(IsOneWay=true)].

Thanks in advance.

1
The interface definition is correct, so we need configuration and implementation details to help you. - Espen Burud
Thank you, I've just updated the question. - madatanic
Sounds dumb, but does the method get called if you set IsOneway=false? You only said that other methods work as expected. - Clemens
Are you sure the code in the implemented method executes? (Probably a silly question, but sometimes it the simple things...) - Tim
turn on WCF tracing on the service and see if the call is failing somehow. Oneway messaging will not show a failure to the caller - Richard Blewett

1 Answers

0
votes

I have found the issue by turning on tracing. Since it's a one way call, no exception or response is recognized by the client.

Thank you all of you.