|
Thursday, July 16, 2009
Using javax.swing.JDialog
using ThreadLocal()
Have you ever needed variables that were local to the scope of a thread, where each thread managed its storage, and it would be impossible for one thread to access the state information of another thread?
|
Wednesday, June 24, 2009
JSR-227 Standard Data Binding & Data Access Facility
The JSR-227 is the result of Oracle work and development of the ADF Data Binding model.
What is JSR-227: http://www.oracle.com/technology/tech/java/newsletter/articles/jsr227_interview.html
There is some concerns about the scope of this JSR:
http://www.theserverside.com/news/thread.tss?thread_id=20274
But if you use ADF Data binding you may want to see this video:
http://www.parleys.com/display/PARLEYS/Home#slide=17;talk=7857;title=JSR-227%20Standard%20Data%20Binding
What is JSR-227: http://www.oracle.com/technology/tech/java/newsletter/articles/jsr227_interview.html
There is some concerns about the scope of this JSR:
http://www.theserverside.com/news/thread.tss?thread_id=20274
But if you use ADF Data binding you may want to see this video:
http://www.parleys.com/display/PARLEYS/Home#slide=17;talk=7857;title=JSR-227%20Standard%20Data%20Binding
Friday, June 5, 2009
Web Service Security using Security Token Service (STS)
Securing a single web service can be done at transport level using SSL or at message level using the web Services Security protocol (WS-Security). Both of these solutions may involve the creation and use of cryptographic certificates (x509) on client and server.
if this approach works fine in an end point to end point perspective it may quickly becomes difficult to maintain this solution at an enterprise level when the number of services increase in volume and when web services are distributed in different locations.
Maintenance, monitoring, and administration becomes a key factor at a enterprise level.
The need for a integrated security solution for web services is increasing.
The following links introduce an enterprise solutions based on the security Token Service solution (STS).
Very good white paper (read the introduction part): Web Service Security Guide for Enhancements 3.0 (source Microsoft)
http://msdn.microsoft.com/en-us/library/aa480545.aspx
Single Sign On Service based on tokens
http://www.theserverside.com/tt/articles/article.tss?l=Systinet-web-services-part-6
http://www.sun.com/software/products/opensso_enterprise/index.xml
The token standard: SAML http://en.wikipedia.org/wiki/SAML_2.0
Token aware Firewalls: http://www.layer7tech.com/main/products/xml-firewall.html
Other good articles a bit older:
web service Security, part 1
http://www.xml.com/pub/a/ws/2003/03/04/security.html
web service Security, part 2
http://webservices.xml.com/pub/a/ws/2003/04/01/security.html
web service Security, part 3
http://webservices.xml.com/pub/a/ws/2003/05/13/security.html
web service Security, part 4
http://webservices.xml.com/pub/a/ws/2003/07/22/security.html
if this approach works fine in an end point to end point perspective it may quickly becomes difficult to maintain this solution at an enterprise level when the number of services increase in volume and when web services are distributed in different locations.
Maintenance, monitoring, and administration becomes a key factor at a enterprise level.
The need for a integrated security solution for web services is increasing.
The following links introduce an enterprise solutions based on the security Token Service solution (STS).
Very good white paper (read the introduction part): Web Service Security Guide for Enhancements 3.0 (source Microsoft)
http://msdn.microsoft.com/en-us/library/aa480545.aspx
Single Sign On Service based on tokens
http://www.theserverside.com/tt/articles/article.tss?l=Systinet-web-services-part-6
http://www.sun.com/software/products/opensso_enterprise/index.xml
The token standard: SAML http://en.wikipedia.org/wiki/SAML_2.0
Token aware Firewalls: http://www.layer7tech.com/main/products/xml-firewall.html
Other good articles a bit older:
web service Security, part 1
http://www.xml.com/pub/a/ws/2003/03/04/security.html
web service Security, part 2
http://webservices.xml.com/pub/a/ws/2003/04/01/security.html
web service Security, part 3
http://webservices.xml.com/pub/a/ws/2003/05/13/security.html
web service Security, part 4
http://webservices.xml.com/pub/a/ws/2003/07/22/security.html
Thursday, May 21, 2009
Oracle Securing Web services
A web service can be secured at the transport level (eg https) or at the message level (WS-Security).
Setting https on Oc4j standalone
https:
http://technology.amis.nl/blog/268/quick-and-easy-ssl-in-oc4j-standalone
http://tugdualgrall.blogspot.com/2006/10/using-https-with-web-services.html
http://www.coderanch.com/t/224567/Web-Services/java/Connecting-HTTPS-webservice-through-oracle
Note that when setting default-web-site.xml and secure-web-site.xml make also sure to include shared="true" to the applications or web services that need to support https.
Finally when generating the keystore file and answering to the question what is your first and last name, put there the domain of the application server.
WS-Security:
http://www.oracle.com/technology/oramag/oracle/05-jan/o15web.html
http://www.oracle.com/technology/oramag/oracle/05-mar/o25web.html
Also when oc4j supports http and https and you want to be able to switch from http to https without restarting a session you will follow these instruction to update to orion-web.xml of the application:
Set the cookie domain if shared="true" and the default ports are not used. When the client interacts with a Web server over separate ports, the cookie believes that each separate port denotes a separate Web site. If you use the default ports of 80 for HTTP and 443 for HTTPS, the client recognizes these as two different ports of the same Web site and creates only a single cookie. However, if you use nondefault ports, the client does not recognize these ports as part of the same Web site and will create separate cookies for each port, unless you specify the cookie domain.
Cookie domains track the client's communication across multiple servers within a DNS domain. If you use nondefault ports for a shared environment with HTTP and HTTPS, set cookie-domain in the element in the orion-web.xml file for the application. The cookie-domain attribute contains the DNS domain with at least two components of the domain name provided:
Setting https on Oc4j standalone
https:
http://technology.amis.nl/blog/268/quick-and-easy-ssl-in-oc4j-standalone
http://tugdualgrall.blogspot.com/2006/10/using-https-with-web-services.html
http://www.coderanch.com/t/224567/Web-Services/java/Connecting-HTTPS-webservice-through-oracle
Note that when setting default-web-site.xml and secure-web-site.xml make also sure to include shared="true" to the applications or web services that need to support https.
Finally when generating the keystore file and answering to the question what is your first and last name, put there the domain of the application server.
WS-Security:
http://www.oracle.com/technology/oramag/oracle/05-jan/o15web.html
http://www.oracle.com/technology/oramag/oracle/05-mar/o25web.html
Also when oc4j supports http and https and you want to be able to switch from http to https without restarting a session you will follow these instruction to update to orion-web.xml of the application:
Set the cookie domain if shared="true" and the default ports are not used. When the client interacts with a Web server over separate ports, the cookie believes that each separate port denotes a separate Web site. If you use the default ports of 80 for HTTP and 443 for HTTPS, the client recognizes these as two different ports of the same Web site and creates only a single cookie. However, if you use nondefault ports, the client does not recognize these ports as part of the same Web site and will create separate cookies for each port, unless you specify the cookie domain.
Cookie domains track the client's communication across multiple servers within a DNS domain. If you use nondefault ports for a shared environment with HTTP and HTTPS, set cookie-domain in the
The top down web service approach with Jdeveloper
Create xml schema and WSDL file and then generate the java classes from it.
http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_wstopdown/wstopdown.htm
http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_wstopdown/wstopdown.htm
Tuesday, April 28, 2009
Convert Java Calendar to XMLGregorianCalendar
DatatypeFactory dtf = DatatypeFactory.newInstance();
XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar();
Calendar cal = Calendar.getInstance();
xgc.setYear(cal.get(Calendar.YEAR));
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
xgc.setMonth(cal.get(Calendar.MONTH)+ 1);
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
xgc.setMillisecond(cal.get(Calendar.MILLISECOND));
// Calendar ZONE_OFFSET and DST_OFFSET fields are in milliseconds.
int offsetInMinutes = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);xgc.setTimezone(offsetInMinutes);
Simpler option:
GregorianCalendar gc = new GregorianCalendar();
DatatypeFactory dtf = DatatypeFactory.newInstance();
XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendargc);
==================================================
XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar();
Calendar cal = Calendar.getInstance();
xgc.setYear(cal.get(Calendar.YEAR));
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
xgc.setMonth(cal.get(Calendar.MONTH)+ 1);
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
xgc.setMillisecond(cal.get(Calendar.MILLISECOND));
// Calendar ZONE_OFFSET and DST_OFFSET fields are in milliseconds.
int offsetInMinutes = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);xgc.setTimezone(offsetInMinutes);
Simpler option:
GregorianCalendar gc = new GregorianCalendar();
DatatypeFactory dtf = DatatypeFactory.newInstance();
XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendargc);
==================================================
Subscribe to:
Posts (Atom)