Archive for the tag 'Java'

Mrz 24 2008

Transforming SOAP-Messages with XSLT



In this blog you can read how you can modify SOAP-Messages using XSL Transformation (XSLT). It is the continuation of the previous two blog-entrys How to modify JAX-WS SOAP-Messages and Creating generic SOAP Web Services. I am using the NetBeans 6 – Project from the blog-entry Creating SOAP Web Services with NetBeans 6 to demonstrate the transformed SOAP-Request.

Note:
Download-links to all files are available at the end of this blog.


Introduction

In my previous blog Creating generic SOAP Web Services i have shown a theoretic way to modify SOAP-Messages for your needs. The key for success was using XSLT for the transformations. In this blog i am using XSLT 2.0 for transformations.

Take a look at the Creating SOAP Web Services with NetBeans 6-project. The incoming request must look like this to work:

Technorati Tags: Java, NetBeans, soap, soap message, transforming, web services, xslt

Kommentare deaktiviert

Mrz 08 2008

How to modify JAX-WS SOAP-Messages



This blog is depending on my previous blog Creating SOAP Web Services with NetBeans 6. You can download the needed sourcecode there.

Here i will show how you can modify the JAX-WS SOAP-Message before the outgoing SOAP-Response will pass the specified Web Service Operation. This is sometimes necessary, when some recipients want to receive their own special SOAP-Headers. You can also modify the incoming Request to read special informations, which are included in the SOAP-Header, but this is not part of this posting (maybe i will show it in an other upcoming blog).

For this example i am using JAX-WS 2.1 with NetBeans 6.0 .


ServerSOAPHandler.java

This is the core-class of this example. Before the Request/Response pass the
Web Service Operation, it can be handled here in the method

Technorati Tags: Java, jax-ws, NetBeans, soap, soaphandler, web services

13 responses so far

Feb 27 2008

Creating SOAP Web Services with NetBeans 6



In this blog i will show you, how easily you can create Web Services with NetBeans 6. In further postings i will discuss how to manipulate the SOAP Message before the Web Service Operation is called.

For this example i am using JAX-WS 2.1 with NetBeans 6.0 .


Web Services Description Language (WSDL)

There are many ways how to get starting with Web Services. One variant is beginning with the creation of the WSDL. First, you must know what the Web Service should do. You have to consider what is the input and output of each Web Service Operation. In our example we have only one Operation, named as “getcalculateValues“. The input are two numbers, the result is only the sum of both.

Technorati Tags: Java, NetBeans, soap, web services

69 responses so far

Feb 22 2008

Open existing projects in NetBeans 6

Published by under Java,NetBeans


In this blog-entry i will show you, how to open and work with existing NetBeans 6 -projects. I was forced to write this, because while most of my projects here are created with NetBeans 6. Now watch how easily you can use NetBeans 6 for being productive.
For example, i am using the project “Hibernate with Guice“, you can read this blog-entry here.


1. Installing NetBeans 6

NetBeans IDE is open-source and free and runs on Windows, Linux, Mac OS X and Solaris.
Download: http://www.netbeans.org/
Installation Instructions: http://www.netbeans.org/community/releases/60/install.html


2. Open an existing project

On the menu, navigate to File->Open Project
Open project in NetBeans

Choose the existing project and open it.
Open existing projects in NetBeans 6 part 2

If you see the following error message, don’t get in panic, there are only missing references to needed libraries.
Open existing projects in NetBeans 6 part 3

Click on close. Now let us fix this problem. Make a rightclick on the project-name and select Properties.
NetBeans Project properties

You will now see the Project Properties window. On the left side, navigate to Libraries. In the Compile-Tab, the missing libaries are now visible.
NetBeans Project properties missing libraries

The next thing to do, is to clean up this mess. Just remove all libraries from the Compile-Tab. You can easily do this if you mark one library with the left mouse button and then press STRG + A together.
NetBeans Project properties remove missing libraries

Hit the remove button to clear the list.
NetBeans Project properties missing libraries are removed

The next step is to add the missing libraries. If you have downloaded them, click on Add JAR/Folder, navigate to the directory where the JARs are located, and add them all.
NetBeans Project properties add missing libraries

Close the Project Properties Window. Everything just have to look fine. The Project-Name is now in bold black and not anymore in bold red. Expand the project, you can see all included packages and libraries.
Netbeans projects view


3. Build and run the project

This is very easy. Make a rightclick on the projectname, choose Clean and Build.
Clean and build project in Netbeans

You can see the generated Output in the Output-console.
NetBeans generated output

Run the application by pressing F6 or make a rightclick on the project-name and choose Run
NetBeans run project

That’s it, you have successfully opened an existing project.


3. Working with NetBeans

To explore the java-code, you can navigate through the projects-view or through the file-view.
NetBeans project and file views

To open a file, just doubleclick on the name.

You need more functions? Go to Tools->Plugins.
NetBeans plugins

A huge list of available plugins appears. More plugins are available at http://plugins.netbeans.org/PluginPortal/

Installed NetBeans plugins


Enjoy playing around with NetBeans, you will see it makes fun to work with it.


All the SY0-101 and N10-003 professionals are of the view that before you write 642-812 or 70-431, you should figure out your preferences amongst 350-030 and 220-602.

Technorati Tags: Java, NetBeans, projects

3 responses so far

Feb 21 2008

Hibernate with Guice – Part II



Welcome back to Part II about using Hibernate with Guice. If you just stepped in, i recommend first to read Part I here.


Part II – Adding Guice to the Hibernate-Application

This application uses Guice’s Dependency Injection to create the HibernateConnection-instance and the OrdersDAO-instance. You can see that HibernateUtil don’t need STATICs anymore. Access to HibernateUtil is wrapped through a HibernateConnection which is created in a ConnectionProvider as a Singleton. Providers are acting as Factories in creating and returning Objects.

Technorati Tags: google guice, Hibernate, Java, mysql, NetBeans

5 responses so far

Feb 21 2008

Hibernate with Guice – Part I

Published by under Guice,Hibernate,Java



In this Blog you will see how to add Google-Guice functionality to a Hibernate-Application. In Part I i will introduce a simple Hibernate-Application. In Part II you can see how this Application will be transformed for using Guice.

Note:
This was my first attempt working with Guice, so i think there are many points which can be improved.

But first for these peoples who doesn’t know what is Guice, Guice is a new lightweight Java 5 Dependency Injection Framework. It is working with Annotations. You should not compare Guice with Spring. Guice focus is on Dependency Injection, where Spring has become popular in the Java community as an alternative, replacement, or even addition to the Enterprise JavaBean model. Google produced Guice for one of their biggest applications – AdWords!

Download-links to all files are available at the end of this posting. Comments are included in the source-listings.

Technorati Tags: google guice, Hibernate, Java, mysql, NetBeans

5 responses so far

Feb 17 2008

Installing GlassFish v2 with PHP5 on Port 80

Published by under GlassFish,Linux

Welcome to my first blog entry. It’s about installing GlassFish v2 on Opensuse 10.1 with support for PHP5 and running on Port 80.

Technorati Tags: glassfish2, Java, netbeans6, opensuse, php, quercus

17 responses so far

« Newer Entries