J
jeremy
I've created a class with two public properties of type string
(example below). I've created a method in my web service which
returns an array of the class. Compiles fine, but the class
properties don't appear in the web service response, or in the wsdl.
Any help appreciated.
Example:
Class I want to return an array of:
public class WorkGroup implements java.io.Serializable
{
static final long serialVersionUID = 1;
public String Name;
public String SearchCode;
public WorkGroup(IWorkGroup pWorkGroup)
{
this.Name = pWorkGroup.getName();
this.SearchCode = pWorkGroup.getSearchcode();
}
WebService:
public Class PersonWS
{
public WorkGroup[] ListWorkGroups(String strPerson)
{
....
}
}
WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/axis/
PersonWS.jws" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/PersonWS.jws"
xmlns:intf="http://localhost:8080/axis/PersonWS.jws"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://openview.interiorhealth.ca" xmlns:wsdl="http://
schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/
wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema targetNamespace="http://localhost:8080/axis/PersonWS.jws"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://openview.interiorhealth.ca"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOf_tns1_WorkGroup">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:WorkGroup[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="ListWorkGroupsRequest">
<wsdlart name="strPerson" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="ListWorkGroupsResponse">
<wsdlart name="ListWorkGroupsReturn"
type="impl:ArrayOf_tns1_WorkGroup"/>
</wsdl:message>
<wsdlortType name="PersonWS">
<wsdlperation name="ListWorkGroups"
parameterOrder="strPerson">
<wsdl:input message="impl:ListWorkGroupsRequest"
name="ListWorkGroupsRequest"/>
<wsdlutput message="impl:ListWorkGroupsResponse"
name="ListWorkGroupsResponse"/>
</wsdlperation>
</wsdlortType>
<wsdl:binding name="PersonWSSoapBinding" type="implersonWS">
<wsdlsoap:binding style="rpc" transport="http://
schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="ListWorkGroups">
<wsdlsoapperation soapAction=""/>
<wsdl:input name="ListWorkGroupsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdlutput name="ListWorkGroupsResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://localhost:8080/axis/PersonWS.jws"
use="encoded"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="PersonWSService">
<wsdlort binding="implersonWSSoapBinding" name="PersonWS">
<wsdlsoap:address location="http://localhost:8080/axis/
PersonWS.jws"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>
(example below). I've created a method in my web service which
returns an array of the class. Compiles fine, but the class
properties don't appear in the web service response, or in the wsdl.
Any help appreciated.
Example:
Class I want to return an array of:
public class WorkGroup implements java.io.Serializable
{
static final long serialVersionUID = 1;
public String Name;
public String SearchCode;
public WorkGroup(IWorkGroup pWorkGroup)
{
this.Name = pWorkGroup.getName();
this.SearchCode = pWorkGroup.getSearchcode();
}
WebService:
public Class PersonWS
{
public WorkGroup[] ListWorkGroups(String strPerson)
{
....
}
}
WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/axis/
PersonWS.jws" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/PersonWS.jws"
xmlns:intf="http://localhost:8080/axis/PersonWS.jws"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://openview.interiorhealth.ca" xmlns:wsdl="http://
schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/
wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema targetNamespace="http://localhost:8080/axis/PersonWS.jws"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://openview.interiorhealth.ca"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOf_tns1_WorkGroup">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:WorkGroup[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="ListWorkGroupsRequest">
<wsdlart name="strPerson" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="ListWorkGroupsResponse">
<wsdlart name="ListWorkGroupsReturn"
type="impl:ArrayOf_tns1_WorkGroup"/>
</wsdl:message>
<wsdlortType name="PersonWS">
<wsdlperation name="ListWorkGroups"
parameterOrder="strPerson">
<wsdl:input message="impl:ListWorkGroupsRequest"
name="ListWorkGroupsRequest"/>
<wsdlutput message="impl:ListWorkGroupsResponse"
name="ListWorkGroupsResponse"/>
</wsdlperation>
</wsdlortType>
<wsdl:binding name="PersonWSSoapBinding" type="implersonWS">
<wsdlsoap:binding style="rpc" transport="http://
schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="ListWorkGroups">
<wsdlsoapperation soapAction=""/>
<wsdl:input name="ListWorkGroupsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdlutput name="ListWorkGroupsResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://localhost:8080/axis/PersonWS.jws"
use="encoded"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="PersonWSService">
<wsdlort binding="implersonWSSoapBinding" name="PersonWS">
<wsdlsoap:address location="http://localhost:8080/axis/
PersonWS.jws"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>