Thursday, December 20, 2007

Web Services and Files Exchange

SOAP based Web Services are now very common in the enterprise architecture, and quite often, applications that consume or publish services would need to send binary content such as images, PDF or Word documents (or anything you have in mind...). The SOAP and XML provide different way to achieve this. So what are the challenges around binary data exchange using SOAP based Web Services:
  • The main goal of Web Services is interoperability; so when you are offering a service, you need to be careful about the technical choice you are making. SOAP has been one great success in term of interoperability. I am aware that REST is also a very good fit for that but since I talk about SOAP and later WS-* standards, I do not want to talk about REST more in this post, the only thing that you can put in your mind is before choosing to implement SOAP based Web Services, ask the following question to yourself: "do I really need SOAP services or REST would be enough?"... That said let's continue on SOAP and binary content exchange. When talking about binary content, the interoperability comes with some trade off around for example performance/message sized or impact on developer. This will be discussed later, but always keep in mind that interoperability is the key point of Web Services. If this is not the case on your project, that means you probably do not need to use SOAP that has an important overhead in general.
  • Performance and Scalability is also quite important when you are building a service based application. Especially that often you cannot predict exactly how much a service will be used. We have to keep in mind that often services are build to be reusable, it is one of the basic best practices of development, so if the service is really "reused" it is important to keep it running with acceptable performances. This is why when talking about binary content, with SOAP it is important to talk about the impact of it on the size of the message and the processing cost.
  • When using SOAP Composability is also quite important. In the context of binary content exchange with XML/SOAP it is important to support composability of the WS-* standard, and this in a performant manner. An example would be that a services that is sing WS-Security to sign part of the messages should be able to sign the PDF document using the same standard.
  • Impact on development: it is interesting also when choosing the way binary content should be exchanged with SOAP, to see how much impact it has on the development itself. Does a developer must import specific API to be sure that the binary content is properly sent/consumed by the server or client. Note: I will talk about Java here, and particularly about JAX-WS/JAX-RPC since it is the stacks that I know the much, but the remarks would be the same on all technologies.
Let's now dive into the different options that are offered to a developer/architect to exchange document using SOAP:
  • XML Base64 encoding
  • SOAP With Attachment (SwA) using MIME (Multipurpose Internet Mail Extensions)
  • SOAP With Attachment using DIME (Direct Internet Message Encapsulation)
  • Message Transmission Optimization Mechanism (MTOM)
First of all, I will not talk in detail about the 3rd point around SOAP with Attachment with DIME, for a simple reason: this approach has been pushed by Microsoft around 2003/2004 and it is now deprecated in favor of MTOM.

Base64 Encoding
Base64 is part of the core XML capabilities, and when using it to exchange binary content in a SOAP message it has some very good advantages:
  • Since it is part of XML itself, it has a great interoperability, I can say that all stacks will be able to consume or send messaged that contains Base64 data.
  • For the same reason it does not have any impact on development, most of the Java stacks will automatically use base64 encoding when byte[] paramters will be present.
  • Always because of the fact that is it 100% XML based, the composability with other XML/WS-* standard is very good.
  • So far eveything looks great for this approach, but the trade off is the following: Base64 encoding is not efficient, since "lot of" CPU will be used to encode and decode the binary content. In addition the size of the encoded data would be around 30% bigger than the binary content itself. (It can still be used for small dataset)
SOAP with Attachment (SwA)
The SOAP with Attachment specification is the first effort of the Web Services industry to solve the problem of binary content with SOAP. The idea is to In addition to the W3C Note, the WS-Interoperability organization, has extend this recommendation to create a basic attachment profile to enforce the interoperability of it, using the SOAP with Attachment Reference (swaRef).
  • The good part of SwA and is the fact that it has been noted by the W3C but also adopted by the WS-I organization. But in fact the interoperability is not that great, mainly because none of the Microsoft Web Services solution support SwA. It is true that most of the Java stacks, starting with the standard JAX-RPC/JAX-WS is supporting SwA and swaRef but it is not enough to call it a good interoperability.
  • The reason why Microsoft refused to implement it, and why it is only a W3C note (and not a recommendation) it is because SOAP with Attachment has poor composability. The reason why it is hard to use WS-* standard with SwA, it is because it breaks some part of the model by ignoring the SOAP/XML processing and just put the document in the MIME header, and a simple reference to it into the SOAP message.
  • SOAP with Attachment is efficient, because of the previous point. The SOAP stack does not really deal with the content and just stream it into the MIME header.
  • When it is used with JAX-RPC and JAX-WS, has an impact on the developer, that must use specific Java API to build it service and put specific data types in the WSDL. The impact on development is not large, but still developper has to think about providing the good method signature or WSDL entry to enforce the use of SwA/swaRef in its service. Where I do believe most developers would expect this to be transparent.
Message Transmission Optimization Mechanism (MTOM)
The last mechanism is also based on MIME on the wire to exchange the binary content, but the way the message (SOAP+MIME) is build is totally different from the previous SwA approach. MTOM has been based on the "experience" of the others mechanisms, to be able to support composability without impacting the performance and the development.
  • Interoperability is virtually great. It is great because it has been pushed by major vendors such as IBM, Microsoft, BEA, Oracle and it is a W3C recommendation, so interoperability should be good. I put a "virtually", because to be interoperable the various Web Services stack must implement it, and it is not the case yet. Today, most of the latest stacks are supporting MTOM so it should not be an issue if you are starting a project.
  • Composability is perfect, since MTOM does use the SOAP envelop but it provides an automatic and transparent optimization to put the binary content on the MIME header. During the serialization of the message, the SOAP engine is working with the content with a temporary base64 representation of the content allowing all the WS-* operation needed, for example an XML signature, but without the overhead of dealing with base64 over the wire.
  • MTOM appears like the most efficient way of dealing with large document and SOAP.
  • Because MTOM is using the same approach than the pure XML base64 process, it does not have any impact on development. In fact this the the Web Service stack that choose to use base64 (embedding the document) or MTOM over the wire. And this could be done in conjunction with a WS-Policy. As you can see in the WS-MTOMPolicy this is not under the control of the developer but more under the control of the administrator and then the applications to choose or not to use MTOM.
But... Which one I should use?
Based on the different points described earlier is looks like MTOM is the way to go; even if this is true it cannot be summarized to this. First of all MTOM is not supported by all the stacks, so if you cannot control the consumers of your services and cannot impose a modern stack, MTOM may not be the best approach. For me, the second on the list is the Base64 approach, because of high interoperability but it is important to remember that has an impact on performance/processing. I personnally would not push SwA because of its non support in the Microsoft world... As you know the world is not yet 100% Java based ;). Let's take a look on which stacks are supporting MTOM today:
  • JAX-WS reference implementation (and Metro)
  • IBM Websphere 6.x with SOA Feature Pack
  • BEA Weblogic 10
  • OracleAS 10gR3 (10.1.3.1) JAX-RPC and FWM 11 preview (JAX-RPC and JAX-WS)
  • Axis2
  • XFire
  • JBossWS
