wcf-extensions

WCF Message inspector is not working

試著忘記壹切 提交于 2020-01-03 00:42:10
问题 Recently, I was exploring some way to log any requests/responses that my WCF service handles. Before that I have some bad experience with an trace option. Nowadays, I don't know yet how to get actual responses and requests from trace (I tried svctraceviewer tool and it didn't get something meaningful for me). And even that, trace file got generated corrupted (with some unexpectable chars in it). I figured out about message inspectors technology about three or four days ago. I read this manual

Obtaining ClientCredentials from WCF operation

核能气质少年 提交于 2019-12-25 01:44:24
问题 My WCF Service uses a custom credentials validator for custom Message-based security, because I want to ensure each client calling an operation on my web service has a corresponding username and password in my database. Imports System.IdentityModel.Selectors Imports System.IdentityModel.Tokens Public Class CredentialsValidator Inherits UserNamePasswordValidator Public Overrides Sub Validate(ByVal userName As String, ByVal password As String) Dim authenticationApi As New AuthenticationGateway(

How to add behavior to client endpoint in IIS Hosted WCF Service using ServiceHostFactory

夙愿已清 提交于 2019-12-11 04:08:22
问题 I am looking at implementing IDispatchMessageInpector & IClientMessageInpector to look at the message objects in AfterReceiveRequest and BeforeSendRequest Methods. My requirement is to make changes at code level of WCF service. No Configuration Changes. How to attach this behaviour to all the endpoints which are calling this service and to service itself. Is implementing IContractBehaviour helps me? Edit 1: WCF Service is hosted on IIS. Is it possible to add the behavior thru code? Edit 2:

IIS 500 Error WCF Service and Failed Request Tracing not info

久未见 提交于 2019-12-08 03:30:56
问题 I have a WCF service running in IIS 8.5 on Windows Server 2012 R2 with AppPool Integrated. I open url in the server: http://localhost:50123/MyService.svc I have HTTP 500 Internal Server Error . (IExplorer cannot show the page) I have not found the problem in Event logs, IIS Logs. I apply this steps: https://peter.hahndorf.eu/blog/iislogging.html Disable IE “Friendly HTTP error messages” <customErrors mode=”Off” /> <httpErrors errorMode="Detailed" /> <serviceMetadata httpGetEnabled="true"/>

WCF: provide generic FaultException in IErrorHandler

北城余情 提交于 2019-12-04 21:54:33
问题 Some context: We have a custom XSD and generate the WSDL and C# code using WSCF.blue. The client side uses ChannelFactory<T> and shares the interface which includes all the attributes added by WSCF.blue to match what is in the XSD. I'm trying to implement IErrorHandler.ProvideFault where it provides a generic FaultException<T> , but on the client side I'm getting back a non-generic FaultContract . This is what my ProvideFault method looks like: public void ProvideFault(Exception error,

WCF: provide generic FaultException in IErrorHandler

你说的曾经没有我的故事 提交于 2019-12-03 13:32:08
Some context: We have a custom XSD and generate the WSDL and C# code using WSCF.blue. The client side uses ChannelFactory<T> and shares the interface which includes all the attributes added by WSCF.blue to match what is in the XSD. I'm trying to implement IErrorHandler.ProvideFault where it provides a generic FaultException<T> , but on the client side I'm getting back a non-generic FaultContract . This is what my ProvideFault method looks like: public void ProvideFault(Exception error, MessageVersion version, ref Message fault) { if (!(error is FaultException)) { FaultException faultException

The type [nameHere] registered for extension '[extensionHere]' could not be loaded

醉酒当歌 提交于 2019-12-03 09:21:24
问题 I've been learning and building JSONP Web services using WCF on fx3.5. You can read some of the trials I had at .NET ASMX - Returning Pure JSON? I finally got a sample running but now I am I am dove tailing it into my app. RivWorks.Web - the web site - located at http://dev.example.com RivWorks.Web.Service - the new JSONP services - located in http://dev.example.com/services/ - the web.config for the services reside here. The web.config for the service: <system.serviceModel> <behaviors>

The type [nameHere] registered for extension '[extensionHere]' could not be loaded

半世苍凉 提交于 2019-12-02 23:32:13
I've been learning and building JSONP Web services using WCF on fx3.5. You can read some of the trials I had at .NET ASMX - Returning Pure JSON? I finally got a sample running but now I am I am dove tailing it into my app. RivWorks.Web - the web site - located at http://dev.example.com RivWorks.Web.Service - the new JSONP services - located in http://dev.example.com/services/ - the web.config for the services reside here. The web.config for the service: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="JsonpServiceBehavior"> <webHttp /> </behavior> </endpointBehaviors> <

The element 'behavior' has invalid child element 'myFaultExtension' in wcf app.config

你说的曾经没有我的故事 提交于 2019-11-28 01:09:10
I'm trying to catch regular exceptions from a WCF service in a Silverlight client application. For that I've included the respective changes in my WCF service as given in this MSDN article . But when I configure the behavior extension and use the same in endpoint behavior, the error mentioned above is coming up, and the service is not able to run due to this error. I am putting here my configuration. Kindly suggest how can I solve this? <extensions> <!--Add a behavior extension within the service model--> <!-- Here SilverlightFaultBehavior is a class in AppServiceLib namespace -->

Why isn't my custom WCF behavior extension element type being found?

99封情书 提交于 2019-11-27 18:42:06
I have a solution that contains two projects. One project is an ASP.NET Web Application Project, and one is a class library. The web application has a project reference to the class library. Neither of these is strongly-named. In the class library, which I'll call "Framework," I have an endpoint behavior (an IEndpointBehavior implementation) and a configuration element (a class derived from BehaviorExtensionsElement). The configuration element is so I can attach the endpoint behavior to a service via configuration. In the web application, I have an AJAX-enabled WCF service. In web.config, I