Wednesday, February 7, 2007

Implementing a Complex Axis Web Service

Well, I really want to do something more elaborate with ActiveBPEL and that will require the ability to write complex web services. I ordered the electronic version of "Developing Web Services with Apache Axis" by Ka lok 'Kent' Tong. I like it because it is real straightforward with working examples. There are also some chapters on Axis Security and Encryption which will definitely be worth reading when I get some time.

Check out http://www.agileskills2.org/DWSAA/index.html for more information.
The code is downloadable without cost.

I had to rework some of the code but I am glad to say that I got the complex web service up and running in the ActiveBPEL environment.

You can download my project for this. It is not in a super tidy state but should get you going.
Download it from Here
There are 2 ant files that I use:

buildTheStubs.xml - This will build the stub java source files for the complex web service

buildAndDeployWS.xml - This will deploy the compile and deploy the web service to ActiveBPEL

I copied them into build.xml when I want to run them each.

There is a client java class StubClient.java which will be able to talk to the deployed webservice.

The web service implementation BizServiceSOAPImpl.java
exposes a method
public ProductQueryResultResultItem[] query(ProductQueryQueryItem[] queryRequest) throws java.rmi.RemoteException, InvalidQuery {
}

which is quite obviously complex in that it does not have any simple types as parameters or return types.


The client works fine except when I try to look at the wsdl for the webservice
http://localhost:8080/active-bpel/services/BizServiceSOAP?WSDL on my machine

I get the following error message that I will try and have a look into:

AXIS error

Sorry, something seems to have gone wrong... here are the details:Fault - makeTypeElement() was told to create a type "{http://foo.com}>>productQuery>queryItem", with no containing element

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: makeTypeElement() was told to create a type "{http://foo.com}>>productQuery>queryItem", with no containing element
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:kepi

1 comment:

Anonymous said...

Hi,

I am also getting the same error. I would be extremely happy if yopu can tell me how it can be fixed.
My Email is kprasad@gmail.com
Thanking you,
Krishna Prasad