473,406 Members | 2,273 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,406 software developers and data experts.

minOccurs from VB code - attribute?

[I already asked this in the .framework.webservices group last week, but
got no answer]
In a VB.Net webservice, after adding a data class, members of type String
get a "minOccurs=0" attribute in the generated WSDL.

Is there an attribute you can apply to the definition, or some other way to
turn this into "minOccurs=1"?
For example, in this class:

<WebService(Namespace:=...)> _
public class MyWebService
Inherits System.Web.Services.WebService

<WebMethod()> Public Sub TestFunc(byval t as TestData)
....
End Sub

public class TestData
Public Name as string
....
end class

end class

the "Name" member of TestData comes out in WSDL as

<s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
I'd like to get minOccurs="1" instead, so clients understand that the value
isn't optional.

I tried using the IsNullable attribute through
System.Xml.Serialization.XmlElementAttribute and
System.Xml.Serialization.SoapElement, but it makes no difference.
Jun 19 '06 #1
0 779

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

Similar topics

1
by: Lee Atkinson | last post by:
Hi What effect does the presence of minOccurs attribute with columns defining the tables for a dataset? I understand that, if it is set to minOccurs=0, then the element does not have to appear...
2
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In...
0
by: Robert Rae | last post by:
Does anyone know of a way to set minoccurs and maxoccurs from an attribute. An example would be: public string HelloWorld(DataInput dataInput) { return "Hello World"; } public class...
0
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the...
0
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the...
0
by: John Jenkins | last post by:
Hi, apologies for tghe repost, but I cannot get an answer to my question and I have noe posted on 7 news groups. Can someone tell me why the following scneario occurs. With the nillable attribute...
7
by: rbarschaw | last post by:
I have the following schema designed: <xs:complexType name="AzzFeature-BoxType" mixed="true"> <xs:choice minOccurs="1" maxOccurs="unbounded"> <xs:element ref="Sub-Head" minOccurs="1"...
2
by: NoNickname | last post by:
Right now I'm getting this in the wsdl: <s:element minOccurs="0" maxOccurs="1" name="Items" type="tns:ArrayOfMyClass" /> I would like to get minOccurs="1" for this webmethod: public...
1
by: Lucvdv | last post by:
In a VB.Net webservice, after adding a data class, members of type String get a "minOccurs=0" attribute in the generated WSDL. Is there an attribute you can apply to the definition, or some other...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.