.net - Automatically resend a message in WCF -


I am using WCF to talk to a Java web service. This Web service contains a method called Authentication, which returns the session ID. In this case, every request for this web service should be in the SOAP header.

  • Check the response message for this special exception if
  • if anybody's session ends, then apply any method results returning to soap-apoxation
  • if Then call:
  • Re-authenticate to get a new session ID, and resend the original message with the updated session ID
  • I have googled it for no profit, the closest thing I can get She told me that I can complete it on the channel layer, but did not give any examples.

    Note that I want to do this in the proxy class, not the proxy class in the code, thus those who call proxy class do not have to worry about automatic authentication again. I inherited from the auto generated proxy and am doing the WCF configuration program.

    I will try wrapping a "gator" for your WCF client, such as before all calls , The authentication function is called.

      public WCFClient GetServiceInstance () {client.DoAuth (); Return customer; }  

    You can add conditional to this method only call DoAuth () every 1 minute or more.


    Comments