Archive

Archive for the ‘Web Services’ Category

RPC/Encoded webservice

When you need to consume a webservice and that service is using a deprecated rpc/encoded binding style, then you are faced with a problem that there is no real good solution to. In short, the problem is that all the JAX-WS implementations from a couple of years back have ommitted their support for this configuration. “The WS-I Basic Profile limits binding styles to either Document/literal or RPC/literal, and JAX-WS was designed to honor this limitation” I can think of a couple of options to work around this problem. Read more…

Publish JAX-WS services at runtime

One smooth way of testing your webservices is to use the lightweight HTTP server embedded into the JDK. This way you don’t have to deploy your services in a (tedious) JEE container, or servlet container for that matter. You can signifcantly improve your turnaround time between coding and deploying. Turns out all that is required is one line of code (at best).

import javax.xml.ws.Endpoint;
//..
{     
    Endpoint.publish("http://deploy/path/", new WebServiceImplementor());
}

Where the URI is the path to the location where you want your endpoint deployed and the second argument is your JAX-WS annotated endpoint implementation object. By the way, you will need at least Java SE 6.

Representing a service both as RESTful and SOAP based using Apache CXF

2012-07-10 4 comments

Apache CXF is an open-source Web Services framework supporting both JAX-WS and JAX-RS. This means that we could create a service and offer it both as RESTful Web Service and traditional SOAP based Web Service. With CXF when you get the WSDL file (we will see how) or WADL (REST equivalent of WSDL) you can pass the link to the ones who are to write a client application and they can use it to configure the plugin and the required code is generated. With Maven things become even simpler. Read more…

Files for RESTful webservices with JAX-RS

I promised in my previous blog post about my seminar on RESTful webservices with JAX-RS that I would write a new post with links to the PowerPoint slides and code examples. So here it is! You have to install the Android SDK to be able to test the Android App. For the service you can use mvn jetty:run to start the server.

PowerPoint slides

Code examples

Seminar on JAX-RS and RESTful services

Last Wednesday I held a seminar on RESTful webservices with JAX-RS. There were about 10 persons present and it went very well I think! At least I got much out of it. I always feel that you learn a lot by teaching others and doing all the preparations and investigations required before the actual gathering.

Read more…

Javascript libraries using JAX-RS implementations

Modern JavaScript libraries are very powerful and efficient. Most of the UI features that one needs in an Enterprise Application are offered by these libraries. This is the faster and easier way to develop applications without reinventing the wheel (with an expense of the fact that we don’t learn Javascript but we learn to use a library). We are talking about jQuery, Ext-JS, GWT/SmartGWT (output is DHTML), Dojo and some more. All these libraries have a lot of fan following and it is easy to get help, also there is a lot of documentation on web. You will find a lot of resources on web about the pros and cons of using the pure Javascript libraries, the point here is to use only Javascript library on client with RESTful Webservices. Why? Read more…

Simple Web Services client using Apache CXF

2012-03-12 1 comment

For the audiences out there who want to consume a web service and make it as simple as one can, then continue reading this article. There are several ways to do it but we will take the simple and straightforward route. Prerequisite is Maven, Apache CXF and of course knowledge about Web services, SOAP and WSDL files.

We shall be using an available web-service on the web and our old school the ‘W3 School’ offers a service to convert temperature from Celsius to Farhenheit and vice-versa.  By the way, this site is also good to get abasic introduction about Web Services. Read more…

Walk through JAXB and JIBX

2012-03-07 2 comments

Most of the audience here might already have worked directly or indirectly (Web Services) with JAXB or JIBX. For those who want to develop or use Web Services, XML knowledge is a must. And after that the question that comes to mind for a Java developer is “How to bind XML data to Java objects”? To make life easy there are frameworks like JAXB, JIBX, Castor, and XMLBeans. So let’s start with JAXB. Read more…

En resa i webservices

Nyligen så har jag experimenterat kring ramverk för webservices i Java-sfären med fokus på prestanda och enkelhet. I java-sfären finns mängder med olika ramverk, stora som små, som förenklar utvecklandet och den initiala konfigurationen för att skapa webservices. Som med alla ramverk så är det svårt att utropa något ramverk som bäst utan olika ramverk lämpar sig olika bra för olika situationer. Kort och gott så har jag koncentrerat mig på ramverk som implementerar JAX-WS eller JAX-RS. Read more…

Follow

Get every new post delivered to your Inbox.

Join 228 other followers