You can find more information on these comparison matrices : Apache WS Stack Comparison and Xfire Comparison Matrix. (these two are probably very interesting to keep... unfortunately they do not contains any MSFT data. I had one in the past, but cannot find it... if you have such matrix feel free to post it in comment.)

Monday, December 10, 2007

Working on a large XML or SOA project: think about "separation of concerns"

With XML and SOA becoming mainstream in the enterprise XML operation such as Schema validations, XSL transformations are now very common. These specific operations are CPU intensive and could become a performance bottleneck when directly applied on the middleware. It could be even worst now when using SOAP based Web Services and their related WS-* standards. For example with WS-Security, XML encryption and signature is now more and more used in SOA based applications.

This is why many enterprise architects are bow looking for solutions to improve performances of XML centric applications.

One of the think we learn when developing application, and that Aspect Oriented Programming has highlighted is the concept of “separation of concerns”. It is key to keep that in mind also in global architecture in our case by separating the XML processing from the business logic. Hopefully it is most of the time done directly by the various Web Services framework you are using, you do not code the SOAP request/response, it is hidden by the Web Services framework.

However, in the current application server, the full XML treatment is made directly in the container, for example the XML Encryption is made in the same container that the place where the pure business logic is executed. So let’s find a solution to extract the most intensive XML processing into another part of the system.

Vendors have now in their catalog appliances that could do the job. The same way that today we are using SSL accelerators to deal with SSL encryption/decryption, we can put XML appliance to deal with the intensive CPU processing operation: XML validations, transformation, Ws-Security enforcing point,...

Architecture Overview
The overall architecture could be represented using the following schema :

The role of the XML/SOA Appliance varies a lot depending of your project:

  • Simple XML firewall to check the validity of the XML/SOAP messages
  • Web Services access control: lookup enterprise directory to check authentication and authorization. This could be based on the WS-Security standards and its various tokens (username, SAML, ...)
  • Content generation and transformation: the appliance can be used to serve various devices for example WAP cell phone or simple HTML Web Client. the XSL transformation is done in a very efficient way in the appliance directly.
  • Services Virtualization : it is possible to route the different messages to various end point depending of simple rules. (business or IT system rules)

As you can see from an architecture point of view, XML appliances are very interesting to distribute the heavy processing of XML to some specific hardware. I have noticed that sometimes developers/architects hesitate to put another piece of hardware/software in their design, but I do think that in this specific case it is probably a good move.

Separating the concern is quite easy and very clean when dealing with XML processing, but also it will allow the overall architecture to be managed in a better way. This kind of appliance will allow administrators to centralize the management of policies, and transformations. But also a side effect of this is the simple fact that when dealing with Web Services, you can easily add WS-* support to many stacks that do not support "them".

XML/SOA Appliances Offering
I have said earlier that vendors are offering such products, here some of the product that I have met or pushed:

What's next?
Some of you would probably raise the fact that the application server, especially when dealing with Web Services, must parse the XML/SOAP request even if this has been done by the appliance. Yes it is true, but I am sure that in a next future the vendors of such solution would optimize it by providing for example support for binary XML, or any other solution that will improve even more the performance of the overall IT in complex enterprise architecture. But for this application server must support binary XML first to avoid proprietary approaches.

Another point of view that I have not talk about is the possible support of such appliance around Web 2.0/Ajax optimization. I have not yet dive into this, but I am sure we can do very interesting things too.

Finally if you have experiences with any XML/SOA appliance feel free to post a comment about it, it will help the readers to see the interest (or not) around this topic.

Monday, December 3, 2007

Portal Project: Time to Think about your Social Networking Enterprise Strategy

Most of the enterprises these days have already put in place a portal -- with more or less success. These projects have started most of the time, with the goal of providing personalized information to users and communities. When working in a Portal project you probably define many objectives, that are represented from a technical point of view by the following features:

  • community and group of users
  • easy content management, allowing people to communicate and share
  • data integration of many types of data related to the information needed by each user/community.
I do not see anything special there except that is exactly the same goals that what most of the Web2.0/Social Networking applications do have:
  • User management and creation of the community is something that you do on a daily basis with FaceBook and LinkedIn (and any equivalent sites). The key here is the fact that it is the user that define its own community, not an administrator that does not know “my” business that put me in a specific bucket.
  • Content Management: Blogs are very good example of communication of a single person (or team) to the rest of the enterprise, (or the rest of the world). Wikis are tools helping you to share content with other people in a very efficient way. If you are working with OpenSource you see that most of them are using a wiki to communicate with user. This is true for the documentation, but also any type of content that is related to a project.
  • Data Integration: Web 2.0 is all about RSS feeds and Mashups that are, at least today one of the most efficient way, from a user perspective, to integrate content.
This is why I do believe that if today you are thinking about an enterprise portal for your organization, it is probably time to step down a little and think more about:
  • the “enterprise social networking strategy”, that is often also related to the “Web 2.0 enterprise strategy”.
So some ideas to approach this:
  • create a community with some internet tools, for example start by creating a network in Facebook for your enterprise. Some if you will probably think that it is not productive for the enterprise... Hmm I have to say that it is not directly, but at least it helps people to be familiar with a new way of using the computer and the Internet. Companies I am working in or with do have their network already (Sogeti, CapGemini, IBM, Oracle, ...). An example of this is the way Serena is using FaceBook as part of their intranet and as a tools to do better business. (and some people reactions to this: FaceBook Friday:Bad Idea)
  • if your challenges are around content management start by installing a Wiki in house or using an internet one. I am sure you will be surprised to see the adoption and use in your team. I have many experiences where a regular "Portal/CMS" failed regarding the "community sharing" where Wikis have been a great success.
  • if your challenges are around data integration, I will encourage you to learn more about Rest/RSS and other technologies that are used in mashups. It is true that this one is probably will need more effort from IT to provide the good content feed, but instead of giving the data already packaged in an HTML view (portlet?) do send only the XML using a proper format (RSS/ATOM) and give correct tools to the user, to see how then will be consuming it.
