| re: WSDL.exe doesn't generate array of complex objects from WSDL & XSD
Found the problem.
You must specify the complexType array with the following two properties.
maxOccurs="unbounded" minOccurs="0"
Therefore the modified section in the XSD would be.
<xs:complexType name="applicationList">
<xs:sequence>
<xs:element name="applications" type="application"
maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
--
Mike Logan
"Mike Logan" wrote:
[color=blue]
> I have a schema that defines my messages and objects. I then have a WSDL
> that defines the web services. I have my sample XSD, sample WSDL, and the
> code generated from WSDL.exe. In the generated code from WSDL.exe, the
> "applicationList" object is not a array or "application", which is what it
> should be, correct?
>
> Thanks for the help.
>
> <?xml version="1.0" encoding="utf-8" ?>
> <xs:schema targetNamespace="http://me.com/xml/xsd/AppSec1.xsd"
> elementFormDefault="qualified"
> xmlns="http://me.com/xml/xsd/AppSec1.xsd"
> xmlns:mstns="http://me.com/xml/xsd/AppSec1.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1">
> <xs:complexType name="application">
> <xs:sequence>
> <xs:element name="appid" type="xs:int" />
> <xs:element name="description" type="xs:string" />
> <xs:element name="guid" type="xs:string" />
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="applicationList">
> <xs:sequence>
> <xs:element name="applications" type="application" />
> </xs:sequence>
> </xs:complexType>
> <xs:element name="getApplicationListRequest">
> <xs:complexType>
> <xs:sequence />
> </xs:complexType>
> </xs:element>
> <xs:element name="getApplicationListResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="apps" type="applicationList" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> Here is the WSDL.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions
> name="AppSec"
> targetNamespace="http://www.your-company.com/AppSec.wsdl"
> xmlns:as="http://www.vita.virginia.gov/xml/xsd/AppSec1.xsd"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tns="http://www.your-company.com/AppSec.wsdl"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <wsdl:import
> location="C:\VS.Net\AppSecTestAWSCF\AppSec.xsd"
> namespace="http://me.com/xml/xsd/AppSec1.xsd"/>
> <wsdl:message name="getApplicationListRequest">
> <wsdl:part element="as:getApplicationListRequest" name="parameters"/>
> </wsdl:message>
> <wsdl:message name="getApplicationListResponse">
> <wsdl:part element="as:getApplicationListResponse" name="parameters"/>
> </wsdl:message>
> <wsdl:portType name="AppSecPortType">
> <wsdl:operation name="getApplicationList">
> <wsdl:input message="tns:getApplicationListRequest"/>
> <wsdl:output message="tns:getApplicationListResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="AppSecBinding" type="tns:AppSecPortType">
> <soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="getApplicationList">
> <soap:operation
>
> soapAction="capeconnect:AppSec:AppSecPortType#getA pplicationList"
> style="document"/>
> <wsdl:input>
> <soap:body parts="parameters" use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body parts="parameters" use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="AppSec">
> <wsdl:port binding="tns:AppSecBinding" name="AppSecPort">
> <soap:address location="http://localhost/ccx/AppSec"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> And here is the generated server code from WSDL.EXE.
>
> <System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://www.vita.virginia.gov/xml/xsd/AppSec1.xsd")> _
> Public Class application
>
> Public appid As Integer
> Public description As String
> Public guid As String
>
> End Class
>
> <System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://www.vita.virginia.gov/xml/xsd/AppSec1.xsd")> _
> Public Class applicationList
>
> Public applications As application
> End Class
>
> --
> Mike Logan[/color] |