Menu
  • HOME
  • TAGS

WCF Service hosted in a Windows Service - Wrong / Expected Namespace

c#,xml,wcf,serialization,datacontractserializer

I didn't know that because I was using a Windows Service as a host, the XML file was saved to /windows rather than the local directory. The invalid namespace was from an old XML file that still existed in /windows/syswow64.

Android AsyncTask with JSON Parsing error

java,android,json,web-services,wcf

It seems you havn't use your JSONArray object JSONArray mainfoodlist = null; tipshealth = json.getJSONArray(TAG_RESPONSE); // looping through All RESPONSE for (int i = 0; i < tipshealth.length(); i++) { JSONObject jsonobj = tipshealth.getJSONObject(i); tipHealth = jsonobj.getString(KEY_HEALTHTIPS); listhealthtips.add(tipshealth.getJSONObject(i).getString("tips")); } ...

Works with http, doesnt work with https - what's wrong?

c#,wcf,ssl

Please take a look at this article It describes how to create WCF RESTful service using https over SSL Especially, I would pay attention to: <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/> and <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />...

How do I suppress the method name from my xml in a WCF Web Service?

c#,xml,web-services,wcf,soap

You define a [MessageContract(IsWrapped=false)] for the input parameter and a separate one for the output. This will suppress the unwanted root element.

How to consume multipart/form data request in C# mvc 4 webservice

c#,asp.net-mvc,web-services,wcf,asp.net-mvc-4

Check Request.Files variable. foreach (string file in Request.Files) { var postedFile = Request.Files[file]; postedFile.SaveAs(Server.MapPath("~/UploadedFiles") + pelicula.Id); } ...

Conflict when running IIS and WCF application listening on the same port (443)

c#,asp.net,wcf,iis

It seems that it IS possible after all, and I now have it working. Basically, the only reason I wasn't able to share the port between IIS and my WCF service was that I was specifying the 'Host Name' in the IIS bindings. As soon as I removed the host...

Cannot have two operations in the same contract with the same name : Auto Generated Async Method

c#,wcf,nunit,nsubstitute

I wrote the blog post Hosting a Mock as a WCF service which you looked at to create MockServiceHostFactory. Two things: You don't need to call the line to exclude the ServiceContractAttribute from being copied to the mock object, this is handled for you by NSubstitute. There must be some...

ActionNotSupportedException occurred after change EndpointAddress

c#,wcf,silverlight,silverlight-5.0,wcf-binding

that is very easy. you have to generate code exactly same with Web.Config. you must be use the below code: System.ServiceModel.EndpointAddress endpointAddress = new System.ServiceModel.EndpointAddress("net.tcp://YourIpAddress:4502/CTMSEngine/net"); System.ServiceModel.Channels.CustomBinding customBinding = new System.ServiceModel.Channels.CustomBinding(); System.ServiceModel.Channels.BinaryMessageEncodingBindingElement BMEelement = new System.ServiceModel.Channels.BinaryMessageEncodingBindingElement();...

Json response with byte[], how to store as file in C#?

c#,.net,json,wcf,rest

It sounds like the Result is actually a textual representation of the byte array, rather than actually containing an array of bytes. Have you had a look at the raw JSON to see what is in Result? If it's actually textual (either hexadecimal or base64) you will need to simply...

How do I include a CDATA section in a WCF client webservice call in .Net?

c#,.net,web-services,wcf,cdata

Convert the XML into a Base64 string and transmit that instead. A simple re-conversion on the receiving end will give you the proper XML string.

Why do I need to specify an xml namespace when I do serialization?

c#,asp.net,.net,wcf,serialization

By default, the xml namespace for this object will be the CLR namespace of this object Is not great for interoperability with other software. The default is considered a develop-time stub. When you develop a separate Client and Server, only one could rely on this default. It is a...

Dual WCF + Windows Runtime App == Trouble

c#,wcf,windows-runtime

I found what i needed to know here: Windows 8 provides Windows Store apps with the ability to run app code, even when the app is suspended, by using background tasks. Thank you to those that didn't know the answer but where very quick to down vote a fair question....

