StackOverflow.com
Random snippets of all sorts of code
Talking to STS Server with Custom Credentials
Recent Questions - Stack Overflow | 6 Feb 2012, 9:44 am
I'm new to STS, and WS-Trust. Please bear with me. I'm writing a piece of Java sofware where some authentication via an STS server is involved. The user connects to the STS server and gets an XML document with root element . Then the user connects to my application and passes this XML document. My application is supposed to connect back to the STS server to validate the assertion presented by the user. A sample XML of how the SOAP message sent from my application to the STS has to look like can be found at:http://pastebin.com/gvGCAiNx.
The general question is, what tool is best suited for this? I was contemplating using Apache CFX; but I don't know for sure how specifically I would pass that assertion.
Any help would be much appreciated.
Thanks,Klaus.
Multiinstance Application architecture and deployment in GlassFish app server
Recent Questions - Stack Overflow | 6 Feb 2012, 9:44 am
I need to setup a hosting environment for around 100 customers per one GlassFish server (v 3.1).Each customer needs custom configured application that can be run independently from each other. (JDBC, JMS, possibility to restart single app)Running single virtual machine would be preferred, as launching 100 JVMs each using 750MB of RAM doesn’t sound like a good idea.
So far I have tested the following solutions, but unfortunately, neither of these has met my requirements:
Deploying application on separate Domains. This solution was insufficient because of JVM Ram usage and complexity of running multiple management consoles on multiple ports (we don’t need that much separation)
Deploying application on multiple instances (named targets on Glassfish) on the same domain. This solution was insufficient because it creates separate JVM process for each instance and consumes too much RAM (several hundred MB for each instance). Otherwise it was closest to what we need.
Deploying application on multiple virtual hosts on the same instance. This solution was unacceptable because in Glassfish each virtual server doesn't have a separate configuration.
Can anyone suggest what is the best practice / recommendation for using GlassFish to host multiple application instances? Are we “doomed” to reserve 1GB of ram per customer? Coming from IIS environment, we had separate Application Pools each using 3-5MB of RAM at startup.
Java-Applet will not release focus in Firefox
Recent Questions - Stack Overflow | 6 Feb 2012, 9:44 am
I have an Java Applet with some TextFields. When I Click in any TextField, it gets the focus, I see the caret and I can write my text. OK.
But now I ckick in the address field of the Browser, I get a second caret and any KeyEvent is dispachted by the Applet, so I can't type in a new URL in the Browser. This url is written to my Applet textfield.
It works with chrome. But not with firefox.
visual studio, how to use xml comments within a method
Recent Questions - Stack Overflow | 6 Feb 2012, 9:44 am
I use xml comments in VS 2005 a lot but now I have a problem. I need to comment IFs, WHILEs, SELECT CASEs etc. But VS keeps telling me that it is impossible. Isn't there some workaround?
It would really help me.
Using cookie in asp.net mvc c#
Recent Questions - Stack Overflow | 6 Feb 2012, 9:43 am
I want to register the parameter of a few pages in my web site using cookie. I tried the below code but not like what I want :
public ActionResult Index(int? dep, int? cat) { ...... string theDept = Request.QueryString["dep"]; HttpCookie cookie = new HttpCookie("search"); cookie.Values["dep_name"] = theDept; cookie.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(cookie); return View(); }I read it in site.master :
<% HttpCookie cookie = Request.Cookies["search"] ;if ((cookie != null) && (cookie.Value != "")){ Response.Write(cookie.Values["dep_name"].ToString() + "---" + cookie.Values["cat_name"].ToString() + "---" + cookie.Values["brand"].ToString());}%>Problem: When I click to another page that Request.QueryString["dep"] is null, the cookie that I display is null to.
How to store it in the cookie without losing while we not yet clear the cookie?
Thank so much and welcome to your answers.
error in declaring <afxdb.h> inside stdafx.h
Recent Questions - Stack Overflow | 6 Feb 2012, 9:43 am
I am trying to use CDatabase and for that I have declared in stdafx.h file.When I compile this code I get an error "WINDOWS.H already included. MFC apps must not #include ". Why does this happen? Isn't this the right header file to use CDatabase?
Thank You
Creating IPHONE application with PHP,Possible?
Recent Questions - Stack Overflow | 6 Feb 2012, 9:43 am
I want to try to create an iPhone app using PHP and I do not know where to start.Please, give me example, guides or any information.Thank you very much!Niv
EF 4.1 ExecuteStoreQuery with joins
Recent Questions - Stack Overflow | 6 Feb 2012, 9:43 am
Is it possible to map ExecuteStoreQuery with joins result to domain objects?
i.e. we have 2 domain objects
public class Customer{ public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual ICollection<Order> Orders { get; set; }}and
public class Order{ public virtual int Id { get; set; } public virtual string Description { get; set; } public virtual int CustomerId { get; set; } public virtual Customer Customer { get; set; }}and now if i'll run this query:
string query = "select * from Order as Order inner join Customer as Customer on Order.CustomerId = Customer.Id where freetext(Order.Description, 'something')";_objectContext.ExecuteStoreQuery<Order>(query);the result will be collection of orders with all customers set to null.how can i fix this ?
Thank You!
iPhone - How to determine the target version of an existing project
Recent Questions - Stack Overflow | 6 Feb 2012, 9:43 am
I have an existing huge iOS project, set for iOS 5.0 target by default. But I'm pretty sure that it's also 4.?.? compliant. Setting the iOS target to something lower that iOS 5 never raises any warning nor error, so how may I know the minimum iOS version my app can be targeted to, without having to compare the whole code word by word with the iOS developer reference files, that may take weeks ?
Issue with mod_rewrite apache | redirecting non www url to www url
Recent Questions - Stack Overflow | 6 Feb 2012, 9:38 am
I am trying to redirect all request on my site to url of format:
https://www.mydomain.com as I have SSL certificate for www.mydomain.com. I have written following rewrite rules to do this:
RewriteCond %{HTTP_HOST} !^www [NC]RewriteRule $ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R]RewriteCond %{HTTPS} offRewriteRule $ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]Out of the following possible formats, only one is not working:
mydomain.com - workingwww.mydomain.com - workinghttp://mydomain.com - workinghttps://mydomain.com – not workinghttps://www.mydomain.com - workinghttp://www.mydomain.com - workingCan anyone explain the reason behind and solution for this issue?
Recent Questions - Stack Overflow
