Category Archives: C#

WCF in Different Domain or Server

Hi There,

Its bean a while since I have updated my blog so I will be posting one of the things that I have experience on my work. That is WCF in Different Domain or Server. One of the main error that you may experience is the same as bellow:

Server Error in ‘/’ Application.


The request for security token could not be satisfied because authentication failed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ServiceModel.FaultException: The request for security token could not be satisfied because authentication failed.

Source Error:

Line 87:         
Line 88:         public bool IsExisting(string domain, string username) {
Line 89: return base.Channel.IsExisting(domain, username); Line 90:         }
Line 91:         


Source File: D:\Projects\MobileWeb\MobileWeb\Service References\SykesAD\Reference.cs Line: 89

Stack Trace:

[FaultException: The request for security token could not be satisfied because authentication failed.]
   System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target) +8904771
   System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState) +203

[SecurityNegotiationException: The caller was not authenticated by the service.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4729651
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725

 

This message or exeception happens in production (published files has been uploaded to IIS) and not when you are currently developing it on your Visual Studio. So what is the solution? Here is the simple solution that made me a little crazy upon gazing unto it.

//Let say here is your Instantiation of your WCF
ClassADClient ad = new ClassADClient();
//Then the solution is to add a credential that the system will use on using the said WCF
//Such as like this
ad.ClientCredentials.Windows.ClientCredential = new NetworkCredential(“domain\\username”, “password”);

That’s it thats the solution and you can now use the said service without the said error.

Hope I help you! 

 

Thanks,
Thomie Jose San Agustin, MCP 

Timezone your DateTime

Hi there!

I have been wondering today on how to make your website created on ASP .Net  perfect to all timezone so that if a user view your website on another country the date and time of your website is set to their timezone. So lets start to Timezone your DateTime!

  1. First create a Website Project on your Visual Studio
  2. Add Reference to this DateTimeW DLL
  3. On your website there should be an AJAX – Server Interaction. The AJAX will pass the timezone of the client to the Server and the server will fetch the timezone and set all your date.

For a clear way of implementing this your can download the demo below.

Demo TimezoneDatetime

GAME : Typing Mania

Download: TJSAsTypingMania

TJSAsTypingMania

TJSAsTypingMania

This is another game that during my OJT I have experimented on the .Net Framework during our free time.

The goal of the game is to type the letters that will be shown to you in the shortest possible time.

GAME : MouseAttack v1.0

Download: TJSAsMouseAttack

During my OJT I have experimented on the .Net Framework to develop some games during our free time.

One the games I have develop is the MouseAttack. Its a game were you need to avoid some falling objects in order to get more points. The game was developed for a little time, but I hope you like it.