How to Create Json with array list Android?

android,json,wcf,post,arraylist

You can use Google's Json library called Gson for serialization and deserialization. I am assuming you are using Android Studio, if not you can still import this library to your project. First, add this line to your module's build.gradle file's dependencies: compile 'com.google.code.gson:gson:2.3.1' Then create a class, add your variables...

Running a .asmx Web service as a Windows Service

c#,visual-studio-2010,web-services,wcf,asmx

Just for completeness, here's how I solved this: In the end I went with running IIS on client PCs and just continued using the asmx. I found that converting the asmx to WCF to be quite tricky. To be precise, it was the thread handling within the asmx (thread handling...

No matching contract between WCF Service and QuickBooks Web Connector

c#,web-services,wcf,quickbooks,connector

This answer describes how to connect a WCF Service with the QuickBooks Web Connecter (e. g. authenticate method). I am not totally sure if it is the best implementation, but it works and I would like to help other people with similar problems. Enchantments and additional suggestions are always welcome....

Returning the class which is a foreign key in the database

wcf,linq-to-sql

Looks like only object types (Reservation,Seat) have null values. I'm guessing either you are missing DataContract/DataMember attributes in your complex types or you might need to include KnownTypeAttribute It'd be easier to tell if you could provide some code. EDIT What your are talking about later is deferred loading. See...

The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified

c#,asp.net,wcf

Try using the overload of DuplexChannelFactory(InstanceContext, Binding, EndpointAddress) that takes the binding and endpoint, so the factory will have the required components. Updated code: var binding = new WSDualHttpBinding(); var endpoint = new EndpointAddress("http://192.168.2.131:8089/"); InstanceContext context = new InstanceContext(new Form1()); var cFactory = new DuplexChannelFactory<IPubSubService>(context, binding, endpoint); This will assign...

Only an absolute URI can be used as a base address

c#,asp.net,.net,wcf,contracts

I believe you are missing a colon (:): <add baseAddress="net.tcp//localhost:8090/HelloService"/> should be <add baseAddress="net.tcp://localhost:8090/HelloService"/> ...

Web Service Call for ADFS 2.0 Authentication

asp.net,asp.net-mvc,wcf,forms-authentication,adfs2.0

Most likely the problem is in: string url = "{url of website}";. And/or missing parameters in the POST. It shouldn't be just any URL. It should be a properly formatted WS-Federation request. With timestamps etc. etc. And normally/sometimes (in current ADFS) it is a two step process. First the normal...

WCF JSON missunderstand

android,json,wcf,retrofit

[] means the content is a List. [null] means this is a List containing a null value...

Errors Handling in WCF - how to pass the error to client as well as remain the channel in the “Open” state

wcf,error-handling

a faulted channel can't be closed and can't be used again. a faulted channel must be aborted by calling Abort() Method. also you should not use "IncludeExceptionDetailInFaults = true" Instead, you need to throw FaultExceptions. and it is also recommended that you use the FaultContractAttribute to design your services to...

Update individual instance of Azure Cloud Service

wcf,azure,azure-cloud-services

You have a few options: Why are your cloud services themselves not responsible for refreshing their own data on a schedule? Why do they have to be told to do this from external? Using a scheduled task or timer inside the role instances themselves would be the easiest and most...

Have button in view trigger console application?

c#,asp.net-mvc,wcf

You would just create an object of class program and call the main function on buttons click event. Also you would need to make it public both class and main method.

WCF REST service url routing based on query parameters

c#,web-services,wcf,rest