I see this approach more business oriented, this is empowering the business user giving them an infrastructure to select their own tools. Portal the Darwin way kind of approach. So if you have an existing portal, or more important if you are thinking about starting a Portal project, add the “Web 2.0/Social Networking strategy” question to your plan. And to be honest, asking yourself this question about Web20/Social Network does not cost that much but could probably help yourself to satisfy your end users and customers... Note: It is voluntarily that I am mixing up the Web 2.0 (technologies) and the social networking (behavior), since these two are intimately linked. Web 2.0 being the set of tools and technologies facilitating the social networking.

Tuesday, November 20, 2007

Oracle Open World 2007: presentations available online

For the first time since 2001, I was not participating at OOW... As you may know I have moved back to France and now working for a new company Sogeti. So I am quite happy to se that once again all the presentations are available for download there:

I personnaly looked at OracleAS and Java presentations, and especially the one regarding SOA, performances, security and web Services:
Some other presentations that I would like to read/see:
  • Java EE/Java SE/Java Authorization Contract for Containers (JACC) Security in a Nutshell
  • A New Approach to Diagnosing Java Application Performance
  • Next-Generation Web Services Infrastructure and Interoperability
  • Performance Management for SOA Applications
and I will take more time do read some others...

Thursday, November 8, 2007

A Groovier ADF with Oracle ADF 11

Steve Muench has published in Oracle Magazine an article about the use of Groovy in Oracle ADF. In this article you learn how you can do validation and calculation in you business service layer.

Saturday, November 3, 2007

Guillaume Laforge Interview on JavaLobby

I am sure you have seen it before, but just in case... Geertjan from JavaLobby has interviewed yesterday Guillaume, in case you do not know.. Guillaume is the Project Leader of the Groovy project and co-founder of the G2One company.

Interview: What's so groovy about Groovy?.

In case you have not look at it, G2One is offering many services around Groovy and Grails ... directly from the source since Guillaume, and Graeme Rocher are working there... So if you need any help on these nice technologies do not hesitate....

Tuesday, October 30, 2007

The good and bad of PLC ethernet... in hotels

I am traveling visiting partner and pleased to see that I have internet access in my room. Unfortunately it is not Wifi access but not that bad, but with PLC (Power line communication)... So I take my PLC Adapator at the concierge. Plug it in my room and start to surf the web. Performance is good... Now I am looking for another electric plug for my MacBook AC... oh maaaan! I cannot find any other free plug.. except in the bathroom. This is really annoying and stupid... Sorry for this little post about a small and annoying experience.. alone in my PLC bedroom.

Sunday, October 7, 2007

Paris "SOA Forum" feedback; and little comments about SOA projects

This week I have attended a SOA conference in Paris the SOA Forum. (I was not there in 2006). This event is not a technical event targeted towards developers but mainly oriented for IT managers and decision makers. This day was well attended, around 200 people. The content and more important the questions and round tables provide a good snapshot of how SOA is adopted.

If last year, based on comments that I can get, the message was "What & Why SOA?" this year I have the feeling that most of the audience was really familiarized with the SOA concepts -as I said earlier it is not a technical conference- and now they are more asking "How and When SOA?". Lot of discussions were about how to I start the projects, since in many case the SOA will impact the whole IT, and even more the full enterprise.

Thoughts about SOA project & approach

It is hard to say if the best way to start with SOA is starting from the Top (C level) or from the IT department on a departmental project. To be honest I think it will depend of each organizations; and depends of "why" SOA is a good fit for the enterprise.

I am tempted to say that if the choice is made for a "Time-To-Market" reason I believe that the project will start from a specific business need and be implemented in a "bottom-up" fashion., meaning the IT will quickly put together some services to give some agility to the business. This is something that I have seen many times in the telco industry.

At the other end, when the key factor is about rationalization of the business processes over the whole enterprise, the project is often manage at the IT management level if not even higher. This because this kind of approach will have impact on many departments/people.

Basically like in any project it is important to have:

  • good communication between actors that could be developers or departments
  • share the same goals
  • have an understanding of the technologies that will be used and their constraints.
If for the point 1 & 2 this is management that deals with this. For the 3rd one, we are closer to the technology where we can probably share the most -saying that because I believe that most of you, reader, are technical people. At the end of the day we do not build system with slideshows, but with products/solutions. So it is part of our job to take time to understand the pros/cons, limitations of the different products that will be involved in the project.

One example, is this week I have visited a customer and this customer wants to put in place an ESB to provide services to the different departments of the enterprise. Discussing at the global level of the architecture we all agreed on the different needs such as: connectivity to heterogeneous systems, transformation, routing, ...

Then the customer talk about "Web Services" again and again, this is where I have to say, I always try to slow down the discussion to set the expectation at the correct level, for example talking about impact on reliability, security of the HTTP/SOAP based Web Services. Don't get me wrong I am not saying that it is not possible to achieve correct QoS (Quality of Services) with Web Services but it could have an impact on the product choice, for example supporting WS-RM, WS-Security or even using proprietary approach for stateful Web Services, ... And the same comments, questions could occur with other part of the stack.

In conclusion, independently of the type of approach you are taking to put in place a Service Oriented Architecture, you will need sometimes to really understand well the product/solution you will be using to implement it. And for each of the options you will be choosing take some time to estimate the pros/cons and limitations of it. The same way you are taking time to list the different services, their granularity, their QoS, you need to take some time to analyze the different solution. For example when you choose to use an ESB, BPEL engine with their connectivity capabilities, what are the best way to connect to a system (SOAP, JMS, JDBC, JCA, Java, ..), how to code the logic (Java, BPEL, business rules, ...) and for each of this question think about the impact of it on your system. For example, how portable will be my code/business process, and is it important for me?

Tuesday, September 25, 2007

Derek Sivers's blog: 7 reasons I switched back to PHP after 2 years on Rails

The new post on the Ruby section of O'Reilly authored by Derek Sivers is quite interesting, starting with the title:

I am far away of being a PHP expert, or even a Ruby one, but I have the impression that I could post a similar title with Java instead of PHP. If this is true that Java EE could look a little complex for a start -this is probably less true today with the new JavaEE simplifications-. Yes... when you compare Rails and Java alone it is more complex but we should not forget that Java is now more a platform than a simple programming language. And many developers and companies have built very productive solution on this platform.

Since I am talking about Ruby on Rails here, it is important to mention again Grails and Groovy that provide on the Java platform a simple and productive way to develop applications, and time to get back to the different reasons mentioned by Derek in his post:

#1 - “IS THERE ANYTHING RAILS/RUBY CAN DO THAT PHP JAVA CAN’T DO? … (thinking)… NO.”
I believe that we will all agree on the fact that you can do anything you want in Java; Web applications, mobile applications, operating systems, rdbms, ... the only limit is your brain! -and your skills ;) -

