I'm writing a WebService using the Axis bundle for OSGi (this is the same as a stand alone Axis server but running on the OSGi platform).
I'm trying to return a custom object (LocationAlgorithm) when the client does a request for it. LocationAlgorithm holds 2 integers and a String,
a default constructor and getters and setters for the attributes (so it's a JavaBean). Here is the trivial code:

[code name="LocationAlgorithm.java"]

package lbs.webservice.bundle;

public class LocationAlgorithm
private int numberOfMeasurements, intervalBetweenMeasurements;

private String measurementType;

public LocationAlgorithm() {
numberOfMeasurements = 0;
intervalBetweenMeasurements = 0;
measurementType = null;

public int getIntervalBetweenMeasurements() {
return intervalBetweenMeasurements;

public void setIntervalBetweenMeasurements(int intervalBetweenMeasurements) {
this.intervalBetweenMeasurements = intervalBetweenMeasurements;

public String getMeasurementType() {
return measurementType;

public void setMeasurementType(String measurementType) {
this.measurementType = measurementType;

public int getNumberOfMeasurements() {
return numberOfMeasurements;

public void setNumberOfMeasurements(int numberOfMeasurements) {
this.numberOfMeasurements = numberOfMeasurements;


The simple webservice:

[code name="WebServiceImpl.java"]

package lbs.webservice.bundle;

public class WebServiceImpl implements WebService {

public LocationAlgorithm getLocationAlgorithm() {
return new LocationAlgorithm(0, 0, "");


Axis needs to know how to handle the object, so I add the following to the config file server-config.wsdd:

[code name="server-config.wsdd"]

<beanMapping qname="ns:LocationAlgorithm" xmlns:ns="LBSWebService"


When I load the WebService, a wsdl is generate.
In the wsdl it is clear the Axis server recognizes the LocationAlgorithm type:

[code "LBSWebService.wsdl"]

<complexType name="LocationAlgorithm">
<element name="intervalBetweenMeasurements" type="xsd:int"/>
<element name="measurementType" nillable="true" type="xsdtring"/>
<element name="numberOfMeasurements" type="xsd:int"/>


But the return type of getLocationAlgorithm is set to "xsd:anyType" instead of LocationAlgorithm.

[code "LBSWebService.wsdl"]

<wsdl:message name="getLocationAlgorithmResponse">
<wsdl:part name="getLocationAlgorithmReturn" type="xsd:anyType"/>


So when I try calling the method, I get an "Unexpected end of file from server" - error.

Long story, but does anybody know how to fix this?

thx in advance,