wcf - Intermittent System.ServiceModel.Security.MessageSecurityException -
i have webservice hosted in azure throwing intermittent message security exceptions. have retries retries have never succeeded though proxy regenerated on every retry. know or pointers on how real exception out?
exception: "exceptionmessage": "an unsecured or incorrectly secured fault received other party. see inner faultexception fault code , detail.", "exceptiontype": "system.servicemodel.security.messagesecurityexception", "innerexceptiontree": "{\"innerexceptions\":[{\"innerexceptions\":null,\"message\":\"the message not processed. because action 'http:\/\/schemas.xmlsoap.org\/ws\/2005\/02\/trust\/rst\/sct\/cancel' incorrect or because message contains invalid or expired security context token or because there mismatch between bindings. security context token invalid if service aborted channel due inactivity. prevent service aborting idle sessions prematurely increase receive timeout on service endpoint's binding.\",\"stacktrace\":null,\"type\":\"system.servicemodel.faultexception\"}],\"message\":\"an unsecured or incorrectly secured fault received other party. see inner faultexception fault code , detail.\",\"stacktrace\":\"\u000d\u000aserver stack trace: \u000d\u000a @ system.servicemodel.security.securitysessionclientsettings"1.clientsecuritysessionchannel.processrequestcontext(requestcontext requestcontext, timespan timeout, securityprotocolcorrelationstate correlationstate)\u000d\u000a @ system.servicemodel.security.securitysessionclientsettings"1.clientsecuritysessionchannel.receiveinternal(timespan timeout, securityprotocolcorrelationstate correlationstate)\u000d\u000a @ system.servicemodel.security.securitysessionclientsettings"1.securityrequestsessionchannel.closeoutputsession(timespan timeout)\u000d\u000a @ system.servicemodel.security.securitysessionclientsettings"1.clientsecuritysessionchannel.closesession(timespan timeout, boolean& wasaborted)\u000d\u000a @ system.servicemodel.security.securitysessionclientsettings"1.clientsecuritysessionchannel.onclose(timespan timeout)\u000d\u000a @ system.servicemodel.channels.communicationobject.close(timespan timeout)\u000d\u000a @ system.servicemodel.channels.servicechannel.onclose(timespan timeout)\u000d\u000a @ system.servicemodel.channels.communicationobject.close(timespan timeout)\u000d\u000a\u000d\u000aexception rethrown @ [0]: \u000d\u000a @ system.runtime.remoting.proxies.realproxy.handlereturnmessage(imessage reqmsg, imessage retmsg)\u000d\u000a @ system.runtime.remoting.proxies.realproxy.privateinvoke(messagedata& msgdata, int32 type)\u000d\u000a @ system.servicemodel.icommunicationobject.close(timespan timeout)\u000d\u000a @ system.servicemodel.clientbase"1.system.servicemodel.icommunicationobject.close(timespan timeout)\u000d\u000a @ system.servicemodel.clientbase"1.close()\u000d\u000a @ system.servicemodel.clientbase"1.system.idisposable.dispose()\u000d\u000a
server's web.config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.diagnostics> <trace> <listeners> <add type="microsoft.windowsazure.diagnostics.diagnosticmonitortracelistener, microsoft.windowsazure.diagnostics, version=2.4.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" name="azurediagnostics"> <filter type="" /> </add> </listeners> </trace> </system.diagnostics> <system.web> <compilation debug="true" targetframework="4.5" /> <authentication mode="windows" /> </system.web> <system.servicemodel> <bindings> <wshttpbinding> <binding name="binding" maxreceivedmessagesize="5000000" opentimeout="00:20:00" closetimeout="00:20:00" sendtimeout="00:20:00" receivetimeout="01:00:00"> <readerquotas maxstringcontentlength="5000000" maxarraylength="5000000" /> <security mode="transportwithmessagecredential"> <message clientcredentialtype="certificate" negotiateservicecredential="true"/> </security> </binding> </wshttpbinding> </bindings> <services> <service behaviorconfiguration="behavior" name="name"> <endpoint address="" binding="wshttpbinding" bindingconfiguration="binding" contract="contract" /> </service> </services> <behaviors> <servicebehaviors> <behavior name="behavior"> <servicecredentials> <servicecertificate findvalue="15e957fe4732d15b8a88fe524b4cbf0b2f01b18e" storelocation="localmachine" storename="my" x509findtype="findbythumbprint"/> <clientcertificate> <authentication certificatevalidationmode="custom" customcertificatevalidatortype="customcertificatevalidatortype, eventing.core"/> </clientcertificate> </servicecredentials> <servicemetadata httpsgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" /> <servicethrottling maxconcurrentcalls="500" maxconcurrentinstances ="500" maxconcurrentsessions ="500"/> </behavior> </servicebehaviors> </behaviors> </system.servicemodel> <system.webserver> <modules runallmanagedmodulesforallrequests="true" /> <!-- browse web app root directory during debugging, set value below true. set false before deployment avoid disclosing web app folder information. --> <directorybrowse enabled="false" /> </system.webserver> </configuration>
client app.config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5" /> </startup> <system.net> <connectionmanagement> <add maxconnection = "500" address ="*" /> </connectionmanagement> </system.net> <system.servicemodel> <bindings> <wshttpbinding> <binding name="wshttpbinding_ifoo" closetimeout="00:20:00" opentimeout="00:20:00" receivetimeout="00:20:00" sendtimeout="00:20:00" maxbufferpoolsize="5000000" maxreceivedmessagesize="5000000"> <readerquotas maxdepth="32" maxstringcontentlength="5000000" maxarraylength="5000000" maxbytesperread="5000000" maxnametablecharcount="5000000" /> <security mode="transportwithmessagecredential"> <transport clientcredentialtype="none" /> <message clientcredentialtype="certificate" /> </security> </binding> </wshttpbinding> </bindings> <client> <endpoint address="https://foo.cloudapp.net/bar.svc" behaviorconfiguration="servicebehavior" binding="wshttpbinding" bindingconfiguration="wshttpbinding_foo" contract="xyz.iabc" name="wshttpbinding_ifoo" /> </client> <behaviors> <endpointbehaviors> <behavior name="servicebehavior"> <clientcredentials> <clientcertificate storename="my" storelocation="localmachine" x509findtype="findbythumbprint" findvalue="e1aa390214b6c7c0ec2b71624cafb0b5ffdccefd" /> </clientcredentials> </behavior> </endpointbehaviors> </behaviors> </system.servicemodel> </configuration>
i have replaced confidential information foo/bar.
Comments
Post a Comment