#2 - OUR ENTIRE COMPANY’S STUFF WAS IN PHP JAVA: DON’T UNDERESTIMATE INTEGRATION
I think this is one of the key point here. Enterprise is using JavaEE a lot and it is part of the IT, moving to another technology will be expensive even if development is faster. In addition, the developers, administrators are used to develop and manage Java based applications.

And I do not want to talk about how complex it could be when you are building a Rails application on an existing database, designed from a pure Entity/Relation methodology....

#3, #4 #5 - I have nothing special to say here...

#6 - I LOVE SQL
I still see a lot of developers using SQL directly in Java programs. The nice thing about Java is the fact that based on your skills and what you like to do you can choose the way you want to access the database, simple SQL, powerful O-R Mappings, ...

#7 - PROGRAMMING LANGUAGES ARE LIKE GIRLFRIENDS: THE NEW ONE IS BETTER BECAUSE *YOU* ARE BETTER
I love this reason, but nothing special to say, I let you read the original post.

As you can see from the number of comments in Derek's blog -no times to read all of them- this entry generates lot of reactions.

Tuesday, September 18, 2007

IDTVG and Co: how to merge meetic and expedia

With all the Web 2.0/Social Networking noise we are all used to "virtually socialize", but now you can use it to do more and improve the quality of your trips

The site IDTGV and Co (only in French so far) allows you to enter your profile and hobbies. Then when you do a reservation for the TGV (high speed train) you can match it up with other travelers. I have not tried this service yet since I am mainly traveling in the north of France but I will for sure try it as soon as I can.... Let me know if you have tested it.

Saturday, September 15, 2007

Prototype Windows: the best way to create "Web 2.0" windows

I am sure that most of you already know the "Prototype Windows" project that provides a very powerful way to create windows and dialogs inside your Web pages. If you do not know it, take a look it's awesome! Sebastien Gruhier, aka Mr Proto, and others have done a terrific job allowing developers to integrate exciting features with few lines of code. Find more on the PWC site or on Mr Proto's blog. In addition to the Windows API, you can also take a look to the Tranparent Message, Prototype Carousel and Prototype Graphics projects

Tuesday, August 7, 2007

Java 101: Generate a unique identifier with java.util.UUID

A friend of mine was asking me how to generate a unique ID for his application... As you probably already know Java SE 5 has introduced the java.util.UUID class to easily generate Universally Unique Identifier (UUID). As usual Wikipedia is a great starting point to learn more about UUID.
Generating the unique ID is as simple as calling the method UUID.randomUUID() in the class. This will give a new instance of UUID that you can now manipulate; for example do a toString() to get the UUID string representation as describe in the specifications; for example 5462dc18-4653-42d1-b4e4-22fc970a6ce5

Resources:

Thursday, August 2, 2007

OracleAS, OC4J and Java EE releases....

This morning I was helping a customer to debug some Web Services deployment issues, when I simply realized that the error was coming from the fact that he was trying to deploy a JAX-RPC service on a OracleAS 10gR2 server; where it is not supported/available. This give me the opportunity to clarify the different versions of the Oracle Application Server and their related Java Enterprise Edition release support.

Oracle AS Release J2EE/Java EE Release Comments/Extensions Certification Matrix
11.1.0.0 Java EE 5.0
  • Currently available as technology preview
10.1.3.x
(Oracle AS 10gR3)
J2EE 1.4
  • Support of EJB 3/JPA
  • Web Services Annotations
  • MTOM support (10.1.3.1)
  • Integration of Spring 2.0 (10.1.3.2)
  • Integrationf of Oracle Coherence (10.1.3.3)
OTN Certicification Matrix
10.1.2.x
(Oracle AS 10gR2)
J2EE 1.3OTN Certicification Matrix
9.0.4.x J2EE 1.3OTN Certicification Matrix
9.0.3.x J2EE 1.3OTN Certicification Matrix

Wednesday, July 18, 2007

Visiting Paris with Velib (new bike transit system)

I was in Paris last week end so I took this as a good opportunity to visit the city using the new "Velib" system. Velib is a new self service rental bike system that the city of Paris and JCDecaux put in place on July 15th. So you can take and return any of the 10,000+ bikes in any of the 750 locations all aroun Paris. I believe that Paris wants to a total number of 20,000 bikes for  1,400 locations.

The concept is really simple, you can take a bike for 1 euro day and it is free for 30mn, supplet of 1 euro will be charge for additional 30 mn then 2euros for the next one, ... The idea is to use the bike for short periode of time, return it to a station and take another one after 5mn. So I have been enjoying the city all Sunday for only 1 euro, it was really nice to be able to ride
under the Eiffel tower, les Invalides, Place Vendome on all these very nice and romantic parisian places. Not only is it probably one of the best way to visit Paris as a touris but also it is good for the environment...
One the flip side, I need to say that Parisian drivers are not that nice with bikers, even with the 230 miles of bike lanes...
From a technical point of view, the rental system is really nice,  the bike stations have a nice and simple to use system allowing you to take a bike, see your balance and they are all connected together allowing you to take and return bike anywhere in Paris. I will try to find more information about this application that is probably quite fun, and hopefully not like the www.velib.paris.fr site, the stations are available in multiple languages.

Tuesday, July 10, 2007

BPEL in Cluster: In which node my process is working

I was helping a customer with his BPEL in cluster and we needed to follow the flow and on which machine the instance was running.

I simply use a bpel:exec activity with the following code:
java.net.InetAddress addr = null;
try {
  addr = java.net.InetAddress.getLocalHost();
}
catch (Exception e) {
System.out.println("EXCEPTION :"+ e);
}
setVariableData("HostNameVariable", addr.getCanonicalHostName());
This code is just an example of what could be done. Here I am using java.net code API and put the result in a BPEL global variable using the setVariableData method. Obviously you will use appropriate code to differenciate the different nodes for example the name of the OC4J instance, hostname, ... or any interesting value.

Monday, June 4, 2007

Using your Built-In iSight with Parallels (and VMWare)

It is probably an old tipe, but I have just configured my Windows XP Parallels VMs to use my MacBook buit-in iSight Web Cam using the driver that you can find here: - Download iSight Driver for XP The site states that it does not work with Parallels, but I am using the release Build 3170 RC3 and I do not have any issue.

  1. Start your VM
  2. Download the Driver & Unip zip
  3. Grab the Built-In iSight using the Devices > USB menu
  4. Point the Windows Devices Manager Installer to the location of the Unzipped folder
  5. and you are done...

Friday, May 25, 2007

Endangered Peregrine Falcons Return to Oracle HQ

Peregrine falcons have returned to Oracle's campus in Redwood Shores, California. You can watch the newborns on the Oracle Falconcam. Read more and watch videos on Oracle's Site.

Monday, May 21, 2007

