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">
<wsdl
art name="strPerson" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="ListWorkGroupsResponse">
<wsdl
art name="ListWorkGroupsReturn"
type="impl:ArrayOf_tns1_WorkGroup"/>
</wsdl:message>
<wsdl
ortType name="PersonWS">
<wsdl
peration name="ListWorkGroups"
parameterOrder="strPerson">
<wsdl:input message="impl:ListWorkGroupsRequest"
name="ListWorkGroupsRequest"/>
<wsdl
utput message="impl:ListWorkGroupsResponse"
name="ListWorkGroupsResponse"/>
</wsdl
peration>
</wsdl
ortType>
<wsdl:binding name="PersonWSSoapBinding" type="impl
ersonWS">
<wsdlsoap:binding style="rpc" transport="http://
schemas.xmlsoap.org/soap/http"/>
<wsdl
peration name="ListWorkGroups">
<wsdlsoap
peration soapAction=""/>
<wsdl:input name="ListWorkGroupsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdl
utput name="ListWorkGroupsResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://localhost:8080/axis/PersonWS.jws"
use="encoded"/>
</wsdl
utput>
</wsdl
peration>
</wsdl:binding>
<wsdl:service name="PersonWSService">
<wsdl
ort binding="impl
ersonWSSoapBinding" name="PersonWS">
<wsdlsoap:address location="http://localhost:8080/axis/
PersonWS.jws"/>
</wsdl
ort>
</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">
<wsdl
</wsdl:message>
<wsdl:message name="ListWorkGroupsResponse">
<wsdl
type="impl:ArrayOf_tns1_WorkGroup"/>
</wsdl:message>
<wsdl
<wsdl
parameterOrder="strPerson">
<wsdl:input message="impl:ListWorkGroupsRequest"
name="ListWorkGroupsRequest"/>
<wsdl
name="ListWorkGroupsResponse"/>
</wsdl
</wsdl
<wsdl:binding name="PersonWSSoapBinding" type="impl
<wsdlsoap:binding style="rpc" transport="http://
schemas.xmlsoap.org/soap/http"/>
<wsdl
<wsdlsoap
<wsdl:input name="ListWorkGroupsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdl
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" namespace="http://localhost:8080/axis/PersonWS.jws"
use="encoded"/>
</wsdl
</wsdl
</wsdl:binding>
<wsdl:service name="PersonWSService">
<wsdl
<wsdlsoap:address location="http://localhost:8080/axis/
PersonWS.jws"/>
</wsdl
</wsdl:service>
</wsdl:definitions>