wcf

WCF digest Authentication

What should be specified on the client side? Is this enough: binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Digest; //... cf.Credentials.HttpDigest.ClientCredential = new NetworkCredential("myuser", "mypass", "mydomain"); cf.Credentials.HttpDigest.AllowedImpersonationLevel = TokenImpersonationLevel.Imperso...

Sending a byte array from PHP to WCF problem

Hi I have this problem: I have to send a byte array (encoded photo) from my PHP client to the WCF host. when I do a var_dump() on my array in PHP I get an array[2839] which is ok but on the server side when i debug I see that received array is only byte[5]...any idea how I can fix it? I used code like this $file = file_get_contents($_...

Best way to keep a .net client app updated with status of another application

I have a Windows service that's running all the time, and takes some action every 15 minutes. I also have a client WinForms app that displays some information about what the service is doing. I'd like the forms application to keep itself updated with a recent status, but I'm not sure if polling every second is a good move performance-wis...

Silverlight Faults

I;m trying to get WCF Silverlight faults working as per this : MSDN aricle After adding the SL fault to my Web.config file I get the following warning: The element 'behavior' has invalid child element 'silverlightFaults'. List of possible elements expected: 'serviceAuthorization, serviceCredentials, serviceMetadata, serviceSecurityA...

How to check WCF generated client is compatible with service at runtime

I realise that WCF and services in general are meant to be loosely coupled. But I have a requirement that my client app can check whether an given WCF endpoint contains a service that matches its generated client code. In other words I need to check for a compatible service. Obviously I could have a method that returns a manually main...

System.Security.SecurityException in accessing a service GoDaddy

I am running a web service on GoDaddy server. When i try to consume it by a ASP.NET client, hosting on the same server but diff. virtual directory, it is giving following error. System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neu...

Using WCF in .NET how can I make it auto generate SOAP docs like ASMX did?

I'm currently writing a web service using WCF in VB.NET. Previous web services I wrote used ASMX but I wanted to learn WCF and so far it's going well. I actually prefer the way WCF does things. One thing I miss however is the way that ASMX used to generate example SOAP requests and responses. It was like getting documentation for fre...

How to Log Exception in a file?

I want to be able to do logging in every catch block. Something like this. catch (Exception exception) { Logger.Write(exception); } and then the settings in the configuration will pick up the Message and StackTrace property etc using customer listener. I would like to use Enterprise Library Logging Application Block. I'm sure someo...

Win CE 6.0 client using WCF Services - Reduce Bandwidth

We have a Win CE 6.0 device that is required to consume services that will be provided using WCF. We are attempting to reduce bandwidth usage as much as possible and with a simple test we have found that using UDP instead of HTTP saved significant data usage. I understand there are limitations regarding WCF on .NET Compact Framework 3.5...

END_TAG exception while calling WCF WebService from Android using KSOAP2?

Hi, I am trying to call a WCF Web Service from Android using KSOAP2 library. But I am getting this END_TAG exception. I have followed this thread to call WCF Web Service but still no result. I am passing "urn:TestingWcf/GetNames" as SOAP_ACTION, does this causes problem in Android since the error occurs at the statement "aht.call(SOAP_A...

WCF: Server Not Found - from trace Empty Message when run async but works fine from console app?

Todays cause of hair loss has been the following scenario: I have a service that takes 2 strings and returns another. This service uses basicHttpBinding <basicHttpBinding> <binding name="basicHttpNoSec"> <security mode="None" /> </binding> </basicHttpBinding> Anyway, it works fine from a console test app. I have a silverlig...

WCF interface and derived class

I have a WCF service and have to expose an interface as datacontract. There are two derived classes from the interface. The WCF service will return an object of the derived type.The client will have to cast it as a derived class. Is that possible on the client side ?.What should be my approach. ...

Client App with WCF to consume ASMX

I have a webservice with .NET 1.1 (old school ASMX) and I am creating a client app to connect to it and use its services. From what I remember from the last time I had used Visual studio -which was 2003 version!- I can add a WebReference to it and easily use it. Tried it . it still works. but it looks like things have changed in 2008 a...

Need to GetWebResouceUrl from within a WCF web service

I need to extract a resource from a DLL. When called from a web page, I use: return Page.ClientScript.GetWebResourceUrl(this.GetType(), "xxx.ASPNET.Modules.Resources.16.news.png"); But in WCF, I obviously don't have the ClientScript property/ClientScriptManager type. So how can I get a URL? I can only assume it cannot be done but ...

WCF enum - any way to transfer both valid enum values AND numbers

Suppose you have: public enum Priority : short { Low = 100 Normal = 200, High = 300 } I'd like to call WCF service with following call myWCF.call(Priority.Low); myWCF.call(Priority.High); myWCF.call(105); Is that possible to do without rewriting half of WCF stack? I'd prefer as ...

Looking for a way to ensure that generated WSDL picks up a schema for XElement DataMembers

I am working on a WCF (.NET 3.5 target) service which exposes a number of methods to be consumed ultimately by InfoPath. I have a simple DataContract which includes several members, one of which is an XElement: [DataContract] public partial class MyDataContract { [DataMember] public string ObjectId {get; set;} [DataMember...

WCF does not generate the properties

I have a .NET 1.1 ASMX and want to use it in a client WinForms app. If i go wit the old way and add it as a "WebRefrence" method then I will have access to two of its properties which are "url" and "UseDefaultCredentials" and it works fine. But if I go with the new WCF way and add it as a ServiceReference I still have access to the met...

Attaching files to WCF REST service responses

I have a resource that looks something like this: /users/{id}/summary?format={format} When format is "xml" or "json" I respond with a user summary object that gets automagically encoded by WCF - fine so far. But when format equals "pdf", I want my response to consist of a trivial HTTP response body and a PDF file attachment. How is ...

WCF client encrypt message to JAVA WS using username_token with message protection client policy

I am trying to create a WCF client APP that is consuming a JAVA WS that uses username_token with message protection client policy. There is a private key that is installed on the server and a public certificate file was exported from the JKS keystore file. I have installed the public key into certificate store via MMC under Personal cert...

Ajax-Enabled WCF Only Intermittently Returns to Callback Function

I have an ajax-enabled WCF service that returns a set of JSON objects back to the browser. The service has a simple function that calls a business layer dll. This then returns the objects to the calling method. Below is the service implementation (minus the Imports statements): <ServiceContract(Namespace:="")> _ <AspNetCompatibilityR...