Oracle Development Kit for Spring

To help you better understand the support Oracle offers to Spring developers, everything you need to get started with Spring on Oracle Containers for Java EE is now available in the Oracle Development Kit for Spring. Whether you're new to Spring or an old hand, you're sure to benefit from the contents of the Development Kit:

  • A comprehensive set of How-To examples illustrating Spring-OC4J integration
  • The Oracle Developer Depot Web application, which enables you to deploy and run the How-To projects on OC4J
  • A Spring extension to JDeveloper, Oracle's free Java IDE
  • Supporting documentation and white papers
The Kit is available as a self-extracting ZIP archive. Note that you will need Oracle Containers for Java EE (10.1.3.2) or higher to use all of the How-To projects provided.

Wednesday, May 16, 2007

OracleAS & JDeveloper: JavaEE 5.0 Technology Preview

During JavaOne last week Oracle has announced the availability of a the new JavaEE 5.0 Technology Preview of Oracle Containers for JavaEE and JDeveloper (release 11). Find more information on OTN:

Wednesday, April 18, 2007

Using Groovy within Oracle Data Integrator

As you may remember, Oracle acquired few months back a data integration solution from Sunopsis, and has integrated it in our product under the name "Oracle Data Integrator" (ODI).

One of the first thing that I look when we got this product was the support for Scripting technologies, since it makes lot of sense to have such support in any ETL. And yes ODI has support for Jython (thought BSF). So when the dev team joined Oracle, I've asked the following question "did you try to use Groovy?"... I personnaly did not take the time to test, but one of the developer did and document it in his blog: "Using Groovy and ODI" from Thierry. When I get a chance I will provide a more complete sample of using Groovy in Oracle Data Integrator.

Tuesday, April 3, 2007

Oracle Develop 2007: conference near you from Oracle

Oracle is has started to deliver the "Oracle Developer 2007" conference. In this two days even you will learn more about multiple technologies: Enterprise Java, SOA, .NET, Databases and PL/SQL, as well as Ajax, PHP, Spring, and more.

This event is organized in 4 different tracks for developers:

Find an Oracle Develop event near you:

I will be presenting the Java Developer conference and SOA in Munich, Prague and London at the end of June... see you there !

Thursday, March 29, 2007

Online Public Libraries: Google Books and now.. Europeana

I am sure that you know about Google Books: http://books.google.com/

Even if I truly believe that Google wants the good by publishing all this information for free - We all remember the sentence: "Don't be evil" that is part of the Google code of Conduct-. I think it is not a good idea to have only one service that provide access to the "world culture"... Competition is always good for consumer...

The French National Library (BNF) and some other public libraries (Hungarian, Portugal) have created a new site to offer a similar service in beta: http://www.europeana.eu. It is true that currently the list of books is really small compare to Google but I am inviting you to use both of then.

Friday, March 23, 2007

Tangosol is joing the Oracle family

