[AXIS-SOAP] Return Custom Types Problem
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dieter_Verslype
Posted On:   Tuesday, July 26, 2005 09:45 AM

Hello, 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 measur   More>>

Hello,



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;

}

}



[/code]



The simple webservice:



[code name="WebServiceImpl.java"]



package lbs.webservice.bundle;



public class WebServiceImpl implements WebService {



public LocationAlgorithm getLocationAlgorithm() {

return new LocationAlgorithm(0, 0, "");

}

}



[/code]



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"]





languageSpecificType="java:lbs.webservice.bundle.LocationAlgorithm"/>



[/code]



When I load the WebService, a wsdl is generated (full wsdl is found here: http://users.atlantis.ugent.be/dvrslype/LBSWebService.xml).

In the wsdl it is clear the Axis server recognizes the LocationAlgorithm type:



[code "LBSWebService.wsdl"]



















[/code]



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



[code "LBSWebService.wsdl"]











[/code]





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,



dvrslype

   <<Less
About | Sitemap | Contact