RE: MessageSecurityException when consuming WCF service



Hi Daniel,

From your description, you're encountering the following error when running
a WCF based client server communication application, correct?

=========
The message could not be processed. This is most likely because the action
'http://tempuri.org/IBCC2MatrixService/UserMatchingSearch' is incorrect or
because the message contains an invalid or expired security context token
or
because there is a mismatch between bindings. The security context token
would be invalid if the service aborted the channel due to inactivity. To
prevent the service from aborting idle sessions prematurely increase the
Receive timeout on the service endpoint's binding.
=========

Regarding on the error info, I've performed some research and found some
cases with similar symptom. I'd like to confirm some things about your WCF
client, server applications:

** What's the type of endpoint binding type are you using and are you using
Message layer security to secure the service communiaton?

** For the client-side, are you using the autogenerated proxy class?

According to those former issue with the similar error message, the problem
is likely caused by the securitycontextToken be expired (client send to
server). When you use message layer security, the generated proxy will use
established security context token to communicate with server. However,
when the server close the connection (for some reason), the client is not
going to know the service connection timed out until it actually tries to
contact the service...which raises the exception.

If the problem in your case does be due to the above reason, you can
consider the following resolutions:


The best solution is to catch the exception and then abort the proxy and
recreate it.

Or you can also disable message layer security and use transport layer
security.
<<<<<<<<<<<<<<<

Hope this helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • NFS problems with through 2.5.x to 2.6.0-test9
    ... When the server is running the ... kernel, as a client the 2.6 series seem to work perfectly, excluding ... Interesting problem arose when I attempted switch the server's kernel to ... with and without nfsv4 support compiled in (was considering testing it at ...
    (Linux-Kernel)
  • Re: FileCopy vs. Read & Write or CopyFile API
    ... client is copying the file in 5 or 10 seconds is to big. ... Dim errNum as Integer ... synchronize a document in server to its client with VB FileCopy function. ... Microsoft Online Community Support ...
    (microsoft.public.vb.general.discussion)
  • Re: FileCopy vs. Read & Write or CopyFile API
    ... client is copying the file in 5 or 10 seconds is to big. ... Dim errNum as Integer ... synchronize a document in server to its client with VB FileCopy function. ... Microsoft Online Community Support ...
    (microsoft.public.vb.general.discussion)
  • RE: HP officejet 5610
    ... As far as I know none support ... Microsoft MVP - Terminal Server ... Virtual Client Solutions ... printers, assuming the client is Vista SP1 or XP SP3 with RDP Client 6.1. ...
    (microsoft.public.windows.terminal_services)
  • Re: Have you had good results with Trend Micro support?
    ... I spoke with a supervisor for tech support on Thursday regarding this issue. ... Trend Micro Client Server Messaging Security from version 2.0 to 3.6 on ... One of the clients also has a Server 2003 file server and the pattern ... I tried uninstalling the TM Client, ...
    (microsoft.public.windows.server.sbs)