473,802 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

From Schema to class to WSDL, element attributes lost in translati

Using a schema, I created classes for my web service using the XSD.exe tool.
With the classes I then wrote a web service function, but the WSDL that is
generated has different minOccurs and maxOccurs values for my elements. I
can seem to figure out why this has changed or how to correct it. I can't
find any way to manually modify the classes for minOccurs or maxOccurs
either. It can happen whether I explicitly set the minOccurs/maxOccurs values
in the original schema or leave them as defaults. Any insight? Code samples
below. Thanks.

schema ---> xsd.exe ---> New class(es) ---> WSDL
'// ***** Original schema sample *****
<xsd:complexTyp e name="MessageHe aderType">
<xsd:sequence >
<xsd:element name="MessageID " type="BLS-DB:MessageIDTyp e"/>
<xsd:element name="Acknowled gement" type="BLS-DB:Acknowledgem entType"
minOccurs="0"/>
</xsd:sequence>
</xsd:complexType >
<xsd:complexTyp e name="MessageID Type">
<xsd:sequence >
<xsd:element name="ID" type="xsd:norma lizedString"/>
<xsd:element name="Timestamp " type="xsd:dateT ime"/>
<xsd:element name="MessageTy pe" type="BLS-DB:MessageNameT ype"/>
<xsd:element name="Sender" type="BLS-DB:ParticipantT ype"/>
</xsd:sequence>
</xsd:complexType >
'//***** Generated Class Sample *****
'<remarks/>
<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="M-TEST")> _
Public Class MessageHeaderTy pe

'<remarks/>
Public MessageID As MessageIDType

'<remarks/>
Public Acknowledgement As Acknowledgement Type
End Class

'<remarks/>
<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="M-TEST")> _
Public Class MessageIDType

'<remarks/>

<System.Xml.Ser ialization.XmlE lementAttribute (DataType:="nor malizedString") > _
Public ID As String

'<remarks/>
Public Timestamp As Date

'<remarks/>
Public MessageType As MessageNameType

'<remarks/>
Public Sender As ParticipantType
End Class
'//***** Generated WSDL Sample *****
<s:complexTyp e name="MessageHe aderType">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="MessageID "
type="s1:Messag eIDType" />
<s:element minOccurs="0" maxOccurs="1" name="Acknowled gement"
type="s1:Acknow ledgementType" />
</s:sequence>
</s:complexType>
<s:complexTyp e name="MessageID Type">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ID"
type="s:normali zedString" />
<s:element minOccurs="1" maxOccurs="1" name="Timestamp "
type="s:dateTim e" />
<s:element minOccurs="1" maxOccurs="1" name="MessageTy pe"
type="s1:Messag eNameType" />
<s:element minOccurs="1" maxOccurs="1" name="Sender"
type="s1:Partic ipantType" />
</s:sequence>
</s:complexType>
Nov 23 '05 #1
4 2510
Did you have any success finding a solution to this problem? I am trying to
solve the same issue. Thanks.

"joewhiteha ir" wrote:
Using a schema, I created classes for my web service using the XSD.exe tool.
With the classes I then wrote a web service function, but the WSDL that is
generated has different minOccurs and maxOccurs values for my elements. I
can seem to figure out why this has changed or how to correct it. I can't
find any way to manually modify the classes for minOccurs or maxOccurs
either. It can happen whether I explicitly set the minOccurs/maxOccurs values
in the original schema or leave them as defaults. Any insight? Code samples
below. Thanks.

schema ---> xsd.exe ---> New class(es) ---> WSDL
'// ***** Original schema sample *****
<xsd:complexTyp e name="MessageHe aderType">
<xsd:sequence >
<xsd:element name="MessageID " type="BLS-DB:MessageIDTyp e"/>
<xsd:element name="Acknowled gement" type="BLS-DB:Acknowledgem entType"
minOccurs="0"/>
</xsd:sequence>
</xsd:complexType >
<xsd:complexTyp e name="MessageID Type">
<xsd:sequence >
<xsd:element name="ID" type="xsd:norma lizedString"/>
<xsd:element name="Timestamp " type="xsd:dateT ime"/>
<xsd:element name="MessageTy pe" type="BLS-DB:MessageNameT ype"/>
<xsd:element name="Sender" type="BLS-DB:ParticipantT ype"/>
</xsd:sequence>
</xsd:complexType >
'//***** Generated Class Sample *****
'<remarks/>
<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="M-TEST")> _
Public Class MessageHeaderTy pe

'<remarks/>
Public MessageID As MessageIDType

'<remarks/>
Public Acknowledgement As Acknowledgement Type
End Class

'<remarks/>
<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="M-TEST")> _
Public Class MessageIDType

'<remarks/>

<System.Xml.Ser ialization.XmlE lementAttribute (DataType:="nor malizedString") > _
Public ID As String

'<remarks/>
Public Timestamp As Date

'<remarks/>
Public MessageType As MessageNameType