I ended up catching all CommunicationExceptions and then rethrowing WebFaultExceptions with the appropriate messages and status codes. Here is the code: Message result = null; try { result = _client.ProcessRequest(requestMessage); } catch (CommunicationException ex) { if (ex.InnerException == null || !(ex.InnerException is WebException)) { throw new WebFaultException<string>("An unknown internal Server...

WCF Services In Background

c#,web-services,wcf

TLDR; Here is how I do this, I have a Program class that allows me to start my application either as Windows Service (for production) or as a Console Application (for debugging and easy testing) internal class Program { private static void Main(string[] args) { var appMgr = new ApplicationManager();...

How to test my service?

c#,web-services,wcf

To cover all my initial comments and convert them into one (hopefully) useful answer: I think you built your service having REST in mind, but WCF is SOAP by default and this confuses your clients. There are a lot of articles around the web on how to enable REST in...

This operation is not supported in the WCF client

c#,wcf,wcftestclient,wcf-test-client

First, you should ask yourself if you really need to return a Task as return type, since there are other complications implied. Second (and mainly what you asked), beside using the standard WCFTestClient, you can create a separate application, add a Service Reference to your end point ( https://msdn.microsoft.com/en-us/library/bb628652.aspx )...

creating the wcf service client causes a InvalidOperationException

wcf,wcf-endpoint,wcfserviceclient

The problem was NOT that the creation of the LSKTicketServiceClient was created in a Facade project. But that the Facade project was referenced by the WPF app project and here was the endpoint configuration missing in the app.config....

Using quartz.net, get callback for status from remote WCF service

wcf,quartz-scheduler,wcf-binding,quartz.net

I hope I understand your question, I would suggest going with Idea 1 with some modifications. You could define two jobs with the following flow (a sort of a two-step job): The regular main job fires automatically on schedule. It creates a second job with no trigger (new job id=XYZ)....

WCF Service - Failed to Invoke service - JSON

c#,json,wcf

So I believe I am getting this error because of using the WCF client tool which currently doesn't work with wcf using json. I tried with fiddle and i get something different HTTP/1.1 400 Bad Request.

How to perform test to check whether WCF Response is compressed with httpCompression on IIS7+

wcf,iis-express,http-compression

I used Teleric Fiddler check whether compression is happening or not. I have tried following things to check in which situation compression should work and where not. And fiddler didn't disappoint me. When <urlCompression doDynamicCompression="false" /> it should not compress the dynamic response. When <urlCompression doDynamicCompression="true" />, it should compress...

Where I can find RemotingServices.CreateTransparentProxy implementation?

c#,wcf,clr,transparentproxy

WCF become open sourced the other day. What I found so far is that WCF ServiceChannelProxy now use DispatchProxy.Create<T, TProxy>() instead of RemotingServices.CreateTransparentProxy(). So it looks like if you want actual implementation of method that creates proxy used by WCF, than DispatchProxy and DispatchProxyGenerator are places that you look for....

Is there a way to implement a wcf service connected to a database without paying for azure?

database,wcf,azure,windows-phone-8

Here are some interesting articles about WCF Services in Windows Phone world. How to consume an OData service for Windows Phone 8 Using WCF Service in Windows Phone 8.1 (same in Windows Phone 8) Now you can host the WCF Service in your own server, hosting provider or anything else....

Can I throw a message fault back to a WCF client from a routing service

c#,.net,web-services,wcf,encryption

Using Ricardo's information I was able to narrow down what I was doing. The actual answer to this is entirely up to the Endpoint configuration. It is dependent on your binding. We didn't have to change any thing in the router, but we had to change the client it looks...

System.ServiceModel.FaultException'1' revised

vb.net,wcf,service-model

As I am most definitely not raveet.sodhi does this mean that the xml is actually being successfully passed to the other end but that there is an issue in the service there? Yes, you called the service just fine. It seems the service uses LINQ to SQL and somewhere...

WCF reusing types with inheritance - cannot generate client code

.net,wcf,inheritance,datacontract

I had initially defined my base class as abstract so I first removed that. No luck. I also tried adding various KnownType and ServiceKnownType attributes with no luck. I decided this wasn't making any sense so I tried restarting Visual Studio and then updating the service reference. Voila! It generated...

Using WCF, how to catch OptimisticConcurrencyException and throw FaultException

.net,entity-framework,wcf

This functionality is based on .NET framework. I think there is no one-on-one mapping between .NET and eg.:Java exceptions. However my solution was - for cross platform client - a Result DataContract which contains IsSuccess bool flag and ExceptionMessage string (and your result object too). My service always returned and...

WCF with abstract base class with implemented interfaces does not serialize properly?

wcf

This was a namespace issue. I explicitly add the correct namespace to all parties involved and everything works great. One thing I notice is that the ContractNamespace's ClrNamespace in your AssemblyInfo.cs file should match the AssemblyTitle. Also, putting more than one ContractNamespace in the AssemblyInfo.cs does nothing. For example, I...

WCF singleton service with multiple endpoints?

wcf,serialization,singleton,wcf-endpoint

Yes, a wcf singleton service can have multiple endpoints. The problem was solved by using [ServiceKnownType(typeof(MyService1))] over the method declaration in IMyService interface. Like, [ServiceKnownType(typeof(MyService1))] public void MethodCall(IMyService1 obj); It was a serialization issue....

How to frame AJAX request

jquery,ajax,wcf,rest,restful-url

finally found the answer, the data i'm sending to the service is wrong. 1st change if (value == null) { jsonObj = "null"; } else { jsonObj=value.d; } value.d(or value.data in some case, check using debugger) contains the actual data. 2nd change, Inside the ajax query write: data: JSON.stringify({ status:...

Using Sync Framework in Visual Studio 2013

wcf,visual-studio-2013,microsoft-sync-framework,sql-server-2012-localdb

there's no equivalent for the Local Database Cache project wizard in VS 2013. if you want to do what the wizard does, you can hand code it yourself. but that will be using the older sync providers. you can find a walkthrough of how to achieve this with the newer...

parse push notification in wcf service

.net,wcf,parse.com,push-notification

You need to go into the parse web interface for your app, then to settings, then push notifications, then set the Client push enabled? to on.

How to publish a WCF against a publish settings file?

wcf,azure,visual-studio-2013,publish

This is what you are looking for. This screenshot is from Visual Studio Community 2013. and then... .. then app.config additions for your addresses, bindings, and contracts .. then Azure Endpoint configuration...

Where should I look: WCF Rest - POST Endpoint Not Found

c#,json,wcf,rest,wcf-endpoint

This turned out to be a problem with my service contract. Changing it to seperate ServiceContracts. Moving all OperationContracts inside one service contract corrected the issue, so it looks like so: [ServiceContract] public interface IClass { [WebInvoke(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "/GET/?json={jsonString}", Method = "GET")] string Decode(string...

Could not load type 'Telerik.Windows.Documents.Packaging.DeflaterOutputStream'

c#,wcf,silverlight,telerik

Issue was due to mismatch version of Telerik.Windows.Documents.FormatProviders.Pdf.dll and Telerik.Windows.Documents.

Prism event aggregator Persistent Events

c#,wcf,events,prism,msmq

I posted this question on codeplex forum and got the answer from Bryan Noyes. It is: I'm afraid you are cleanly outside what Prism pub-sub events were designed for. They were designed for loosely coupled components that are all in memory at the same time on the client side but...

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821'

asp.net,wcf,log4net

It seems that one of the projects in your solution or maybe some 3rd party dll has been built with different version of log4net. Either you update references to log4net in all projects (with 3rd party dlls this will not help) or you could add assembly redirection setting to the...

“Application pool 'XXXXXXXXXX' is being automatically disabled due to a series of failures in the process(es) serving that application pool.”

asp.net,wcf,application-pool

This is due to something called "Rapid Fail Protection." When your underlying application crashes a certain number of times in a certain time period, the application pool is automatically disabled. The default settings are 5 crashes in 5 minutes, but you can configure this yourself. See this link for details....

how to add the caller IP to a webget UriTemplate parameters

c#,web-services,wcf,rest

found it! you need to add to your implementation the followings: var clientIp = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty??new RemoteEndpointMessageProperty("",0); ...

Run WCF WebService on IIS ,HTTP Error 404.0 - Not Found

c#,asp.net,web-services,wcf,iis

Per the comments, it appears this was an issue with IIS configuration for WCF. The ServiceModel Registration Tool (ServiceModelReg.exe) tool can be run (or re-run) to resolve this.

web service not returning a serialized list

c#,.net,web-services,wcf

Turns out the problem is the same as the one explained here. In your case, a new instance of the Service class was being instantiated per call, thus, your list was always being reset. To go round this problem, simply add the [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)] attribute to...

How to implement an additional non-wcf service contract interface in a WCF service contract interface implementation

asp.net,asp.net-mvc,wcf,wcf-data-service

Try this code private ILogin _businessLogic {get; set;} public Service() { if (_businessLogic == null) { _businessLogic = new Login(); } } I think it will solve your problem....

How to display WCF HTTP codes in service response

c#,json,entity-framework,wcf,rest

Probably the most simple approach would be to wrap your results into generic response objects [DataContract] public class Response<T> { [DataMember] public T Result { get; set; } [DataMember] public int Status { get; set; } } // then your declaration Response<List<User>> serverResponse = Response<List<User>>(); // on success serverResponse.Result =...

Missing type map configuration or unsupported mapping - AutoMapper

wcf,c#-4.0,automapper

Missing type map configuration or unsupported mapping. Mapping types: Object -> User This is because you are passing a value of type object, creating a mapping from the underlying type User to type User1, then passing in the object as the source, for which no mapping exists (and the actual...

Add Id attribute to soap body element in IClientMessageInspector implementation

c#,.net,wcf,soap

Message.CreateMessage(XmlDictionaryReader, Int32, MessageVersion) solved the problem. Manipulate the xml and then create the new message from the xml.

User request queue in WCF

c#,wcf,message-queue,wcfserviceclient,request-queueing

Finally I did it. Here I am posting my soluton for other users who may be new to the WCF request queuing. At first, we need to implement the throttling settings in WCF host file. Throttling can be done in two ways (Either way is OK): Config file Code Throttling...

Odata Parsing $metadata

wcf,odata

So I figured out a way to do it, you will also need the class from @Vagif's post which you can find here: http://odata.jenspinney.com/2013/02/creating-an-iedmmodel-from-a-metadata-document/ This is a simple funciton to grab out the properties, It could be optimized to cache the tables names etc but this is more for testing...

Testing WCFService1 with Postmen or SoapUI gives 400 Bad Request

.net,wcf,visual-studio-2013,soapui,postman

Case 1 : You are posting form-data instead you should be posting SOAP/XML. Case 2: You are missing SOAP Action header. Case 3 : Request seems ok but you might not have configured WebHttp endpoint. Case 4 : Service URL dont need GetData in it. In order to make...

WCF async during request and garbage collection

c#,wcf

The GC is never going to collect an object that might possibly be accessed by an executable code in the future (at least through any managed reference). That's how it is designed. If there's any possible way for some code to execute that would use the object, then the GC...

ASP.NET Identity 2.0 decrypt Owin cookie

asp.net,asp.net-mvc,wcf,cookies,asp.net-identity

After a lot of research I found a way to do this in a blog. The final algorithm looks like the following: private bool BackOfficeUserAuthorized(string ticket) { ticket = ticket.Replace('-', '+').Replace('_', '/'); var padding = 3 - ((ticket.Length + 3) % 4); if (padding != 0) ticket = ticket +...

WCF Service not Starting Using Browse in IIS

wcf,iis-6

This was because the WCF features were not all enabled on the server.

The remote server returned an unexpected response: (400) Bad Request WCF REST

wcf

One thing that jumps out is the <client> configuration in the client's config, specifically the address attribute. address="http://localhost:56923/TestService.svc?wsdl" First, you said you're using REST, so the WSDL file doesn't play a role in that (it's for SOAP services). Second, the WSDL file is not the service, it's the Web Service...

Hosting a WCF service using net.tcp binding in IIS 7 (unreachable from outside)

c#,.net,wcf,iis,tcp

Ok I finally solved the issue in the middle of the night... I had to turn off the security of the netTcpBinding on both side. But it was not so simple to find out how to turn it off on the server side for a contract requiring duplex communication. Here...

Prism Event Aggregators and WCF Services and Unity

c#,wcf,unity,prism

That won't work. Event aggregators assume long-living objects, objects that first subscribe to events and then live long enough to get notifications. WCF service instances are short-living objects. An instance is activated once the request begins and is deleted once the request completed. The probability that your publisher and subscriber...

WCF channel Factory caching

c#,wcf

This is a complex topic with a lot of details to go over, but here it goes. First, as a general rule you should be caching a ChannelFactory and not an individual Channel. A ChannelFactory is expensive to construct as well as thread-safe so it is a great candidate for...

getting Bad Request in post WCF service consuming

c#,jquery,asp.net,wcf

I found the answer just we need to specify the crossDomainScriptAccessEnabled="false" instead of true thanks , purna...

Using WCF with on-premise ServiceBus

c#,.net,wcf,servicebus

This blog post deals with the issue. You need to set your ServiceBus hostnames in configuration.

What is the difference between SOAP and REST webservices? Can SOAP be RESTful?

c#,web-services,wcf,rest,soap

Introduction I'm posting this as an answer because comments just don't suffice. Here is what I want to summarize for you. First, we'll start with these two references: http://spf13.com/post/soap-vs-rest http://blog.smartbear.com/apis/understanding-soap-and-rest-basics/ Lastly, I want to start this post off by saying the following: SOAP and REST were both designed to solve...

Avoiding same code running twice with parallel calls to WCF

c#,multithreading,entity-framework,wcf

Based on your code, if both threads access at the same time on this condition: if (game.GameState == GameState.ActiveWaitingForMoves && game.Players.Any(x => x.NextMoves == null || x.NextMoves.Count() == 0) == false) Both will try and set the simulation ID, and manipulate the state concurrently, which is bad. game.SimulatorGuid = simulatorGuid;...

Posting to WCF service from AngularJS Content-type issue

javascript,c#,json,angularjs,wcf

I tried the app in chrome and got the following The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed I removed this section from the web.config and it's working now. Angular makes the follow-up POST following the pre-flight OPTIONS call <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*"/> <add...

Error cross domain call using WCF Rest

javascript,c#,jquery,ajax,wcf

In your service contract you might want to put an optional WebGet directive. [WebGet(UriTemplate = "GetData/{value}")] string GetData(int value); Another thing to look for is that you have a json behavior defined for your enpoint in the web.config. <endpointBehaviors> <behavior name="jsonBehavior"> <webHttp defaultOutgoingResponseFormat="Json"/> </behavior> <behavior name="xmlBehavior"> <webHttp defaultOutgoingResponseFormat="Xml"/> </behavior> </endpointBehaviors>...

Hosting ApiControllers on windows service

c#,.net,wcf,rest,service

You can host WCF service in windows service. To do that create a windows service project and refer the the WCF project.Also add System.ServiceModel and System.ServiceModel.Description dlls in in your windows service project then write a function like this private ServiceHost host; private void HostWcfService() { //Create a URI to...

WCF JSON POST request, single string parameter not binding and returning 400

c#,.net,json,wcf,rest

The golden combination was to use double quotes in the JSON code combined with WebMessageBodyStyle.WrappedRequest. Working JSON: string jsonInput = "{\"data\":\"testvalue\"}"; When setting WebMessageBodyStyle to Bare, the following JSON works: string jsonInput = "\"testvalue\""; ...

Get WCF metadata through endpoint address

c#,web-services,wcf,wsdl,wcf-endpoint

It's just a strange question. If you're exposing multiple endpoints for a service then you're basically exposing the same contract across multiple bindings or on more than one physical address. If it's the same contract then logically you would never have to expose more than one mex endpoint because the...

Purpose of WCF to WCF Call?

.net,web-services,wcf

A given WCF service may need to call upon the services of one or more other WCF services in order to get things done. A simple example is that an order processing service may need to use the services of a logging service and an email service....

JSON Date format missunderstanding

java,android,json,wcf

String json = "Date(-62135510400000+0000)"; String timeString = json.substring(json.indexOf("(") + 1, json.indexOf(")")); String[] timeSegments = timeString.split("\\+"); // May have to handle negative timezones int timeZoneOffSet = Integer.valueOf(timeSegments[1]) * 36000; // (("0100" / 100) * 3600 * 1000) long millis = Long.valueOf(timeSegments[0]); Date time = new Date(millis + timeZoneOffSet); System.out.println(time); For Date:...

How to enumerate endpoints urls?

wcf

You can try something like that: private static List<Uri> GetClientsInfo() { var adressList = new List<Uri>(); var clientSection = (ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection); if (clientSection != null) { foreach (ChannelEndpointElement endPoint in clientSection.Endpoints) { adressList.Add(endPoint.Address); } } return adressList; } Also you can use "WebConfigurationManager" instead "ConfigurationManager" (depends of your Application...

EF6 Updating Model loses my Explicit Casts

c#,sql,sql-server,entity-framework,wcf

You should not change generated cs file ever, instead you should create partial classes to add your custom logic into generated classes. Have a look at Why use partial classes?, and similarly search google for more about partial classes in C#, you will get better idea of how to use...

DataContract objects in client - only simple properties are not getting lost from call to call

c#,web-services,wcf,datacontract

Your data contract should be a data contract. Logic like AgeNextYear does not get transfered and no proxy class can use that logic. You could do that if both sides of your WCF conversation were C# and you were using a data contract assembly. Then simply removing the [DataMember] attribute...

The remote server returned an unexpected response: (413) Request Entity Too Large.?

c#,web-services,wcf

Try this, <bindings> <basicHttpBinding> <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"> <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding> </bindings> Instead of these lines in your code, <bindings> <basicHttpBinding> <binding name="SampleBinding"...

WCF WebFaultException details not sent to client

c#,asp.net,.net,wcf,iis

Solved it! Like I suspected, it had nothing to do with my code. In the Arvixe hosting panel I had to enabled "Show detailed ASP.NET errors in browser" (WebSites->Errors->ASP.NET). However, I'm not exactly sure what impact this has on security, since the Web.config hasn't changed and I can't see the...

Simple WCF Service [closed]

c#,asp.net,asp.net-mvc,wcf

I am still confused by your question, but I will attempt an answer. Your Customer class needs to have a DataContract with DataMembers if you want to return it. You probably saw this example: [DataContract] public class CompositeType { bool boolValue = true; string stringValue = "Hello "; [DataMember] public...

WCF service using Json Bad Request

c#,json,wcf

I have replicated your scenario, with a simple wcf service with the configurations you have and a simple test client : WCF [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] void PostBack(String json); Client : string jsonInput = "{\"json\":\"testvalue\"}"; using (var client = new WebClient())...

WCF WebMethod with a blocking call

c#,wcf,async-await

I don't think you need asyncbecause you are not waiting for the result. Your method is CPU bound you can push it to the background with Task.Run if you want to execute it on the thread pool or Task.Factory.StartNew( () => /*..*/, TaskCreationOptions.LongRunning) if you want a dedicated thread. public...

Add Header to WCF RequestSecurityToken Message

c#,wcf,ws-security,wshttpbinding

This has been resolved. Unfortunately, according to the MSDN documentation, a service using WCF transport security cannot go through a router, nor should either, service nor client, be located on the internet (https://msdn.microsoft.com/en-us/library/ff648863.aspx#TransportSecurity). We wanted to violate both 'principles'. So in order to cut down the messages, from five calls...

WebGet with No Parameters or UriTemplate Fails

c#,wcf,rest,webget

So this may not have been obvious until I updated recently, but I have two RESTful services that communicate with each other but live in separate domains. The Web-Layer service is the first point of contact and the App-Layer service is the actual work-doer. This being the case, I was...

Cannot create an instance of the abstract class or interface on WCF Silverlight Service

c#,wcf,silverlight

You should be creating an instance of the generated proxy client class. It'll be named DataServiceClient() if it's been added correctly....

Enable directory browsing in WCF

c#,wcf,app-config,directoryservices

Directory browsing is a feature in IIS. IIS makes it available; when you use WCF self hosting, you don't have all of those options unfortunately. But it's possible to make a folder in your self-hosted folder structure a virtual directory in IIS so that they can get it there instead,...

couldn't copy pdb file to another directory while consuming wcf web service

c#,web-services,wcf,visual-studio-2013

Per your latest comment where you say ConsumeHelper is client project and it consumes WCF service Make sure you are not already running that project. I doubt it's already running and so the pdb file is not able to copy. Else, try running in Release mode instead of Debug mode....

Extracting Kerberos Ticket from WCF method OperationContext

wcf,kerberos,extraction,ticket

foreach(var header in HttpContext.Current.Request.Headers) { string headerVal = HttpContext.Current.Request.Headers[header]; if(headerVal.StartsWith("Negotiate")) { string parts[] = headerValStr.Split(' '); string kerberosStr = parts[1]; //if a header token begins with "YII" its kerberos //otherwise its likely NTLM (or other) if(kerberosStr.StartsWith("YII")) { retVal = Convert.FromBase64String(kerberosStr); break; } } } ...

Not able to create a WCF RestFul Service's client

asp.net,web-services,wcf,rest

I found the answer myself. In my service I had not declared an endpoint for met data exchange due to which when I was trying to add the reference of the service to the client the required app.config was not being generated. Adding the end point for metadata exchange solved...

Using A Service DB Context as WebApi OData Context

c#,wcf,odata,asp.net-web-api2

So apparently Enabling OData Support by just using: config.AddODataQueryFilter(); does work locally but you need to explicitly declare your model if coming from a service. I'm not 100% sure that was the cause of all my problems, I ended up debugging the System.Web.Http.OData and .net 4.5 framework and found the...

Why do we need to publish or deploy web services or WCF?

web-services,wcf

why do we need to publish/deploy a webservices or wcf In order to make it available over internet (or) intranet (make it globally accessible). If you don't publish your service then it is not accessible by others since it can't be found/discovered. Once you publish it, then your service...

Calling WCF with Ajax - 404 Error

jquery,ajax,wcf

Well, it seems that my service was setup correctly. The problem arose when I tried to call it from Ajax. It seems that instead of putting this in the Ajax call: Url = "Search.svc/SearchFiles"; I needed to have this in the Ajax call: url: "http://localhost:57761/Search.svc/SearchFiles" Unless I missed this in...

Adding WCF Services / Project Templates in Visual Studio Pro 2013?

c#,wcf,visual-studio-2013,sharepoint-2010

I see it in my VS 2013 using File -> New -> Website and then choosing WCF like below: ...

Updated Method signature is not working in wcf RESTful services

wcf,rest,methods,overloading,fiddler

Try changing the uri template: [WebInvoke(uriTemplate="/StrDetails?str1={str1}&str2={str2}", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] ...

WCF Streaming Convert Byte[] to Class Object

c#,wcf,serialization,streaming,deserialization

Firstly, don't use an ArrayList to store your bytes. Since ArrayList is non-generic each individual byte will be boxed and a pointer to the byte saved in the array, which will use 5 (32 bit) or 9 (64 bit) times more memory than necessary. Instead, you can copy the Stream...

Same system, same code, different behaviors: The request was aborted: Could not create SSL/TLS secure channel

c#,wcf,ssl,windows-services,windows-applications

I found Windows Service's permission settings in Properties window's Log On tab, changed account from Local System to My User Account (Logged In User) and it works like a charm.

Email Confirmation Error Invalid Token AspNet Identity

c#,asp.net-mvc,wcf,aspnet-identity,confirmation-email

Found the problem. It was the application pools in IIS. I was using different application pool for WCF and MVC application. Now i put it in same application pool and is working fine. Additional Info: For those having same problem and my solution doesn't fix the problem then you might...