webservicehost

Is it possible to instantiate a WebServiceHost via an instance of the service type, without a parameterless constructor?

落花浮王杯 提交于 2019-12-22 18:36:18
问题 I am trying to create self-hosted System.ServiceModel.Web.WebServiceHost (.NET 4), however I am running into an issue with the constructor. There are three options: WebServiceHost() a parameterless constructor that seems pointless, as there's no way to specify the type of the service, or even the contract. Reflecting on it, it doesn't do anything- just an empty default constructor that doesn't call base. WebServiceHost(object singletonInstance, params Uri[] baseAddresses) I don't want a

How to override WebServiceHostFactory MaxReceivedMessageSize?

杀马特。学长 韩版系。学妹 提交于 2019-12-21 11:25:22
问题 There are a lot of similar questions out there, but I have tried every solution in every one of them to no avail. We have a web service that initialises with WebServiceHostFactory, but if any more than 64k is thrown at it, we get a '400 Bad Request'. Normally, this would just be resolved by bumping up the MaxReceivedMessageSize, MaxBufferSize and MaxBufferPoolSize. The problem is that using the WebServiceHostFactory, the Web.Config is completely ignored. No changes I make in the ServiceModel

Is it possible to instantiate a WebServiceHost via an instance of the service type, without a parameterless constructor?

雨燕双飞 提交于 2019-12-06 12:55:56
I am trying to create self-hosted System.ServiceModel.Web.WebServiceHost (.NET 4), however I am running into an issue with the constructor. There are three options: WebServiceHost() a parameterless constructor that seems pointless, as there's no way to specify the type of the service, or even the contract. Reflecting on it, it doesn't do anything- just an empty default constructor that doesn't call base. WebServiceHost(object singletonInstance, params Uri[] baseAddresses) I don't want a singleton instance, as this is a InstanceContextMode.PerCall class. WebServiceHost(System.Type serviceType,

How to override WebServiceHostFactory MaxReceivedMessageSize?

时光怂恿深爱的人放手 提交于 2019-12-04 04:52:50
There are a lot of similar questions out there, but I have tried every solution in every one of them to no avail. We have a web service that initialises with WebServiceHostFactory, but if any more than 64k is thrown at it, we get a '400 Bad Request'. Normally, this would just be resolved by bumping up the MaxReceivedMessageSize, MaxBufferSize and MaxBufferPoolSize. The problem is that using the WebServiceHostFactory, the Web.Config is completely ignored. No changes I make in the ServiceModel section reflect in the service at all. It would be nice to just completely ditch WebServiceHostFactory

How to implement WebServiceHost Authentication?

亡梦爱人 提交于 2019-11-28 11:23:48
问题 I'm aware that the authentication on the webservicehost class does not adhere fully to authentication standards (returns 403 forbidden rather than prompting for another set of credentials when the user enters incorrect credentials). I'd still like to implement this basic authentication (username and password at the start of the session, HTTPS unnecessary - see picture below) as it suits my needs for a small home project. The code I have for myService is as follows: Imports System.IO Imports

Getting a POST endpoint to work in self-hosted (WebServiceHost) C# webservice?

左心房为你撑大大i 提交于 2019-11-27 05:23:15
So, I have been messing around with webservices for a while now, and I keep getting back to some basics, that I never seem to get right. Question 1: When using a WebServiceHost in .NET/C#, you can define a method/endpoint as using GET/POST/etc. Setting up a GET-method is easy and it works pretty much directly, and its easy to understand how it works. For example: [OperationContract] [WebInvoke(Method = "GET", UriTemplate = "/PutMessage/{jsonString}", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] string PutMessage(string

Getting a POST endpoint to work in self-hosted (WebServiceHost) C# webservice?

那年仲夏 提交于 2019-11-26 17:34:29
问题 So, I have been messing around with webservices for a while now, and I keep getting back to some basics, that I never seem to get right. Question 1: When using a WebServiceHost in .NET/C#, you can define a method/endpoint as using GET/POST/etc. Setting up a GET-method is easy and it works pretty much directly, and its easy to understand how it works. For example: [OperationContract] [WebInvoke(Method = "GET", UriTemplate = "/PutMessage/{jsonString}", BodyStyle = WebMessageBodyStyle.Bare,