During The Server Side Symposium in Vegas, Thomas Kurian announced that Oracle is acquiring Tangosol, during the keynote, Cameron Purdy (Tangosol's CEO) has demonstrated how cool Coherence can be, and they have presented how it could be used in the context of XTP (Extreme Transaction Processing). Soon more to come about this in the different technical side and blog of the Oracle's community.

Grails vs Rails Performance Benchmark

Graeme, the Grails Project Lead has published a very interesting benchmark of Grails versus Rails applications, that is available on the Grails wiki: I let you read and comment on the Wiki the results... Grails development team is open to comment and improvement of the bench to capture as much information as possible. It is also important to note that performances, productivity are very important when choosing a development environment; but something that is also key for enterprises, is the fact that Grails/Groovy "are" Java/J2EE based. This means that a Grails application is packaged, deployed, administered and monitored like any applications that already exist in the information system on J2EE application servers.

Wednesday, March 7, 2007

JavaEE 5 Features of OracleAS 10gR3

OracleAS 10g R3 (10.1.3.x) is a certified J2EE 1.4 container, but OracleAS provides already support to some of the features of the Java Enterprise Edition 5: JavaEE 5. One of the key driver of the new EE version was simplification of the development and deployment applications. Here is the list of the JavaEE 5 features that are supported in OracleAS 10gR3 that will simplify the development of applications (in comparison to a standard J2EE 1.x development):

  • Java Persistence API (JPA) and EJB 3.0 (documention)
  • Support of shared library at the EAR level (<library-directory> / applib). (documentation). This comes in addition to the OracleAS 10gR3 classloader framework that allows administrators to create, and version shared libraries that can be used into applications by referencing them in the deployment plan.
  • Annotations Based Web Services (JSR181) that could be used for Java classes and EJB3 Session Beans (documentation)
  • Referencing resources using annotations in the Web container: @EJB, @Resource, @Resources, @PostConstruct, @PreDestroy, @PersistenceUnit, @PersistenceContext, @WebServiceRef, @DeclaresRoles, @RunAs (documentation)
Hope that this small summary will give you the opportunity to test some of the features of OracleAS 10g.

Tuesday, March 6, 2007

Oracle donates Toplink to Eclipse

Oracle has announced yesterday during EclipseCon in Santa Clara (California) that it open-sources Oracle Toplink as part of the Eclipse Project.

The idea is to open source all the features of Toplink (ORM/JPA, OXM/JAXB, and EIS support), but also features that are currently under development and will be part of the Eclipse project:

  • Service Data Objects (SDO) implementation and SDO Data Access Service (DAS) that leverages JPA for use with SDO.
  • XR (XML-Relational) that provides a completely metadata driven approach to obtaining relational data as XML.
  • DBWS which exposes XR as a web service. With DBWS, you can easily build web services that access relational data without any programming.

One part will be kept by Oracle, this is the "glue" code that is used for the integration with OracleAS that is probably not useful for anybody but Oracle.

For details check out the press release and the FAQ.

If you are at EclipseCon do not hesitate to visit the Oracle booth to learn more about this great news for the Java developers.

Friday, March 2, 2007

Netbeans : OC4J support available

It has been a long time that I did not look in the update center and development wiki of Netbeans. And I have been very pleased to see that it is possible now to register OC4J 10g as a server in Netbeans 5.5 (and 6.0). To add it in your environment just do a :

  • Tools > Update Center
  • Select "Netbeans Update Center Beta"
  • Select OC4J 10g
You can then configure a new Server and run/stop the server from your IDE. You can follow the development of this plugin directly in the Netbeans Wiki OC4J Support page.

Tuesday, February 27, 2007

Spring and Oracle: I21 blog entry about Oracle contribution to Spring

Rod Johnson in the Interface21 team blog entry named "Oracle Contributing Oracle Application Server Integration Code to Spring Framework" described the contribution of Oracle to Spring framework.

This contribution allows Spring applications to leverage the OracleAS transaction manager and its features. In addition to this contribution and some previous investments of Oracle in Spring, see the Oracle and Spring page of OTN; Oracle continues to invest more and more in Spring, as contributor or as user since, as stated by Rod, Spring has an important roles in Oracle Fusion Middleware, and its upcoming Services Component Architecture offering.

Monday, February 26, 2007

OC4J tip: changing the server information

When you are running OC4J in stand alone mode you are using the HTTP server that is bundle with it. This HTTP server returns by default for the HTTP information the following information: Server: Oracle Containers for J2EE If you want to change that you just need to set the http.server.header property. For example, java -Dhttp.server.header="My blog on Oracle" -jar oc4j.jar will now look like:
HTTP/1.1 200 OK
Date: Mon, 26 Feb 2007 21:52:53 GMT
Server: My blog on Oracle
Last-Modified: Mon, 09 Oct 2006 19:17:10 GMT
Accept-Ranges: bytes
Content-Length: 19882
Connection: close
Content-Type: text/html

Thanks to James Kirsh for this very useful tip...

Thursday, February 22, 2007

The first International Grails eXchange 2007

Packed with presentations on Grails, Groovy, Ajax & Web 2.0 and JavaEE and the core technologies that support the Grails technology, the first Grails eXchange conference (London from May 30th to June 1st) will be the place to be for any member of the Groovy/Grails community... You can already register on the conference web site: http://www.grails-exchange.com

Come to see speakers including Grails project lead Graeme Rocher, Groovy project lead Guillaume LaForge, creator of Spring Rod Johnson, Dojo's Alex Russel and Dylan Schieman as well as speakers from technology-leading organisations such as Google, Interface 21, JBoss, Oracle & Sun Microsystems

Tuesday, February 20, 2007

Groovy 101: Extracting XML from your database

In the previous entry I showed how you can easily take an XML feed and insert the content in the database. Let's do the opposite now, meaning taking the data out of your database as XML. In this post I am using the Sql Dataset again but to create an XML document, using the Groovy MarkupBuilder.

import groovy.sql.Sql;
import groovy.xml.MarkupBuilder;

def sql = Sql.newInstance("jdbc:oracle:thin:@//tgrall-linux:1521/XE",
                                      "HR", "HR", "oracle.jdbc.driver.OracleDriver")
def set = sql.dataSet("EMPLOYEES");

def writer = new StringWriter()
def xml = new MarkupBuilder(writer)

xml.employees() {
  set.each { emp ->
    employee(first: emp.first_name , last: emp.last_name) {
      email( emp.email )
    }

  }
}

println writer.toString();
As you can see, I use the builder to create XML Elements and attributes employee(first: emp.first_name , last: emp.last_name), I do reference the current record of the dataset (emp), and all this in very simple and concise code. This will give a result like:
<employees>
<employee first="'Steven'" last="'King'">
  <email>SKING</email>
</employee>
<employee first="'Neena'" last="'Kochhar'">
  <email>NKOCHHAR</email>
</employee>
<employee first="'Lex'" last="'De">
  <email>LDEHAAN</email>
</employee>
...
</employees>

So once again quite simple.

Sunday, February 18, 2007

Groovy 101: Importing XML in your database

A friend of mine was looking for an easy way to import some XML content in his database. You have many ways to do it. But the easiest for a Java/Groovy developer is to use Groovy, and I have create this small example for him.

Groovy provides really simple solution to parse XML and manipulate your database. The following sample reads an RSS new feed and import the title and link in a table named NEWS that contains two columns TITLE and LINK.


import groovy.sql.Sql;

def rssFeed = "http://www.javablogs.com/ViewDaysBlogs.action?view=rss";
def xmlFeed      = new XmlParser().parse(rssFeed);

def sql = Sql.newInstance("jdbc:oracle:thin:@//tgrall-linux:1521/XE",
                         "GROOVY",
                         "GROOVY",
                         "oracle.jdbc.driver.OracleDriver")
def set = sql.dataSet("NEWS");

(0..< xmlFeed.channel.item.size()).each {
   def item = xmlFeed.channel.item.get(it);
   def title = item.title.value[0];
   def link = item.link.value[0];
   println("Importing $title ...");
   set.add(TITLE: title, LINK: link);
}

First I create a Groovy SQL object and a DataSet to manipulate my data. sql.dataSet("NEWS"). Do not forget, if like me you are using Oracle database, to add the Oracle JDBC driver to your classpath ;-)

Then I create a loop on each items of the RSS feed I am using: (0..> xmlFeed.channel.item.size()).each {...}. As you see, Groovy XML help me to parse, and navigate the XML document.

Like any Groovy iterator you have access to an implicit object available in the loop "it", so I can get the item using the Groovy XML : xmlFeed.channel.item.get(it)

Then you can get the different values you want of the element.Usingthe dataset.add method, you can insert them in the table.This is done using the value pairs notation column:value, this looks like: set.add(TITLE: title, LINK: link)

Thursday, February 15, 2007

Oracle Web Services: Sharing Session between client calls

OracleAS Web Services Runtime provides a support for stateful Web Services that is based on HTTP /Servlet session. Some people will probably say that Web Services should not be stateful, or at least not based on the protocol... However, today most of Web Services are using HTTP, and in some specific cases it is very useful to be able to have a state.

In this post, I am not explaining how to enable stateful services and clients, since it is documented in the Java Classes and Stateful Web Services chapter of the developer guide. Here I am show you how you can using client side programming share the same state (session) between different web services calls (even different services running in the same server side application).

The tip used here is about the association of cookies to the client instance (JAX-WS Stub or Call object). Here the code you have to write to do that using DII, will be very similar when using static Stub

1. Enable the state management

...
Service service = sf.createService(qName);
QName port = new QName("CartService");
Call call = service.createCall(port);
call.setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.valueOf(true));  // this is necessary to be able to manipulate cookie
...

2. Create a Map that contains the Cookies and assign it to the call (or Stub)

... Map cookieMap = new HashMap();
call.setProperty(ClientConstants.COOKIE_MAP, cookieMap);
...

This specific step associates a map that will contains all the cookie with the call/stub instance. You will be able then to manipulate the Map to get or set the cookies.

3. How to get the JSESSION cookie

private Cookie getJSessionCookie(Call call) {
   Map cookies = (Map)call.getProperty(ClientConstants.COOKIE_MAP);

   if (cookies != null && !cookies.isEmpty()) {
       Iterator it =  cookies.values().iterator();
       while (it.hasNext()) {
           Cookie cookie = (Cookie)it.next();
           if (cookie.getName().equals("JSESSIONID")) {
               return cookie;
           }
       }
   }

   return null;
}

