.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

silverlight + WCF Service + Dynamic proxy(custom binding) + basic authentication on iis

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :WCF
hi all, I am having an issue with how to get windows identity in silverlight project. Below is my scenario: the silverlight application need to get data from server via WCF service, i used the way that built dynamic proxy at runtime and aslo used custombinding in this case. Now my application need to deploy on iis and chosen "basic authentication" as a authentication mode. Thus i have chosen authentication mode in WCF was " <security authenticationMode="UserNameOverTransport">". At the client side where kind of project is silverlight that i need have to dynamic proxy with custombinding. My question is: In basic authentication how can i get windows identity to set to chanelfactory.Credentials: _channelFactory = new ChannelFactory<TWebService>(this._binding, new EndpointAddress(_endpointAddress));            _channelFactory.Credentials.UserName = new UserNamePasswordClientCredential();            _channelFactory.Credentials.UserName.UserName = "username";            _channelFactory.Credentials.UserName.Password = "password"; actually, i do not want to use Windows a

View Complete Post

More Related Resource Links

Looking for a simple Service and Console Client REST sample implementing BASIC authentication


Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.

Sesame: Spatial OData on Maps, Service Operations, HTTP Basic Authentication

Sesame Data Browser has just been updated to offer the following features for OData feeds: MapsImproved Service operations (FunctionImport) supportHTTP Basic Authentication supportMicrosoft Dallas support Maps Sesame now automatically displays items on a map if spatial information is available in data.This works when latitude and longitude pairs are provided.Here is for example a map of drinking fountains in Vancouver:This comes from DrinkingFountains in http://vancouverdataservice.cloudapp.net/v1/vancouver, which provides latitude/longitude for each fountain. Here is another example, without latitude/longitude this time: This is a map of the customers from the Northwind database, which are located based on their country, postal code, city, and street address. Service operations (FunctionImport) Support for service operations (aka FunctionImports) has been improved. Until now, only functions without parameters were supported. It's now possible to use service operations that take input parameters. Let's take as an example the GetProductsByRating function from http://services.odata.org/OData/OData.svc.This function is attached to Products, as you can see below: A "rating" parameter is expected in order to open the function: After clicking Open, you'll get data as usual:HTTP Basic Authentication New authentication options have been added: HTTP Basic and Dallas (more

WCF Kerberos Authentication Custom Binding

