Thursday, February 1, 2007

Writing a simple Axis Web Service

If I am going to be doing any real BPEL development. I really have to be able to make my own web services. I basically stripped out the BPEL and JSP components of the loan approval example.

I created a simple java class that will be exposed as a web service:

Web Service:

import java.util.Date;

public class SimpleWebService {

public String simpleCall(String someString)
throws SimpleWebServiceProcessFault
String response = null;
System.out.println("Calling "+this.getClass());
//do some business logic
Date now = new Date();
response = "*"+someString+"*"+now;
catch (Exception e)
throw new SimpleWebServiceProcessFault("simpleCall", e.toString(),"99");
return response;

You then have to update the service.wsdd file to expose it as a web service:


Something like:

< name="SimpleWebService" provider="java:RPC">

< name="className" value="">
< name="allowedMethods" value="*">


The ant build creates a simplewebservices.wsr and copies it to the /bpr directory

Calling the web service:

Service service = new Service();
Call call = (Call)service.createCall();
String urlString = "http://localhost:8080/active-bpel/services/SimpleWebService";
call.addParameter("someString", org.apache.axis.Constants.XSD_STRING,ParameterMode.IN);

String result = null;
result = (String)call.invoke(new Object[] {"My Call"});
catch (AxisFault af) {
if (SimpleWebServiceProcessFault.hasMagicFaultErrorCode(af))
result = "99";
result = af.toString();
catch (Exception e) {
result = "unexpected exception seen: " + e.toString();

System.out.println("Client result = " + result);

Basically taking the input argument and returning it dressed up with some asterisks and the current time.

Sample run:
Client result = *My Call*Thu Feb 01 20:13:33 MST 2007

You can download the sample simple web service bundle here:


Anonymous said...

is there an easy way to deploy the simple webservice that u r providing as a zip file.

Can it be extracted and the entire folder copied to webapps of the server to make the sevice available?


Anonymous said...

I just discovered the website who reviews about
home business ideas

If you want to know more here it is
home business ideas

Anonymous said...

The writer of has written a superior article. I got your point and there is nothing to argue about. It is like the following universal truth that you can not disagree with: Every bloke has at some stage while taking a pee flushed half way through and then raced against the flush. I will be back.

Buy thesis said...

this kind of blog always useful for blog readers, it helps people during research. your post is one of the same for blog readers.

Masters Thesis Writing

Anonymous said...

[url=]experience with levitra [/url]

[url=]side efect o levitra [/url]
[url=]santa claus levitra jokes [/url]
[url=]levitra quick prescription [/url]
[url=]levitra online shop in uk [/url]
[url=]levitra free levitra find charles edinburgh [/url]
[url=]levitra and hemmhroids [/url]
[url=]buy levitra online au [/url]
[url=]babys lungs and levitra [/url]
[url=]levitra usage information [/url]
[url=]dog heartfailure levitra [/url]
[url=]generic levitra buy levitra online levitra [/url]
[url=]drug generic levitra [/url]
[url=]levitra song lyrics [/url]
[url=]levitra order online [/url]
[url=]levitra and nitroglycern [/url]
[url=]experience with levitra [/url]
[url=]how to get levitra hmo [/url]
[url=]levitra for sale online [/url]
[url=]levitra boy [/url]
[url=]levitra discount drug [/url]
[url=]g postmessage levitra subject remember [/url]
[url=]u 3312 levitra cialis [/url]
[url=]readily available alternatives to levitra [/url]
[url=]anger and levitra [/url]
[url=]confidential overnight shipping levitra overnight [/url]
[url=]pfizer levitra pharmacy [/url]
[url=]levitra cocaine [/url]
[url=]watermelon or levitra [/url]
[url=]sildenafil efectsfrom side levitra [/url]
[url=]side-efects levitra [/url]
[url=]levitra and nitroglycern [/url]
[url=]what is levitra triangle chicago [/url]
[url=]air order travel levitra videos [/url]
[url=]levitra side efects warnings [/url]

Anonymous said... Article directory free for publish your press release and articles !

Anonymous said...

Bu sohbet sitesi tek kelimeyle Muhtes. Sohbet Etmek ve Arkadas, Olmak için Arad? Seçmenin Faydalar?

Anonymous said...

[b][url=][/url][/b] A Louis Vuitton Amelia Wallet is likewise a great choice of xmas present ideas unique. It can be delicately produced from perforated Monogram Louis Vuitton calf leather-based with calf leather-based lining and golden brass items. Eighteen credit card slots are relatively valuable for your good friend.

[b][url=]uggs boots outlet[/url][/b] For those of you who skydive (or those who watched it on Television), you realize that every transfer is important. That why you practice a lot. Knitting has some crucial moves, also. Renowned firms are domestic names. They are really the A-list of corporate global; master-marketers effective at driving residence all of the advantages of size, electric power and presence concurrently because they press the emotional flesh with manufacturers that happen to be pretty cool and have massive personalized charm. Timberland, Mercedes, Vodafone, Nike, Adidas, Mars, Tag Heuer, Everlast, Michelon and Bvlgari attraction for the individualist/collectivist dichotomy in all of us.

[b][url=]louis vuitton handbags[/url][/b] In the course of these fairs, folks come all decked out in medieval-inspired costumes-kings or queens in complete regalia, knights in chain mail armors and medieval swords, and beautiful medieval girls wearing humble costumes that were widespread through all those times. Aside within the clothes, people also recreate the food items and dishes that were served during that time, medieval game titles and pursuits, and even talk in previous English language like a tribute to this period. For anybody that is a person these types of hobbyist or have however to show up at your 1st truthful, you must be genuinely excited to go the following 1.

[b][url=]ugg boots sale[/url][/b] Strategy playdates. Talk to the preschool's director for any class record (or at least several names and quantities), and prepare several playdates so your soon-to-be preschooler may get to understand her new classmates. Some preschools sponsor picnics or potlucks for incoming college students along with their moms and dads; if yours won't, look at arranging your individual potluck or pizza bash on the college playground (with permission) or at a close by park..

[b][url=]uggs clearance[/url][/b] Promptly following all, Belt is a unique needed fashion accessory for guys aside from watches. Factors ought to commonly be initial thing you could ought to aim on, it doesnot subject which kind of products it's possible you'll be buying. Males's belts, leather-based is just with regard to the regular content.

Anonymous said...

Please, keep to the point.
I think, that you are mistaken. Let's discuss.
This information is true
I apologise, but it does not approach me. There are other variants?
I congratulate, the remarkable answer...

[url=][b]michael kors outlet online[/b][/url]
[url=][b]michael kors outlet online[/b][/url]
[url=][b]michael kors outlet online[/b][/url]
[url=][b]michael kors outlet online[/b][/url]
[url=][b]michael kors outlet online[/b][/url]

Anonymous said... hemres bags outlet cheap hermes handbags uk