473,574 Members | 3,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Defining String parameter max length?

Is there a way of defining the maximum length of a string parameter to
a web service in .Net?

I assumed that there would be an Xml... attribute that I could apply
to a string definition in the class that would control the generation
of the necessary maxlength attribute in the WSDL but I can't seem to
find one.

Thanks for any help you can offer,
John.

May 16 '07 #1
3 9429
<fu*******@yaho o.comwrote in message
news:11******** *************@l 77g2000hsb.goog legroups.com...
Is there a way of defining the maximum length of a string parameter to
a web service in .Net?

I assumed that there would be an Xml... attribute that I could apply
to a string definition in the class that would control the generation
of the necessary maxlength attribute in the WSDL but I can't seem to
find one.
I don't believe there is one. Neither are there attributes to control other
schema facets.
--
John Saunders [MVP]
May 16 '07 #2
On 16 May, 18:39, "John Saunders [MVP]" <john.saunder s at
trizetto.comwro te:
<fussel...@yaho o.comwrote in message

news:11******** *************@l 77g2000hsb.goog legroups.com...
Is there a way of defining the maximum length of a string parameter to
a web service in .Net?
I assumed that there would be an Xml... attribute that I could apply
to a string definition in the class that would control the generation
of the necessary maxlength attribute in the WSDL but I can't seem to
find one.

I don't believe there is one. Neither are there attributes to control other
schema facets.
--
John Saunders [MVP]
John - thank you very much for your reply.

It seems to be a surprising ommission to me - given how big Microsoft
are on the position of .Net & Web Services.

Do you know if there's any way of hooking into the automated process
that generates the WSDL to add this kind of functionlity myself?

Thanks,
John.

May 17 '07 #3
On 16 May, 18:39, "John Saunders [MVP]" <john.saunder s at
trizetto.comwro te:
<fussel...@yaho o.comwrote in message

news:11******** *************@l 77g2000hsb.goog legroups.com...
Is there a way of defining the maximum length of a string parameter to
a web service in .Net?
I assumed that there would be an Xml... attribute that I could apply
to a string definition in the class that would control the generation
of the necessary maxlength attribute in the WSDL but I can't seem to
find one.

I don't believe there is one. Neither are there attributes to control other
schema facets.
--
John Saunders [MVP]
Thank you very much for your response John.

This seems like quite a big omission on Microsoft's part, given how
strongly they position .Net in terms of Web Services.

Do you know if it's possible to hook into the code that auto-generates
the WSDL and write custom code to achieve this?

Many thanks,
John.

May 17 '07 #4

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

Similar topics

12
3195
by: Matt Garman | last post by:
I'd like to create a "custom output facility". In other words, I want an object whose use is similar to std::cout/std::cerr, but offers more flexibility. Instead of simply writing the parameter to stdout/stderr, I'd like it to write to stdout, to a file, and/or call a logging function. So my output function might look something like this:...
1
2181
by: Billy N. Patton | last post by:
-------- Original Message -------- Subject: <string>.replace Date: Fri, 15 Oct 2004 11:07:19 -0500 From: Billy N. Patton <b-patton@ti.com> Organization: Texas Instruments Newsgroups: alt.comp.lang.learn.c-c++ I'm trying to remove the \n from a string. If I just simply locate teh char and replace it with \0 then the destructor should only...
51
8244
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct code? many thx!
16
11957
by: Raj Kotaru | last post by:
Hello all, I recently came across the following segment of code that defines a C struct: typedef struct { unsigned char unused_bits:4; unsigned char wchair_state:2; } xyz;
7
6488
by: Alpha | last post by:
Hi, I'm maintaining C# code and am fairly new with C# programming. I'm looking for codes that's droping the 2nd digit of a nuber printed out and I suspect it's the code below. Can someone tell me where I can look up explaination on the String.Format, the format string part like "("{0:.#0}". What's the trailing 0 and what is that "0:" means? ...
4
1978
by: Trapulo | last post by:
I've a webservice with a string parameter. I call this webservice passing a string that is 1129 chars length. On the webservice, the received string is 1146 length (I tested sizes with string.length property). String's contents seem be teh same, so I think there is some encoding difference (is this possibile?). The problem is that I sign...
2
1663
by: =?Utf-8?B?Z2FkeWE=?= | last post by:
I use one of 2 arrays dependent on the country. Rather than say: if exchangeID = 1 then dim myPlaceBets() as As UK.exchange.PlaceBets many statements myPlaceBetsReq.bets = myPlaceBets else dim myPlaceBets() As AU.exchange.PlaceBets many statements
2
1458
by: nrworld | last post by:
Hi, I am facing a problem while using pepared statement for inserting data in MS-Access db. private const String CONN_STR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\TestDb.mdb"; conDatabase.Open(CONN_STR, "", "", -1); String sQuery = "INSERT INTO " + sTableName + ...
2
2900
by: =?Utf-8?B?Z3Jva25yb2xs?= | last post by:
Is there a way that I can define a WebMethod with a parameter that is a fixed length string? I'm using VB.Net 2005 and would like to define a webmethod that will prevent the caller from passing a string that exceeds a certain fixed length. For this application if the string parameter exceeds the specified length it will always be an error,...
0
7842
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...
0
7764
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7862
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6514
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...
0
5336
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3775
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...
0
3794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1375
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.