'<remarks/>
Public Sender As ParticipantType
End Class
'//***** Generated WSDL Sample *****
<s:complexTyp e name="MessageHe aderType">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="MessageID "
type="s1:Messag eIDType" />
<s:element minOccurs="0" maxOccurs="1" name="Acknowled gement"
type="s1:Acknow ledgementType" />
</s:sequence>
</s:complexType>
<s:complexTyp e name="MessageID Type">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ID"
type="s:normali zedString" />
<s:element minOccurs="1" maxOccurs="1" name="Timestamp "
type="s:dateTim e" />
<s:element minOccurs="1" maxOccurs="1" name="MessageTy pe"
type="s1:Messag eNameType" />
<s:element minOccurs="1" maxOccurs="1" name="Sender"
type="s1:Partic ipantType" />
</s:sequence>
</s:complexType>

Nov 23 '05 #2
The only solution I found was to modified by hand.
"Robert Rae" wrote:
Did you have any success finding a solution to this problem? I am trying to
solve the same issue. Thanks.

Nov 23 '05 #3
maxOccurs="1" I believe is the default.
So any introduction of that into your generated WSDL does not constitute a
change in meaning.

If you want maxOccurs= (more than 1) then you are talking about an array.

for minOccurs="0", if it is a value type, then you need to include a
property with a name like XxxxSpecified, as per the doc at:
http://msdn.microsoft.com/library/en...ClassTopic.asp

The change of minOccurs="0" in your schema, to minOccurs="1" in the
generated WSDL, comes about because of the "impedance mismatch" between the
..NET type system and the W3C XML Schema type system.
More on that, here:
http://www.25hoursaday.com/weblog/de...ate=2005-02-10
-Dino

"joewhiteha ir" <jo**********@d iscussions.micr osoft.com> wrote in message
news:7A******** *************** ***********@mic rosoft.com...
The only solution I found was to modified by hand.
"Robert Rae" wrote:
Did you have any success finding a solution to this problem? I am trying
to
solve the same issue. Thanks.
>

Nov 23 '05 #4
Dino,

Do you have any suggestions with regard to my post on 3/8 "setting minoccurs
and maxoccurs with attributes"? I am trying to set the maxoccurs value of an
element to a specifc value.

Any help would be greatly appreciated.

"Dino Chiesa [Microsoft]" wrote:
maxOccurs="1" I believe is the default.
So any introduction of that into your generated WSDL does not constitute a
change in meaning.

If you want maxOccurs= (more than 1) then you are talking about an array.

for minOccurs="0", if it is a value type, then you need to include a
property with a name like XxxxSpecified, as per the doc at:
http://msdn.microsoft.com/library/en...ClassTopic.asp

The change of minOccurs="0" in your schema, to minOccurs="1" in the
generated WSDL, comes about because of the "impedance mismatch" between the
..NET type system and the W3C XML Schema type system.
More on that, here:
http://www.25hoursaday.com/weblog/de...ate=2005-02-10
-Dino

"joewhiteha ir" <jo**********@d iscussions.micr osoft.com> wrote in message
news:7A******** *************** ***********@mic rosoft.com...
The only solution I found was to modified by hand.
"Robert Rae" wrote:
Did you have any success finding a solution to this problem? I am trying
to
solve the same issue. Thanks.
>


Nov 23 '05 #5

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

Similar topics

1
9906
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or more operations were skipped. Warnings were encountered. Review generated source comments for more details.
2
4219
by: Burak | last post by:
Hello, I have a web service that has a two user defined public classes. For sake of brevity, I'll write them as follows Public Class Service1 Public Class Class1 Public x as integer End Class
1
6411
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i reference this wsdl in .NET it seems to do it fine, yet there are no objects to reference except RateQuoteBeanService. In the WSDL it looks like there should be getRateQuote, and QUOTEREQUEST, etc.
0
2647
by: jennifer.perkins | last post by:
I've seen a couple posts by people having similar problems, but the suggested solutions I've tried so far haven't worked. I'm using a SOAP client in VB.Net (constructed by wsdl.exe) and the third party web service it's consuming is served by Axis. The request messages my client sends are processed fine by the server, and the SOAP response is making its way to my client - but when .Net finishes processing the message I end up with an...
2
7736
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 cannot extract all of the type information from the wsdl using any standard tools. I'm using HttpGet style webservices if that makes any difference, but I want to be able to use any type. 1. I've tried the ServiceDescription.Types and I cannot...
1
5053
by: Mike Logan | last post by:
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"
3
4292
by: Ivan Zuzak | last post by:
Hello, My Python application calls web services available on the Internet. The web service being called is defined through application user input. The Python built-in library allows access to web services using HTTP protocol, which is not acceptible - generating SOAP messages for arbitrary web services is something i wish to avoid. I need a package/tool that generates web service proxies that will do
0
2349
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions through internet explorer when hitting the ..asmx url, i cannot generate a proxy class to use in my winforms assembly. When i try to generate a proxy, i get no error message but nor do i get a reference.vb so there is no type info. If i then try...
2
16101
by: =?Utf-8?B?TWlnaHR5IE1hcms=?= | last post by:
I'd like to generate my WebService interface from an XSD schema. Here's what I've done: 1. created a XML file 2. use the xsd.exe to generate the XSD: C:\>xsd my.xml 3. my.xsd is generated 4. try to generate the WebService interface using wsdl.exe: C:\>wsdl /serverInterface /protocol:SOAP my.xsd 5. An error occurs and no classes are generated (see below) and Interface.cs
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10536
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.