views:

3006

answers:

5

hey guys, a WCF question for you here:

i have two services and am sending pretty chunky messages between them (~100kb). Though the previously mentioned value is typical of the size of the message, it is possible for it to fluctuate greatly (in both positive and negative directions).

Thus, to deal with such situations where i have to transport a swollen message i have cranked up all the max message size, max string size etc attributes in the app.config on both client and server end (with the relevant endpoint correctly referencing the binding which states the sizes)

The bound i have put in completely exceeds any possible message size for safety's sake. However, where the inter-service communication has proved reliable at the lower end of the message size scale, at the higher end this is not so - messages do not seem to be delivered at all.

the strangest thing is that if the message had exceeded max size then an exception would be thrown (i've encountered enough of these to know this! lol), but nothing gets thrown - it all passes by completely silently. I have experimented with various sizes of messages and it definitely only begins to happen as the message size grows. I can prove are not being received by the destination service as, upon reception, the service makes a log in a DB - but with big messages, no log is made.

as i said, i am almost certain i have increased the size of all applicable attributes in the app.config, and so am completely and utterly baffled by this behaviour!

any suggestions on what could be causing such mystifying behaviour? any help would be much appreciated as this is the final hurdle in my project! thanks :-)

A: 

webdtc, i haven't checked the iis logs as the services are running on a named pipe. i guess i could use my http endpoint to test it, though the services are destined to eventually end up on a named pipe.

A: 

There are ocassional problems with WCF that will cause it to fail "silently" (i.e. no exception) which can be hard to debug. Sounds like this might be the case you're seeing.

In this case, enabling the tracing options in WCF can be extremely helpful, as it should allow you to see if the message is indeed reaching the service and how the dispatcher is dealing with it.

tomasr
A: 

enable tracing like tomasr said, and post your binding. we send messages over 10 MB using nettcpbinding and we have no problems.

Tina Endresen
+1  A: 

well this problem seems to have resolved itself (suddenly after never complaining before, WCF started getting upset about a certain value in the app.config, changed that and it seemed to work then!)

however now i have an equally strange problem! for somre reason it refuses to accept that i have configured metadata to be published. my app.config (host side) set up is as follows:

<services>
  <service name="DataFeederService.FeederService" behaviorConfiguration="DataFeederService.FeederServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8010/Feeder"/&gt;
        <add baseAddress="net.pipe://localhost/FeederPipe"/>
      </baseAddresses>
    </host>
    <!-- Service Endpoints -->
    <!-- Unless fully qualified, address is relative to base address supplied above -->
    <endpoint name="namedPipeEndpoint" 
    address=""  
    bindingConfiguration="IPCWindowsSecurity" 
    binding="netNamedPipeBinding" 
    contract="DataFeederService.IFeederService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>

    <endpoint name="httpEndpoint" 
    address="FeederService" 
    binding="wsHttpBinding" 
    bindingConfiguration="httpBinding" 
    contract="DataFeederService.IWebFeederService"/>

    <!-- Metadata Endpoints -->
    <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
    <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>

<bindings>
  <netNamedPipeBinding>
    <binding name="IPCWindowsSecurity" 
    maxBufferPoolSize="965536" 
    maxBufferSize="965536" 
    maxReceivedMessageSize="965536">
      <readerQuotas maxStringContentLength="965536" />
      <security mode="Transport">
        <transport protectionLevel="EncryptAndSign" />
      </security>
    </binding>
  </netNamedPipeBinding>
  <wsHttpBinding>
    <binding name="httpBinding" 
    maxBufferPoolSize="965536"
    maxReceivedMessageSize="965536">
      <readerQuotas maxStringContentLength="965536" />
    </binding>
  </wsHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="DataFeederService.FeederServiceBehavior">
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="True" policyVersion="Policy15"/>
      <!-- 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" httpHelpPageEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

I have tried my best to work out why it would be claiming the metadata isn't being published at the specified address "http://localhost:8010/Feeder/mex". any help would be greatly appreciated.

Cheers!

+1  A: 

sorry guys, after further trawling i discovered the source of the error! one of the classes in the datacontract had been changed (the [DataContract] attribute had been removed, but strangely [DataMemeber] had been left on the relevant properties! very odd!)

thanks for all your help anyways, especially rfor getting me to this point, where i can finally wash my hands of this damn project :-)