473,231 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

WSDL.exe doesn't generate array of complex objects from WSDL & XSD

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
Nov 23 '05 #1
1 5014
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:
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

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Generic Usenet Account | last post by:
Does anyone have an opinion on how IDL and WSDL compare to each other? Are they equally powerful in their "expressive power"? Sometimes it appears to me that IDL is a little easier for humans to...
1
by: Emanuele Parati | last post by:
I created a Web Service from a WSDL that come from Java (apache soap). It contains the definition of Vector as complex type: <schema targetNamespace="http://xml.apache.org/xml-soap"...
4
by: MattBell | last post by:
I've tried to search for an answer to this without much success, and I think it's probably a common thing to do: I have a web service I want to accept an XmlDocument as an argument which conforms...
0
by: saish | last post by:
Hello I am new to vb.net webservice. My requirement is to design a VB.net web service which will send and receive xml documents. The xml document send and received would be a very complex .xsd...
2
by: Danny Gagne | last post by:
I'm currently working an .net application (I can use 1.1 or 2.0 if needed) that needs to read a wsdl file and generate another piece of code that can use it. I'm encountering a problem where I...
5
by: Mike Logan | last post by:
I used WSDL.exe to generate a client side web proxy for a web service, called the web service, got the results but an array returned by the web service is not in the results. However if I use...
3
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate...
7
by: tobiah | last post by:
I'm having trouble finding information about writing a SOAP server. I get the client part. There is much information about writing a client, but not so much about writing the server. Are there...
4
by: newtonwong | last post by:
I have a web reference WSDL, but it doesn't really create an XSD. I'm trying to generate datasets from the WSDL file but not sure how to do so. I successfully created the proxy class, but the...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.