473,624 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate messages

How do I validate messages? If my schema has a simpleType with facets like
"minExclusi ve" and "maxLength" will the .Net framework validate the message
before running the web service? This is what one of my server stubs look
like.

<System.Web.Ser vices.WebMethod Attribute(), _

System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://me.com/xml/wsdl/AppSec/getApplicationL ist",
RequestElementN ame:="getApplic ationListReques t",
RequestNamespac e:="http://me.com/xml/xsd/AppSec1.xsd",
ResponseNamespa ce:="http://me.com/xml/xsd/AppSec1.xsd",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)> _
Public MustOverride Function getApplicationL ist() As
<System.Xml.Ser ialization.XmlE lementAttribute ("apps")> application()

I would assume with all those "attributes " some sort of validation should
occur? FYI: I generate my server stubs using WSDL.exe, from a WSDL, that
was created with SOA Editor.

Thanks, Mike L.
--
Mike Logan
Nov 23 '05 #1
3 2940
Well I just noticed that "WSDL.exe" doesn't generate a type with "maxLength"
and "minLength" in the client proxy or server side stub. WSDL.exe generates
a field instead of a property. I know that .Net 2.0 has an option for
generating properties instead of fields.

Also those attributes do not validate the message. In my XSD, I defined a
"complexTyp e" that a child element that was restricted on minLength and
maxLength. On the client, I was able to send that "complexTyp e" with more
than 50 characters, and it went through fine.

Thanks.
--
Mike Logan
"Mike Logan" wrote:
How do I validate messages? If my schema has a simpleType with facets like
"minExclusi ve" and "maxLength" will the .Net framework validate the message
before running the web service? This is what one of my server stubs look
like.

<System.Web.Ser vices.WebMethod Attribute(), _

System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://me.com/xml/wsdl/AppSec/getApplicationL ist",
RequestElementN ame:="getApplic ationListReques t",
RequestNamespac e:="http://me.com/xml/xsd/AppSec1.xsd",
ResponseNamespa ce:="http://me.com/xml/xsd/AppSec1.xsd",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)> _
Public MustOverride Function getApplicationL ist() As
<System.Xml.Ser ialization.XmlE lementAttribute ("apps")> application()

I would assume with all those "attributes " some sort of validation should
occur? FYI: I generate my server stubs using WSDL.exe, from a WSDL, that
was created with SOA Editor.

Thanks, Mike L.
--
Mike Logan

Nov 23 '05 #2
Hi Mike,

The .NET framework's xml webservice (asp.net) framework doesn't provide
buildin message validation by XSD... For customized Schema validation
through the XSD, we can utilize the SoapExtension in the ASP.NET webservice
framework. SoapExtension allow us to perform pre/post processing on
request/respone SOAP message stream. Also, we can define multiple
soapExtensions so as to chain them. Here is a msdn article mentioned using
SoapExtension to do Schema validation on ASP.NET webservice's SOAP message:

#Extend the ASP.NET WebMethod Framework by Adding XML Schema Validation
http://msdn.microsoft.com/msdnmag/is...tion/default.a
spx

Also, some additional tech article and reference on SOAPExtension:

# Using SOAP Extensions in ASP.NET
http://msdn.microsoft.com/msdnmag/is...n/default.aspx

#Altering the SOAP Message Using SOAP Extensions
http://msdn.microsoft.com/library/en...ringSOAPMessag
eUsingSOAPExten sions.asp?frame =true

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
Thread-Topic: Validate messages
thread-index: AcXa7JF9Y74BLei NRSSh4yojEX+1uQ ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2d hbg==?=" <Mi*******@comm unity.nospam>
References: <40************ *************** *******@microso ft.com>
Subject: RE: Validate messages
Date: Thu, 27 Oct 2005 04:50:03 -0700
Lines: 40
Message-ID: <88************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8383
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Well I just noticed that "WSDL.exe" doesn't generate a type with
"maxLength"
and "minLength" in the client proxy or server side stub. WSDL.exe
generates
a field instead of a property. I know that .Net 2.0 has an option for
generating properties instead of fields.

Also those attributes do not validate the message. In my XSD, I defined a
"complexTyp e" that a child element that was restricted on minLength and
maxLength. On the client, I was able to send that "complexTyp e" with more
than 50 characters, and it went through fine.

Thanks.
--
Mike Logan
"Mike Logan" wrote:
How do I validate messages? If my schema has a simpleType with facets like "minExclusi ve" and "maxLength" will the .Net framework validate the message before running the web service? This is what one of my server stubs look
like.

<System.Web.Ser vices.WebMethod Attribute(), _

System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://me.com/xml
/wsdl/AppSec/getApplicationL ist", RequestElementN ame:="getApplic ationListReques t",
RequestNamespac e:="http://me.com/xml/xsd/AppSec1.xsd",
ResponseNamespa ce:="http://me.com/xml/xsd/AppSec1.xsd",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)>
_ Public MustOverride Function getApplicationL ist() As
<System.Xml.Ser ialization.XmlE lementAttribute ("apps")> application()

I would assume with all those "attributes " some sort of validation should
occur? FYI: I generate my server stubs using WSDL.exe, from a WSDL, that was created with SOA Editor.

Thanks, Mike L.
--
Mike Logan


Nov 23 '05 #3
Hi Mike,

How are you doing on this issue, does the things mentioned in my last reply
helps a little?
If there're anything else we can help, please feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
X-Tomcat-ID: 53221011
References: <40************ *************** *******@microso ft.com>
<88************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001 _4EBBA602"
Content-Transfer-Encoding: 7bit
From: st*****@online. microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Fri, 28 Oct 2005 03:03:05 GMT
Subject: RE: Validate messages
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices
Message-ID: <Ef************ **@TK2MSFTNGXA0 1.phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Lines: 222
Path: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8397
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Mike,