Note that the Cookie object is an instance of Oracle HTTPClient.Cookie.

4. Utilizing the Cookie

So now you have all the information to be able to get the Session information when the stateful conversation has started;

In this example each time the call.invoke() is done, a counter is incremented on the server.

Call call = service.createCall(port);
call.setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.valueOf(true));  // this is necessary to be able to manipulate cookie
 Map cookieMap = new HashMap();
call.setProperty(ClientConstants.COOKIE_MAP, cookieMap);
... // The session will only be created after the first invoke
 call.invoke(...); // counter = 1 call.invoke(...); // counter = 2 since on the same session

... // the session is now created so you can get the cookie
 Cookie mySession = getJSessionCookie(call)
...

You can now use the cookie in another call using the following code:

mySession ..  // was extracted from the call #1
...// now I am creating a new call instance (myNewCall) that could be in another class
Call myNewCall = service.createCall(port);
myNewCall.setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.valueOf(true));  // this is necessary to be able to manipulate cookie
Map cookieMap = new HashMap();
// add the cookie to the map this will add the cookie to the HTTP request so it will be associated to the same session (/state)
cookieMap.put(mySession,mySession);// associate the cookie Map to the call
myNewCall.setProperty(ClientConstants.COOKIE_MAP, cookieMap);
...
myNewCall.invoke;  // counter = 3 since we share the same session
...
Using this sample you have 2 instances of a client calling a service and reusing the same session -state-. You can also use the same approach to have 2 different clients talking to different services and share the same session. To do that you will have on the server side to use the HTTP Session directly to store your data between calls, and share it between services.

Oracle Application Server 10gR3: iHat

When preparing a complex topology, where you have multiple HTTP servers ,talking with many OC4J instances, it is sometimes hard to understand what is going on. Oracle Application Server Control provides the complete view of your topologies in different pages. If you want to have a quick overview of your topology, you may want a more graphical view of your Oracle Application Server instance.

One of the tool that I use a lot to present OracleAS and its components is OracleAS Hi-Av Tool 10g (10.1.3) also known as iHat. This utility uses Oracle Process & Notification Manager (OPMN) to gather information of all the components used in your topology, representing it in a nice graphical viewer. In addition to use iHat to show the different components, I do also use that to validate my configuration.


iHat Grid View

In this case I am showing a specific instance, that contains 3 OC4Js instance, with 2 of them that are in the same group. When using iHat you will notice that you can, in addition to have some monitoring information start, stop, restart the different components directly from the view. How do you install and start iHat?

1- Download iHat from Utilities for Oracle Application Server 10g OTN page

2- Unzip it, and this becomes the $IHAT_HOME

3- You have an ORACLE_HOME that is pointing to one of the OracleAS instance, so you can start iHat using the follling command:
java -cp $ORACLE_HOME/opmn/lib/optic.jar:$IHAT_HOME/ihat.jar oracle.ias.opmn.ihat.WebServer 8181 $ORACLE_HOME

Using this command, iHat is starting an HTTP server on port 8181, and use the OPMN configuration of the $ORACLE_HOME that I you have entered as parameter. iHat provided other parameters such as the host-name and OPMN port if you want to connect remotely without dependency on the $ORACLE_HOME. All this, is documented in the readme file located in the iHat folder.

Wednesday, February 7, 2007

New Groovy Plugin for Oracle JDeveloper 10g

You can find a first release of the Groovy extension for JDeveloper on the Groovy site:
 http://groovy.codehaus.org/Oracle+JDeveloper+Plugin

The plugin creates a new JDeveloper library for Groovy 1.0, allows you to create and run scripts. I hope to be able to provide more feature such as syntax coloring, structure recognition, ... lot of ideas here...

Wednesday, January 31, 2007

Grails 0.4 Released...

The Grails developer team is pleased to announce the release 0.4 of Grails. The release can be obtained from the downloads page.
Notable improvements include:

  • ORM enhancements with support for more relationship types, easy transactions and criteria building, constraints to SQL schema mappings, and upgrade to Hibernate 3.2
  • All-new non-invasive plugin system for writing reusable plugins for Grails applications
  • Greater Spring integration thanks to a new syntax for scripting Spring (http://grails.org/Spring+Bean+Builder) and an upgrade to Spring 2.0
  • Easier unit testing of controllers and custom taglibs
  • Validation improvements, including support for inherited constraints and simplified size constraint handling
  • Automatic encoding of unsafe HTML characters and URL parameters in all scaffolding and taglibs
  • Fixes to support Grails on more containers such as GlassFish and over 200 issues and bugs resolved in JIRA
  • Grails now ships with Groovy 1.0!

Tuesday, January 30, 2007

Oracle JDeveloper (10.1.3.2) / WebCenter available for download

Oracle JDeveloper (10.1.3.2.0) extends the SOA development features from the previous release by introducing the Oracle WebCenter extension. Oracle WebCenter Suite combines the standards-based, declarative development of JavaServer Faces (JSF), the flexibility and power of portals, and a set of integrated Web 2.0 services to boost end-user productivity. Oracle WebCenter Suite provides the tools and services to embed portlets, content, customizable components, Web 2.0 content, collaboration and communication services directly into your JavaServer Faces (JSF) application. These WebCenter features are in addition to the large set of new features that were introduced in Oracle JDeveloper 10.1.3.0 and 10.1.3.1.0. For more information on WebCenter, visit the Oracle WebCenter Suite page on OTN.
  o Build Portlets
    o Build JSR 168 portlets
    o Build Oracle PDK-Java portlets
    o Expose JavaServer Faces (JSF) applications as portlets
    o Preconfigured OC4J within Oracle JDeveloper
  o Consume Portlets
    o Consume JSR 168 portlets through WSRP
    o Consume other WSRP portlets
    o Consume Oracle PDK-Java portlets
    o Inter-component communication
  o Business User Web 2.0 Enterprise Mashup Tools
    o Rich Text / Blog Portlet
    o WebClipping Portlet
    o OmniPortlet
  o Runtime Customization
    o showDetailFrame
    o panelCustomizable
  o Integrate Content using JCR 1.0
    o Access content using data controls
    o Access to many content repositories
  o WebCenter Services
    o Secure Enterprise Search (SES)
    o Oracle Communication and Mobility Server (OCMS)
    o Oracle Content Database
    o Discussions
    o Wiki
  o Declarative Security
    o ADF Security Wizard
    o Authorization Editor

  o Lifecycle Tool
    o Embedded Lifecycle Tool
    o Command Line Lifecycle Tool
    o ANT Tasks

Some links:
  o New
Features

  o Download

Saturday, January 27, 2007

JDJ Review: Oracle JDeveloper An IDE Worth a Second Look

jdev_cup_w.pngAs the saying goes you never get a second chance at a first impression. In general, that's true, but if you've been thoroughly revitalized, matured, and cosmetically re-engineered, shouldn't you get a second shot at that first impression? I'd argue that's true of Oracle's Java/J2EE Workbench, Oracle JDeveloper.
- Java Product Review — Oracle JDeveloper An IDE Worth a Second Look

Monday, January 22, 2007

Apple released beta version of Dashcode

Dashcode is a new application for developing Dashboard widgets coming in Mac OS X 10.5 (Leopard). This tools is already available as developer preview on Tiger.

I have installed it and it is really great, easy to use, helping you to create good looking widgets. As usual, like all the Apple development tools it is really intuitive. More than a long blog entry on this I am just pointing you to the DashCode page on the Apple site:
- Dashcode

Thursday, January 18, 2007

Using Oracle Data Integrator on Mac OS X

Oracle just released on OTN a new product "Oracle Data Integrator" (ODI), I wanted to quickly take a look to the product, so I have downloaded it and installed it on my Mac. This product is a 100% Java based solution that you can quickly installed on mac following these steps:

1- Download and unzip ODI from OTN download page (bottom).

2- Open a terminal Window and go to the folder where you have unzipped ODI, you should have the following content:
    - external
    - index.htm
    - oracledi
    - oracledilwd
    - oracledimn
    - setup

Open the index.html and select the Getting Started Guide, this will help you to learn more about ODI using a comprehensive scenario.

3- Setup the environment variables:
   > export ODI_JAVA_HOME=/Library/Java/Home/   (need to be Java 5)
   > export ODI_HOME=<path to ODI installation folder>/odi/oracledi

 

4- Go to the  $ODI_HOME/bin
   > cd
$ODI_HOME/bin

5- Start the HSQL databases that contain the sample application and data:
   > ./startdemo.sh &

This command starts 3 different instances: repo (metadata repository), src (source db), trg (target db) that are used in the Getting Started guide. To stop the DB run the script ./stopdemo.sh .

6- You can now start the designer too using the command:
   > ./designer.sh &

Select the Getting Started project and when you are in the designer switch to the Mac OS X look and feel ;-), using the Menu "Look And Feel > Standard > Mac OS X".



