wcf

WCF Client having problems recognizing ServiceKnownTypes?

How would I tell the WCF service what KnownTypes to use when passing data back to the client? I know I can use the [ServiceKnownType] attribute, which makes the service call run fine from a WCF Test Server, however it still fails from the client. Am I missing something here? [OperationContract] [ServiceKnownType(typeof(SubClassA))] [Se...

WCF Serialization problems with WSDL file created by Java tools

Hi all, My team is tasked with getting several in-house developed .NET client applications to connect to some new Java web services. The Java web service is a third party, vendor supplied WSDL file that our team has a limited ability to modify/control...meaning we probably have the power to request our vendor to make slight tweaks to th...

Silver and WCF Service Behind Firewall

I have a Silverlight 4.0 (ASP.Net 4.0) application on our website for our customers once they authenticate. The program loads fine but can't talk to the WCF service created. Internally everything works great. The Silverlight application is hosted on IIS 7.5 with an internal IP of 10.1.1.8 with teh firewall redirecting the real world app...

Mocking Asynchronous Calls in Silverlight WCF Proxy using Moq

I have a typical Silverlight application with a WCF service and I am using slsvcutil.exe to generate the standard client proxy to communicate with the web service. I am trying to write unit tests and I'm attempting to use the Silverlight Unit Testing framework and Moq to mock the proxy and remove the service dependency for testing. I am...

Reading username and password sent from and Android app into my WCF REST Service?

My current WCF REST Method is defined as: [OperationContract] [WebGet(UriTemplate = "{username}/{password}", ResponseFormat = WebMessageFormat.Json)] string Login(string username, string password); An android client app is going to connect to the service, let's...

Is it better to specify a relative address in an endpoint or in a UriTemplate?

Is it better practice to specify a relative address in an endpoint for example <endpoint address="json" ... /> or in the UriTemplates: [WebGet(UriTemplate="json/....")] What is better practice here? Does it matter? I know if I decide to change json to js later, I would have to change it in all the UriTemplates, but only one time ...

Do WCF Services have to have a MetaDataExchange endpoint for each service or can I have just one?

If my WCF Configuration file has two services, lets says LoginService and RegistrationService, do they both have to have their own MetaDataExchange endpoint or can I just have one MetaDataExchange endpoint and keep it outside the service element: <services> <service name="a"> <endpoint binding="mexHttpBinding" /> </service> <service nam...

Setup MSI Project for WCF Web Service

I'm working with a co-worker on this, will try on my own machine shortly, but wanted to get the question posted quickly. I've also been Googling for step-by-step "how to setup for WCF service" and not finding anything on target. I've done it before at a prior company, but forgetting the details now. Are .SVC files automatically inclu...

Setup Project for WCF - how to add "Select Installation Address"

We have an MSI created by a programmer that left. It has a "Installation Address" dialog box. When I create a new default setup project, I have an "Installation Folder" dialog box. The "Install Address" dialog at install time says "Select Installation Address" and allows the person doing the install to select the application pool. ...

WCF Connections exceeding max connections when using Asynchronous pattern

I have a simple WCF service that i'm communicating with Asynchronously. The thing i don't like is when calling the EndServiceMethod(IASyncResult) if i forget to call the Close() method, the service will actually leave the connection open and then all remaining connections will fail after the wcf reaches it's max concurrent connections ...

How to write t eventlog in windows server 2008 using c sharp?

I have the following piece of code that works well in windows server 2003. It writes to the Application Event Log in EventViwer. The same code doesnt work in Windows 2008 The aplication crashes.Request to help on how to write to event log in Windows Server 2008. if (!EventLog.SourceExists("MyServiceLog")) { E...

Expose webHttpBinding endPoint in Framework 4.0?

I'm trying to expose a webHttpBinding EndPoint using Framework 4.0. <endpoint address="web" binding="webHttpBinding" contract="MyContract"/> However, when browsing using WFC Test Client, I see nothing. If I change my Framework target to 3.5, it works fine. Is there something different in 4.0 to get this to work? ...

How to enable WCF Service Discovery when using file-less activation?

G'day guys, How do I go about enabling service discovering when using WCF's file-less service activation? With this approach it doesn't seem possible to specify explicit endpoint types or a behaviorConfiguration? My current attempt is as follows but service discovery still is not working: <bindings> <wsHttpBinding> <binding name...

learning the basics of WCF

For those just starting to learn WCF, what are the major/basic things I should look at and learn first? What concepts would you recommend to learn first, to be productive in WCF? What resources/articles/training/books would you recommend to someone learning WCF? In C#, for example, one can learn LINQ at a later stage. Along similar li...

How to Insert row into SQL database with IDENTITY_INSERT set to OFF using WCF services?

An SQL table has auto increment property set for the primary key AnnotationID of INT type. The Silverlight application WCF service code: public void InsertImageAnnotation(int imageId, string imagePath) { DataClassDataContext db = new DataClassDataContext(); ImageAnnotation row = new ImageAnnotation(); r...

ASP.NET MVC2 application calling WCF duplex service

Hello All, I have an MVC2 application. Basically, in my Bill view, I want a user to click "Request Bill" and it calls the WCF service. The service then returns back a callback with the amount owed. I am having 2 issues. The duplex method callback from the client does not execute or does not get called. This happens intermithtently. So...

Getting error while runing Service.

I have created WCF service but while running the service I am getting below error: Error: Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata. Error Details: Warning: No code was generated.If you were trying to generate a client, this could be because ...

Shape a WCF service by endpoint

I have 2 contracts (cA & cB) implemented by a single WCF service with 2 endpoints (epA & epB). This is not for security purposes, but purely for reasons of clarity/organization, I'd like to only "see" ContractA's operations when I discover the service via endpointA; and likewise, only see ContractB's operations via endpointB. I don't n...

WCF: ASP.NET Hosting - Endpoint not found

I get "Endpoint not found" when attempting to access my service via the browser at http://localhost:10093/Services/Service1.svc I get "Error: Cannot obtain Metadata from http://localhost:10093/Services/Service1.svc" when attempting to access the same address from the wcftestclient. If I place a breakpoint in the service implementati...

PHP equivalent of this .net/C# code on async HttpWebRequest, custom headers binary payload and analyzing responses

I am looking for PHP equivalent of the below code even if it is not a compilable code just providing the high level functions to use to perform each of these functionality would be great. string subscriptionUri = "sample.com"; HttpWebRequest sendNotificationRequest = (HttpWebRequest)WebRequest.Create(subscriptionUri)...