wcf-rest

Invoke soap wcf service in Fiddler like in Wcf test client

£可爱£侵袭症+ 提交于 2020-01-15 10:32:27
问题 I have service which should support SOAP and REST. web.config <system.web> <webServices> <protocols> <add name="HttpGet" /> <add name="HttpPost" /> </protocols> </webServices> <httpRuntime executionTimeout="90" maxRequestLength="1048576" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/> <compilation debug="true" targetFramework="4.0"/> and contract [OperationContract] [WebInvoke(UriTemplate = "/GetData")] List<FieldInfo>

WCF REST is not returning a Vary response header when media type is negotiated

烂漫一生 提交于 2020-01-14 12:21:14
问题 I have a simple WCF REST service: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Service1 { [WebGet(UriTemplate = "{id}")] public SampleItem Get(string id) { return new SampleItem() { Id = Int32.Parse(id), StringValue = "Hello" }; } } There is not constrain about the media that the service should return. When I send a request specifying json

WCF REST is not returning a Vary response header when media type is negotiated

十年热恋 提交于 2020-01-14 12:20:01
问题 I have a simple WCF REST service: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Service1 { [WebGet(UriTemplate = "{id}")] public SampleItem Get(string id) { return new SampleItem() { Id = Int32.Parse(id), StringValue = "Hello" }; } } There is not constrain about the media that the service should return. When I send a request specifying json

WCF REST is not returning a Vary response header when media type is negotiated

懵懂的女人 提交于 2020-01-14 12:18:46
问题 I have a simple WCF REST service: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Service1 { [WebGet(UriTemplate = "{id}")] public SampleItem Get(string id) { return new SampleItem() { Id = Int32.Parse(id), StringValue = "Hello" }; } } There is not constrain about the media that the service should return. When I send a request specifying json

Error using jQuery Upload File Plugin, unwanted strings appended to files (WebKitFormBoundary)

喜欢而已 提交于 2020-01-14 03:14:10
问题 I'm using this plug-in : http://hayageek.com/docs/jquery-upload-file.php I'm use it to send files to a WCF Rest Service and save its on hdd. Uploads works fine, but the problem is that images, exe, etc. Uploads broken. If I open uploaded files with a text editor, I can see unwanted strings At begin: ------WebKitFormBoundaryPUTfurckDMbpBxiw Content-Disposition: form-data; name="file"; filename="image.png" Content-Type: image/png At end: ------WebKitFormBoundaryPUTfurckDMbpBxiw-- My service

Error using jQuery Upload File Plugin, unwanted strings appended to files (WebKitFormBoundary)

你离开我真会死。 提交于 2020-01-14 03:14:04
问题 I'm using this plug-in : http://hayageek.com/docs/jquery-upload-file.php I'm use it to send files to a WCF Rest Service and save its on hdd. Uploads works fine, but the problem is that images, exe, etc. Uploads broken. If I open uploaded files with a text editor, I can see unwanted strings At begin: ------WebKitFormBoundaryPUTfurckDMbpBxiw Content-Disposition: form-data; name="file"; filename="image.png" Content-Type: image/png At end: ------WebKitFormBoundaryPUTfurckDMbpBxiw-- My service

WCF and JSON binding

柔情痞子 提交于 2020-01-11 03:24:05
问题 I am trying to create a wcf service that returns json. I have some problems with my config file and i also don't know how to test it. <?xml version="1.0"?> <configuration> <system.web> <compilation debug="false" targetFramework="4.0" /> </system.web> <system.serviceModel> <services> <service name="ContactLibraryJSON.ContactLibrary"> <endpoint address="" binding="webHttpBinding" bindingConfiguration="JSONEndpointBehavior" contract="ContactLibraryJSON.IContactServiceJSON" /> <endpoint address=

WCF REST service 400 Bad Request

做~自己de王妃 提交于 2020-01-06 13:05:25
问题 I have WCF RESTful service and Android client. Server replies with 400 when I do bigger request. It seems that I have 65k limit issue like in here or in other million posts on same problem. However, I can't seem to be able to fix it. Here is how my web.config looks <system.serviceModel> <diagnostics> <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /> </diagnostics> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>

WCF REST service 400 Bad Request

旧时模样 提交于 2020-01-06 13:03:09
问题 I have WCF RESTful service and Android client. Server replies with 400 when I do bigger request. It seems that I have 65k limit issue like in here or in other million posts on same problem. However, I can't seem to be able to fix it. Here is how my web.config looks <system.serviceModel> <diagnostics> <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /> </diagnostics> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>

Customize WCF Rest error responses

£可爱£侵袭症+ 提交于 2020-01-05 09:20:09
问题 I have written a WCF REST API for third-party use. One of the things I want to do is to return custom error responses to clients if anything goes wrong. I don't want the WCF default error page showing that internal server error has occurred or method name not found. To do so I throw WebFaultException<Error> where necessary. This return the following type of response to the client: <Error> <type>MissingTag</type> <Desc>Tag 349 is missing</Desc> </Error> But how can I handle if any other type