Click here to Skip to main content

Predrag Tomasevic - Professional Profile

@lepipele

Summary

78,209
Author
605
Authority
1,448
Debator
50
Editor
2
Enquirer
161
Organiser
1,074
Participant
http://www.linkedin.com/in/ptomasevic
 
Bitcoin wallet: 1ARXmh58S6aRiZPCbneDCzrB1HUU6PLmDQ
Member since Wednesday, June 27, 2007 (7 years, 3 months)

Contributions

Articles 10 (Legend)
Tech Blogs 0
Messages 345 (Regular)
Q&A Questions 0
Q&A Answers 1
Tips/Tricks 0
Comments 0

Links

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an ArticlesilversilversilversilverSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
GeneralAdding custom headers to Silverlight's WCF calls PinmemberPredrag Tomasevic28-Feb-10 13:00 
Bah... this proved tougher than I originally thought, because all I could find were bunch of smart-ass comments that contained no code. You'll hopefully evade that path by following these steps:
 
1. Download Solution from -> http://www.sendspace.com/file/465sb6[^]
2. Open .sln, press F5 -> press Button -> you should get dialog with bunch of variables showing that server is aware of calling client's credentials and culture
3. Open SilverlightWcf/Page.xaml.cs to see how calls are initialized - note that you only set culture/username/password during proxy's creation.
 
How to import this into your solution? Easy:
 
1. Copy Util.CustomHeader.Silverlight & Util.CustomHeader.WcfService projects into your solution's folder
2. Reference Util.CustomHeaders.Silverlight from your Silverlight project, Util.CustomHeaders.WcfService from your WCF project
3. Decorate your WCF service with [CustomHeadersBehaviorAttribute] attribute (alternatively you can set this in config by using CustomHeadersBehavior, see ref #3 for more details)
4. Add reference to your WCF service from Silverlight project and after proxy class generation is finished you'll use code like this to initialize your service:
 
public Page()
{
    InitializeComponent();
 
    ClientChannelBinding binding = new ClientChannelBinding();
    ClientChannelBinding.Culture = "sr-Latn-CS";
    ClientChannelBinding.Username = "username";
    ClientChannelBinding.Password = "password";
 
    EndpointAddress endpoint = new EndpointAddress(
        "http://localhost:1654/SilverlightWcf.Web/Services/Service1.svc");
 
    client = new SilverlightWcf.ServiceReference1.Service1Client(binding, endpoint);
    client.GetDataCompleted += client_GetDataCompleted;
}
 
private ServiceReference1.Service1Client client;
 
Of course, I recommend that you create some kind of WebServiceFactory.cs in your Silverlight project that will create services for you and do this initialization... while also exposing that web service URI in some config.
 
For those interested in details of how this works:
 
#1 - http://fluffyidentity.blogspot.com/2008/08/custom-wcf-channel-in-silverlight.html[^]
#2 - http://geekswithblogs.net/SunnyCoder/archive/2009/03/15/username-password-amp-ws-security-with-silverlight.aspx[^]
#3 - http://weblogs.asp.net/paolopia/archive/2007/08/23/writing-a-wcf-message-inspector.aspx[^]

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 2 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid