Note that you have a namespace declaration error in the <schema> in
Research.WSDL:
xmlns:svc="svc"
You need to fix this problem, but it won't fix the problem. Axis likes to
change the repeating element name inside an array. I suggest that you tell
Axis to use your WSDL rather than letting it generate its own. (use
<wsdlFile> in the WSDD).
Anne
On 4/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Heya,
I'm pretty new to AXIS/XSD/WSDL, so hopefully this is a easy
question.
I am using AXIS+Castor to create a WSDL first, Document/Literal wrapped
web service
that returns a list of products. I was aiming for a structure like:
<products>
<product>
.
.
</product>
</products>
After running my WSDL/XSD through WSDL2Java and Castor's SourceGen, I am
able to get a list
of products using the AXIS client stubs, but the SOAP response doesn't
match the structure
above and I'm not sure why. It does match the generated WSDL, but I'm not
sure why the WSDL
changed the way it did. Anyone got any ideas? I've included my XSDs,
WSDL, SOAP response,
and generated WSDL below.
Thanks,
Anna
Reasearch.xsd
=============
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xxx.com/xxx/xxx/xxx/xxx"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:tns="http://xxx.com/xxx/xxx/xx/xxx">
<xsd:simpleType name="statType">
<xsd:restriction base="xsd:double">
<xsd:minExclusive value="0"/>
<xsd:maxInclusive value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="product">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="productName"
type="xsd:string"/>
<xsd:element name="productType"
type="xsd:string"/>
<xsd:element name="tickerOrAcronym"
type="xsd:string"/>
<xsd:element name="managerFee"
type="xsd:integer"/>
<xsd:element name="managerMin"
type="xsd:integer"/>
<xsd:element name="expenseRatio"
type="tns:statType"/>
<xsd:element name="oneYearReturn"
type="tns:statType"/>
<xsd:element name="threeYearReturn"
type="tns:statType"/>
<xsd:element name="fiveYearReturn"
type="tns:statType"/>
<xsd:element name="tenYearReturn"
type="tns:statType"/>
<xsd:element name="lastQtrReturn"
type="tns:statType"/>
<xsd:element name="yearToDateReturn"
type="tns:statType"/>
<xsd:element name="threeYearStdDev"
type="tns:statType"/>
<xsd:element name="threeYearBeta"
type="tns:statType"/>
<xsd:element name="threeYeareSharpeRatio"
type="tns:statType"/>
<xsd:element name="threeYearAlpha"
type="tns:statType"/>
<xsd:element name="theeYearUpCap"
type="tns:statType"/> <xsd:element
name="threeYearDownCap" type="tns:statType"/>
<xsd:element name="threeYearBestQtr"
type="tns:statType"/>
<xsd:element name="threeYearWorstQtr"
type="tns:statType"/>
<xsd:element name="threeYearCons"
type="tns:statType"/>
<xsd:element name="threeYearNegativeQtr"
type="tns:statType"/>
<xsd:element name="threeYearInfoRatio"
type="tns:statType"/>
<xsd:element name="threeYearDownsideRisk"
type="tns:statType"/>
<xsd:element name="avgAnnualTurnover"
type="tns:statType"/>
<xsd:element name="inactive"
type="xsd:boolean"/>
<xsd:element name="sleeveManager"
type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="products">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="tns:product"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
===================
ResearchService.xsd
===================
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xxx.com/xxx/xxx/xxx/xxx/service"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:tns="http://xxx.com/xxx/xxx/xxx/xxx/service"
xmlns:types="http://xxx.com/xxx/xxx/xxx/xxx">
<xsd:import
namespace="http://xxx.com/xxx/xxx/xxx/xxx"
schemaLocation="Research.xsd"/>
<!-- Methods signatures -->
<xsd:element name="getProduct">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="productName"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getProductResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="types:products" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
=============
Research.WSDL
=============
<definitions targetNamespace="http://xxx.com/xxx/xxx/wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://xxx.com/xxx/xxx/wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:svc="http://xxx.com/xxx/xxx/xxx/xxx/service"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema
targetNamespace="http://xxx.com/xxx/xxx/wsdl"
xmlns:svc="svc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import
namespace="
http://xxx.com/xxx/xxx/xxx/xxx/service"
schemaLocation="../xsd/ResearchService.xsd"/>
</xsd:schema>
</types>
<message name="getProduct">
<part name="parameters" element="svc:getProduct" />
</message>
<message name="getProductResponse">
<part name="parameters" element="svc:getProductResponse"
/>
</message>
<portType name="ResearchPortType">
<operation name="getProduct">
<input message="tns:getProduct" />
<output message="tns:getProductResponse" />
</operation>
</portType>
<binding name="ResearchSOAPBinding" type="tns:ResearchPortType">
<soap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http" />
<operation name="getProduct">
<soap:operation style="document"
soapAction="getProduct" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="ResearchService">
<port name="ResearchSOAPPort"
binding="tns:ResearchSOAPBinding">
<soap:address location="
http://xx.xx.xx.xx:xxxx/xxx/services/ResearchSOAPPort" />
</port>
</service>
</definitions>
=============
SOAP response
=============
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getProductResponse xmlns="
http://xxx.com/xxx/xxx/xxx/xxx/service">
<ns1:products xmlns:ns1="
http://xxx.com/xxx/xxx/xxx/xxxh">
<ns1:products>
<ns1:productName>Product1</ns1:productName>
<ns1:productType>SAM</ns1:productType>
<ns1:tickerOrAcronym>XXX</ns1:tickerOrAcronym>
<ns1:managerFee>150</ns1:managerFee>
<ns1:managerMin>150000</ns1:managerMin>
<ns1:expenseRatio>0.44
</ns1:expenseRatio>
<ns1:oneYearReturn>0.12
</ns1:oneYearReturn>
<ns1:threeYearReturn>0.44
</ns1:threeYearReturn>
<ns1:fiveYearReturn>0.22
</ns1:fiveYearReturn>
<ns1:tenYearReturn>0.02
</ns1:tenYearReturn>
<ns1:lastQtrReturn>0.12
</ns1:lastQtrReturn>
<ns1:yearToDateReturn>0.33
</ns1:yearToDateReturn>
<ns1:threeYearStdDev>0.11
</ns1:threeYearStdDev>
<ns1:threeYearBeta>0.23
</ns1:threeYearBeta>
<ns1:threeYeareSharpeRatio>0.23
</ns1:threeYeareSharpeRatio>
<ns1:threeYearAlpha>0.56
</ns1:threeYearAlpha>
<ns1:theeYearUpCap>0.44
</ns1:theeYearUpCap>
<ns1:threeYearDownCap>0.16
</ns1:threeYearDownCap>
<ns1:threeYearBestQtr>0.49
</ns1:threeYearBestQtr>
<ns1:threeYearWorstQtr>0.64
</ns1:threeYearWorstQtr>
<ns1:threeYearCons>0.56
</ns1:threeYearCons>
<ns1:threeYearNegativeQtr>0.74
</ns1:threeYearNegativeQtr>
<ns1:threeYearInfoRatio>0.23
</ns1:threeYearInfoRatio>
<ns1:threeYearDownsideRisk>0.93
</ns1:threeYearDownsideRisk>
<ns1:avgAnnualTurnover>0.95
</ns1:avgAnnualTurnover>
<ns1:inactive>false</ns1:inactive>
<ns1:sleeveManager>false</ns1:sleeveManager>
</ns1:products>
<ns1:products>
<ns1:productName>Product2</ns1:productName>
<ns1:productType>FUND</ns1:productType>
<ns1:tickerOrAcronym>YYY</ns1:tickerOrAcronym>
<ns1:managerFee>20</ns1:managerFee>
<ns1:managerMin>100000</ns1:managerMin>
<ns1:expenseRatio>0.64
</ns1:expenseRatio>
<ns1:oneYearReturn>0.12
</ns1:oneYearReturn>
<ns1:threeYearReturn>0.46
</ns1:threeYearReturn>
<ns1:fiveYearReturn>0.78
</ns1:fiveYearReturn>
<ns1:tenYearReturn>0.44
</ns1:tenYearReturn>
<ns1:lastQtrReturn>0.38
</ns1:lastQtrReturn>
<ns1:yearToDateReturn>0.19
</ns1:yearToDateReturn>
<ns1:threeYearStdDev>0.76
</ns1:threeYearStdDev>
<ns1:threeYearBeta>0.33
</ns1:threeYearBeta>
<ns1:threeYeareSharpeRatio>0.56
</ns1:threeYeareSharpeRatio>
<ns1:threeYearAlpha>0.86
</ns1:threeYearAlpha>
<ns1:theeYearUpCap>0.23
</ns1:theeYearUpCap>
<ns1:threeYearDownCap>0.77
</ns1:threeYearDownCap>
<ns1:threeYearBestQtr>0.88
</ns1:threeYearBestQtr>
<ns1:threeYearWorstQtr>0.63
</ns1:threeYearWorstQtr>
<ns1:threeYearCons>0.55
</ns1:threeYearCons>
<ns1:threeYearNegativeQtr>0.23
</ns1:threeYearNegativeQtr>
<ns1:threeYearInfoRatio>0.56
</ns1:threeYearInfoRatio>
<ns1:threeYearDownsideRisk>0.77
</ns1:threeYearDownsideRisk>
<ns1:avgAnnualTurnover>0.34
</ns1:avgAnnualTurnover>
<ns1:inactive>true</ns1:inactive>
<ns1:sleeveManager>false</ns1:sleeveManager>
</ns1:products>
</ns1:products>
</getProductResponse>
</soapenv:Body>
</soapenv:Envelope>
==============
Generated WSDL
==============
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://xxx.com/xxx/xxx/wsdl"
xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="
http://xxx.com/xxx/xxx/wsdl" xmlns:intf="http://xxx.com/xxx/xxx/wsdl"
xmlns:tns1="http://xxx.com/xxx/xxx/xxx/xxx/service" xmlns:tns2="
http://xxx.com/xxx/xxx/xxx/xxx" 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.3
Built on Oct 05, 2005 (05:23:37 EDT)
-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="
http://xxx.com/xxx/xxx/xxx/xxx/service" xmlns="
http://www.w3.org/2001/XMLSchema">
<import namespace="http://xxx.com/xxx/xxx/xx/xxx" />
<element name="getProduct">
<complexType>
<sequence>
<element name="productName" type="xsd:string" />
</sequence>
</complexType>
</element>
<element name="getProductResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="products" type="tns2:product" />
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getProductRequest">
<wsdl:part element="tns1:getProduct" name="parameters" />
</wsdl:message>
<wsdl:message name="getProductResponse">
<wsdl:part element="tns1:getProductResponse" name="parameters" />
</wsdl:message>
<wsdl:portType name="ResearchPortType">
<wsdl:operation name="getProduct">
<wsdl:input message="impl:getProductRequest" name="getProductRequest" />
<wsdl:output message="impl:getProductResponse" name="getProductResponse"
/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ResearchSOAPPortSoapBinding"
type="impl:ResearchPortType">
<wsdlsoap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getProduct">
<wsdlsoap:operation soapAction="getProduct" />
<wsdl:input name="getProductRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output name="getProductResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ResearchService">
<wsdl:port binding="impl:ResearchSOAPPortSoapBinding"
name="ResearchSOAPPort">
<wsdlsoap:address location="
http://xx.xx.xx.xx:xxx/xxx/services/ResearchSOAPPort" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>