The .NET framework's xml webservice (asp.net) framework doesn't provide
buildin message validation by XSD... For customized Schema validation
through the XSD, we can utilize the SoapExtension in the ASP.NET webservice
framework. SoapExtension allow us to perform pre/post processing on
request/respone SOAP message stream. Also, we can define multiple
soapExtensions so as to chain them. Here is a msdn article mentioned using
SoapExtension to do Schema validation on ASP.NET webservice's SOAP message:

#Extend the ASP.NET WebMethod Framework by Adding XML Schema Validation
http://msdn.microsoft.com/msdnmag/is...tion/default.a
spx

Also, some additional tech article and reference on SOAPExtension:

# Using SOAP Extensions in ASP.NET
http://msdn.microsoft.com/msdnmag/is...n/default.aspx

#Altering the SOAP Message Using SOAP Extensions
http://msdn.microsoft.com/library/en...ringSOAPMessag
eUsingSOAPExten sions.asp?frame =true

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
Thread-Topic: Validate messages
thread-index: AcXa7JF9Y74BLei NRSSh4yojEX+1uQ ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2d hbg==?=" <Mi*******@comm unity.nospam>
References: <40************ *************** *******@microso ft.com>
Subject: RE: Validate messages
Date: Thu, 27 Oct 2005 04:50:03 -0700
Lines: 40
Message-ID: <88************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8383
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Well I just noticed that "WSDL.exe" doesn't generate a type with
"maxLength"
and "minLength" in the client proxy or server side stub. WSDL.exe
generates
a field instead of a property. I know that .Net 2.0 has an option for
generating properties instead of fields.

Also those attributes do not validate the message. In my XSD, I defined a
"complexTyp e" that a child element that was restricted on minLength and
maxLength. On the client, I was able to send that "complexTyp e" with more
than 50 characters, and it went through fine.

Thanks.
--
Mike Logan
"Mike Logan" wrote:
How do I validate messages? If my schema has a simpleType with facets like "minExclusi ve" and "maxLength" will the .Net framework validate the message before running the web service? This is what one of my server stubs look
like.

<System.Web.Ser vices.WebMethod Attribute(), _

System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://me.com/xml
/wsdl/AppSec/getApplicationL ist", RequestElementN ame:="getApplic ationListReques t",
RequestNamespac e:="http://me.com/xml/xsd/AppSec1.xsd",
ResponseNamespa ce:="http://me.com/xml/xsd/AppSec1.xsd",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)>
_ Public MustOverride Function getApplicationL ist() As
<System.Xml.Ser ialization.XmlE lementAttribute ("apps")> application()

I would assume with all those "attributes " some sort of validation should
occur? FYI: I generate my server stubs using WSDL.exe, from a WSDL, that was created with SOA Editor.

Thanks, Mike L.
--
Mike Logan


Nov 23 '05 #4

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

Similar topics

9
2698
by: varois83 | last post by:
Hi Newbie here. I have been working on creating a guestbook for my site as practice and am learning a lot. Do you guys validate your forms first on the client with javascript and then on the server with PHP or just use one of the two and if yes which one? I don't want to reinvent the wheel too much. Thanks a lot
1
3868
by: Unknown User | last post by:
I just put an iframe in my page, but now the page doesn't validate. I guess I'm using legacy code: <iframe src="produtos.html" id="show-hide" frameborder="0" scrolling="no"></iframe> If I don't put frameborder="0" and scrolling="no", I have both an ugly grey border in IE and a scroll bar. Is there a way to do this using CSS? I tried border: none; but it doesn't work.
24
7115
by: Arno R | last post by:
Hi all, I have a client with several shoe-shops. Customers can leave their email-address if they want to be notified when there is a sale. Input is validated with instr() I am checking for @ and . (required) and also checking for spaces (not allowed). But: A LOT (5-10%) of the addresses still are wrong; (provider doesn't exist) or email-address not valid (anymore). When sending bulk-mail its a nasty problem to get the false addresses...
10
1975
by: Mike Logan | last post by:
I am using the "contract first" design methodology. Contract First is design the WSDL first then design the server and client. However I must design my XSD/XML Schema before anything. I am developing my schema now. I have a version on my schema. However once I start the server side code, how is the server now that the right "complexType" is being passed? What happens if this complexType my web service consumes needs to be...
1
1346
by: KMZ_state | last post by:
We have a debate here. We are receiving a CSV file specified by the user and need to validate the contents, writing the "good" records to the database and displaying the "bad" records to the user. One developer wants to loop through the CSV file right on the web layer (ASPX) and then only pass the "good" records onto the DAL. The other developer wants to pass the whole file as an OBJECT to the business logic layer and then loop through...
2
2849
by: Doru Roman | last post by:
Hi, I use C# to validate an XML document. It issues error messages and I do not understand why. Here is the XML document: <bookstore xmlns="http://tempuri.org/books.xsd"> <book genre="novel" style="hardcover">
26
25601
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any idea? Thanks you very much
0
1400
by: =?Utf-8?B?YyMganVua2ll?= | last post by:
Title says it ... my C# web application uses a number of FormViews that are inserted/updated/deleted via stored procedures. Is there a way thru C# coding (example?) to validate a date field as valid input before inserting/updating? Test the length of a varchar/char field? Validate an int field as valid numeric input (no alpha) ... and so on? I would like to do this validation before the stored procedures fire (perhaps stopping), of...
2
5721
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%= ViewData %>" /> -
0
8231
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
8672
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...
1
8330
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7153
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...
1
6107
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
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.