Hello,I am using Kerberos as the Authentication mode for a WCF Client to interact with an ASMX Web Service. I am using customBinding in the WCF Client. I am getting the below mentioned Fault Exception when I invoke the HelloWorld Method by creating a Proxy using SVCUTIL. `System.Web.Services.Protocols.SoapHeaderException: Server unavailable, please try later ---> System.ApplicationException: WSE841: An error occured processing an outgoing fault response. ---> System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: WSE914: This instance of derived key token does not support encryption, decryption, or key wrapping. It can only be used to sign or verify signature. Please make sure that the length of the derived key matches the length of the key required by the symmetric encryption algorithm configured for the derived key token manager.    at Microsoft.Web.Services3.Security.Tokens.DerivedKeyToken.Psha1SymmetricKeyAlgorithm.get_EncryptionFormatter()   at Microsoft.Web.Services3.Security.EncryptedData.ResolveDecryptionKey(String algorithmUri, KeyInfo keyInfo)   at Microsoft.Web.Services3.Security.EncryptedData.Decrypt(XmlElement encryptedElement)   at Microsoft.Web.Services3.Security.EncryptedData.Decrypt()   at Mic

WCF Dynamic Proxy and Custom Types / Collections

Hi, i'm trying to dynamically invoke WF4 operations trough this utility ( http://code.msdn.microsoft.com/netfxsamples/Wiki/Print.aspx?title=WCF%20samples&version=8&action=Print ) since the wf interface changes depending on the activity used (and i'm going to run ~100  custom workflows. The problem is that i'm not able to customize the collection type like you do with wcf-> Add Service References ( and it uses arrays of fixed size): this breaks my EF4 POCO objects (in particular during the fixup, it finds readonly collections). How can i customize the code to use some more flexible type of collection? List or observablecollection? I should add collections types to XsdDataContractImporter.Options (ImportOptions ) [ DynamicProxyFactory.cs line 178 ] but i dont know how to find metadata generated types to specify generic collection types. If this is not possible or the solution is not a best practice, could you provide one? how can i invoke Operations on service workflows whos interface is mutable? Thanks in advance.

Basic authentication for Web service


Hi everybody,


i call my project web service, previously there was no pre-authetication. Now i didn't work web service. My code is as follows:


 //Cache'lenecek olan güvenlik dosyasi  
         CredentialCache credentialCache = new CredentialCache();  
         //Güvenlik dosyasinin olusturulmasi  
         NetworkCredential credentials = new NetworkCredential("username", "password");  
         //Güvenlik dosyasinin cachelenmesi  
         credentialCache.Add(new Uri("url"), "Basic", credentials);  
         //Web servisin classindan türetilmis ws objesi  

            spectrawsdl sp = new spectrawsdl();
            sp.Credentials = credentialCache;
            sp.UseDefaultCredentials = false;
            mainResponseType mrp= sp.addIncident("Test", "test", "test", "test");

What should I do?



Best method for authentication with an external WCF service called from a Silverlight 4 Web Part ins

If we have a Silverlight 4 application which gets its data from an external WCF service and is deployed as a Web Part on in SharePoint 2010 what is the best method to perform authentication in the WCF service itself.  The service is not on the same domain as the SharePoint server but any user authenticated by the SharePoint server (and only those users) should be able to access the service.  Since the Silverlight application is calling the service the WCF service itself must be configured to use BasicHttpBinding which, of course, severely limits possible authentication methods.

How do I add a service reference when Basic Authentication has been enabled


I am trying to enable Basic Authenticaion for my WCF service, whicn requires disabling anonomous athentication and enabling basic authenticaion in IIS. Now I am unable to add the service reference, which is requiring authentication to complete and getting the following error:

Metadata contains a reference that cannot be resolved: 'https://l01billm/wcf4test/Service1.svc'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.

create proxy client with SvcUtil from service using https+cert authentication


Hi all,

I have build two web services one is wcf hosted in iis and the other one is java web service (jax-ws ri) hsted on tomcat. Both of the services uses https and certificate authentication.The certificates are valid and when I check the wsdl's from the browser I can see them without any warning.

So I want to create a wcf client for the services with svcutil. I have created the necessary config file for svcutil (svcutil.exe.config).

When I try to create the proxy files for the java service (svcutil http://JavaServiceIpAddress/service?wsdl) I receive

"metadata contains a reference that cannot be resolved .

<Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/" >
   <faultcode xmlns:a="http://www.w3.org/2003/05/soap-envelope" xmlns="">a:Client</faultcode>
   <faultstring xmlns="">Cannot find dispatch method for {}</faultstring>

the request was aborted: Could not create ssl/tls secure channel"


When I execute svcutil http://WcfServiceIpAddress/service.svc the proxy and configs file are created smoothly. When I try svcutil http://WcfServiceIpAddress/service.svc?wsdl

"error: cannot obtain metadata from http://WcfServiceIpAddress/service.svc?wsdl


WCF service IIS7 Server 2008 custom User Name Authentication performance



I have WCF service. Nothing special. Everithing from "best-practice".

  • WCF Service hosted on Server2008(64)\IIS7
  • Application pool - integrated\.NET 4.0
  • binding: basicHttpBinding; security:TransportWithMessageCredential
  • transport clientCredentialType="None"
  • message clientCredentialType="UserName
  • custom class inherited from UserNamePasswordValidator provide simple validation.

Everything works as designed. But I have a performance issue.

I traced and logged the server and WCF class and figured out that there is no new "http request" in process until previous one passed "Verification". It looks like concurrent calls do not have any sense because UserName Password Validator may serve them one by one only.

It can't be a true. I hope I just missed some settings.

I will appreciate any help.


Reload custom Persistence Service and UI Binding



I want to make kind of persistence service in state machine wf, 

and I have some open questions.

1. Is there any way to implement my own persistence without inheriting from PersistenceService? I can call the Save method to serialize the workflow,

but how can I reload it into instance and run it?

2. Is there any way to mange when the persistence is happened?

i only want to explicitly persist data from my workflow.

3. what is the best way to bind state machine workflow to the UI?





SQLServer 2008 R2 Reporting Service websevice url does not display with custom authentication



I have installed SQLServer2008R2(CUD3) (64bits on Windows7) Reporting Service with custom authentication.  I can log in to the report server and report manager and everything appears fine, but the webservice url: http://myhost/ReportServer/ReportService2005.asmx no longer works (The webservice url did display before I put int custom authentication).  I got a html back with error message.

This webservice url used to be not protected.  I wonder if this is something changed in 2008R2 and it is a bug, or something I did not do it right.


Thanks for any help!

       // some info here


    <body bgcolor="white">

            <span><H1>Server Error in '/ReportServer' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Access is denied.</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "

SharePoint 2010 + Custom WCF Service in SharePoint + Authentication ??


I have been roaming arround the forum for this info, but I am unlikely able to find it...

I have created a WCF service hosted in SharePoint 2010 ISAPI folder, using the "Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHostFactory" (just as an example) to be able to get back SPContext during calls done to my service.

I made a nice Silverlight app hosted in" _Layouts/MyApp". when I try to access my service I just get a 401...

Is there sonething Iam missing to get my SL app authticated correctly by the user running the page where this SL app is hosted ??



WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

Now Playing: Building Custom Players with the Silverlight Media Framework


The Silverlight Media Framework is an extensible and scalable video framework upon which you can create your own player experiences. We'll walk you through a custom player project that displays suggested videos for further viewing after the current video ends.

Ben Rush

MSDN Magazine May 2010

Dynamic .NET: Creating Interactive Bing Maps with Silverlight and IronRuby


Silverlight provides support for dynamic languages such as IronRuby and IronPython. We'll walk you through the creation of a custom Silverlight control using Bing Maps and IronRuby.

Ashish Ghoda

MSDN Magazine February 2010

Dynamic WPF: Create Flexible UIs With Flow Documents And Data Binding


Flow documents offer enormous flexibility in arranging text layout and pagination, but they don't support data binding, so you can't dynamically change content. Here we build a component to solve that problem.

Vincent Van Den Berghe

MSDN Magazine April 2009

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend