webhttpbinding

Sharing the same port for WCF REST and ASP.NET Web API

僤鯓⒐⒋嵵緔 提交于 2019-12-05 01:48:54
问题 I've an existing JSON based service implemented using WCF webhttpbinding. This service is hosted in Windows service. We've implemented SSL as well. Now I'm planning to create new JSON based services using ASP.NET Web API which should be hosted in windows service. But the problem is the clients are behind firewalls and they cannot expose many ports to world and so I've to reuse the already opened port . I'm aware this is not possible straight. But is there any workaround we could use the same

WCF Error on execute: Manual addressing is enabled on this factory, so all messages sent must be pre-addressed

☆樱花仙子☆ 提交于 2019-12-04 14:31:39
I have a WCF service hosted with WebHttpBinding. The service is very simple, an operation contract which accept multiple parameters. My WCF client, auto generated after using the "Add Service Reference", is not able to directly consume the WCF service. The error only occur for WebHttpBinding but not the others. Server Side [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "Submit2String", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped)] string Submit2String(string input1, string input2); Client Side

WebHttpBinding with Http and Https

不问归期 提交于 2019-12-04 00:37:38
I am trying to use https & http for the website. The website has .svc files which act as REST service and called from JavaScript. My Config: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="AjaxBehavior"> <webHttp /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="MyServiceBehaviour"> <serviceDebug includeExceptionDetailInFaults="true" /> <serviceMetadata httpGetEnabled="True" httpsGetEnabled="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> <services> <service behaviorConfiguration=

HttpClient with BaseAddress

冷暖自知 提交于 2019-11-30 07:49:26
问题 I have a problem calling a webHttpBinding WCF end point using HttpClient and the BaseAddress property. HttpClient I created a HttpClient instance specifying the BaseAddress property as a local host endpoint. GetAsync Call I then call the GetAsync method passing in the additional Uri inforamtion. HttpResponseMessage response = await client.GetAsync(string.Format("/Layouts/{0}", machineInformation.LocalMachineName())); Service endpoint [OperationContract] [WebGet(UriTemplate = "/Layouts/

HttpClient with BaseAddress

自闭症网瘾萝莉.ら 提交于 2019-11-29 05:30:39
I have a problem calling a webHttpBinding WCF end point using HttpClient and the BaseAddress property. HttpClient I created a HttpClient instance specifying the BaseAddress property as a local host endpoint. GetAsync Call I then call the GetAsync method passing in the additional Uri inforamtion. HttpResponseMessage response = await client.GetAsync(string.Format("/Layouts/{0}", machineInformation.LocalMachineName())); Service endpoint [OperationContract] [WebGet(UriTemplate = "/Layouts/{machineAssetName}", ResponseFormat = WebMessageFormat.Json)] List<LayoutsDto> GetLayouts(string

WCF REST Service not visible in WCFTestClient

梦想的初衷 提交于 2019-11-29 03:24:23
I have successfully configured 3 endpoints for my prototype service. The endpoints are basicHttpBinding, wsHttpBinding, and webHttpBinding. The only glitch I have at the moment is in the WCFTestClient. When I point it to my service it lists the first two, but not the webHttpBinding. I can test the REST endpoint through my browser and it works just fine. Here's my config: <system.serviceModel> <services> <service behaviorConfiguration="serviceBehaviour" name="VMDServices.VMDService"> <endpoint binding="webHttpBinding" address="rest" behaviorConfiguration="webBehaviour" contract="VMDServices

Unable to set maxReceivedMessageSize through web.config

孤街浪徒 提交于 2019-11-28 08:43:13
I have now investigated the 400 - BadRequest code for the last two hours. A lot of sugestions goes towards ensuring the bindingConfiguration attribute is set correctly, and in my case, it is. Now, I need YOUR help before destroying the building i am in :-) I run a WCF RestFull service (very lightweight, using this resource for inspiration: http://msdn.microsoft.com/en-us/magazine/dd315413.aspx ) which (for now) accepts an XmlElement (POX) provided through the POST verb. I am currently ONLY using Fiddler's request builder before implementing a true client (as this is mixed environments). When I

WCF REST Service not visible in WCFTestClient

好久不见. 提交于 2019-11-27 22:07:57
问题 I have successfully configured 3 endpoints for my prototype service. The endpoints are basicHttpBinding, wsHttpBinding, and webHttpBinding. The only glitch I have at the moment is in the WCFTestClient. When I point it to my service it lists the first two, but not the webHttpBinding. I can test the REST endpoint through my browser and it works just fine. Here's my config: <system.serviceModel> <services> <service behaviorConfiguration="serviceBehaviour" name="VMDServices.VMDService"> <endpoint

WCF service returns incorrect Content-Length when using gzip encoding

♀尐吖头ヾ 提交于 2019-11-27 06:13:53
问题 I have a web page containing a filtering text box and a list box. Modifications to the text box trigger an AJAX request, which returns an array of values with which to populate the list box. I had problems with these calls failing sometimes, dependent on the size of the data returned. Small-sized returned data would result in an error, large-size data was returned and processed succesfully. This problem only happens when I use a jQuery version greater than 4.2. If I use jQuery version 4.2, I

Unable to set maxReceivedMessageSize through web.config

纵饮孤独 提交于 2019-11-27 02:23:01
问题 I have now investigated the 400 - BadRequest code for the last two hours. A lot of sugestions goes towards ensuring the bindingConfiguration attribute is set correctly, and in my case, it is. Now, I need YOUR help before destroying the building i am in :-) I run a WCF RestFull service (very lightweight, using this resource for inspiration: http://msdn.microsoft.com/en-us/magazine/dd315413.aspx) which (for now) accepts an XmlElement (POX) provided through the POST verb. I am currently ONLY