These are the first steps to start with Oracle Data Integrator, you can now follow the Getting Started Guide, to learm more about the product, and since your environment is set you can run any of the command documented in this guide.

Monday, January 15, 2007

Monday, January 8, 2007

Oracle JDeveloper Features Matrix

Not familiar with Oracle JDeveloper? Take a look to the new Oracle JDeveloper 10g (10.1.3.1) matrix, this document exposes in a simple matrix the different features of the Oracle Java, J2EE, SOA development environment...
- Oracle JDeveloper 10.1.3.1.0 Feature Matrix

You can find all the information and download this free Java IDE from OTN.

Sunday, January 7, 2007

How to use SOAP Compression using JAX-RPC, on OC4J

HTTP compression has improved a lot the download time of content from servers. In the context of Web Service it could be very interesting to also use HTTP compression to improve the network traffic. Firs, I am explaining how to compress a SOAP response when you have a Web Service running in Oracle Containers for J2EE (OC4J) using a generic servlet filter. I have to give credit to http://www.thomas-bayer.com/ since he has created the Filter and documented how to do such thing using Axis. 

So you can take a look to the following article for more details, you can read the 2 following article, or jump to the next paragraph that explains how to configure your JAX-RPC based service to send compressed HTTP response.

In this sample I am showing how to compress the SOAP response using a servlet filter, it is also possible to use some other Oracle infrastructure element to achieve that such as Oracle HTTP Server/Apache, or Oracle Webcache.

1- Install the compression filter library in your application

    Download the compression filter library 2wayfilter-1.2.jar and copy it into the Web application's WEB-INF/lib folder

2- Configure your application to use the filter

    The configuration of a servlet filter is done using the web.xml where you reference which servlet or URL will be using the filter. As you may knowin JAX-RPC, the HTTP endpoint of a service are exposed as servlet and defined in the web.xml. You can choose to compress all the endpoint/URL or create a new servlet mapping, that will become a new SOAP endpoint and only compress this one. If you take the option of creating a new endpoint keep in mind that it will not be added to the WSDL automatically, so the client application will have to point explicitly to the compressed endpoint URL to take benefits of it.

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     version="2.4">
    <servlet>
        <description>Web Service CustomerServiceSoapHttpPort</description>
        <display-name>Web Service CustomerServiceSoapHttpPort</display-name>
        <servlet-name>CustomerServiceSoapHttpPort</servlet-name>
        <servlet-class>demo.oracle.CustomerServiceImpl</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CustomerServiceSoapHttpPort</servlet-name>
        <url-pattern>CustomerServiceSoapHttpPort</url-pattern>
    </servlet-mapping>
   
    <!-- New servlet mapping to handle compressed SOAP Messages -->
    <servlet-mapping>
        <servlet-name>CustomerServiceSoapHttpPort</servlet-name>
        <url-pattern>CompressedCustomerServiceSoapHttpPort</url-pattern>
    </servlet-mapping>

   
    <!-- Filter definition with mapping on the compressed endpoint -->
    <filter>
        <filter-name>2WayFilter</filter-name>
        <filter-class>com.osmoticweb.gzipfilter.GZIP2WayFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>2WayFilter</filter-name>
        <url-pattern>CompressedCustomerServiceSoapHttpPort</url-pattern>
    </filter-mapping>   
   
</web-app>

You can now package and deploy your application.

3- Create & Invoke the service

In this basic configuration you have only changed the servlet that is the HTTP endpoint of your service. So the compressed endpoint is not present in the WSDL, but you can use any of the URL to create your proxy.

When you have created your proxy, if you want to access the endpoint that will return the compressed response you must be sure that you are calling the correct endpoint. You can set the endpoint using the setEndpoint method, of your Web Service client.

This is it!
I will in a next post explain how you can using the Oracle Web Service client API send a compressed request that will have to be uncompressed on the server using the same filter.

Tuesday, January 2, 2007

Groovy 1.0 released

Groovy release 1.0 is here now ! You can find the release at the following location: - http://dist.codehaus.org/groovy/distributions/ Congratulations to all the Groovy developers, and users that have done a great job with this language that is here in production. And it is interesting to see that more and more projects are using Groovy as part of their infrastructure to simplify development: - SOAPUI - XWiki - Spring 2 integration - Grails - ... and many development teams in custom projects So once again happy new year to all... and enjoy it with Groovy !