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/issues/03/07/XMLSchemaValidation/default.a
spx
Also, some additional tech article and reference on SOAPExtension:
# Using SOAP Extensions in ASP.NET
http://msdn.microsoft.com/msdnmag/issues/04/03/ASPColumn/default.aspx
#Altering the SOAP Message Using SOAP Extensions
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconAlteringSOAPMessag
eUsingSOAPExtensions.asp?frame=true
Regards,
Steven Cheng
Microsoft Online Support

Signature
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: AcXa7JF9Y74BLeiNRSSh4yojEX+1uQ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2dhbg==?=" <MikeLogan@community.nospam>
References: <4016FE91-C136-4C05-853D-564C1E44BF08@microsoft.com>
Subject: RE: Validate messages
Date: Thu, 27 Oct 2005 04:50:03 -0700
Lines: 40
Message-ID: <889CC1B2-3EB5-4C11-A52C-30D3D47FF5FA@microsoft.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.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8383
X-Tomcat-NG: microsoft.public.dotnet.framework.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
"complexType" that a child element that was restricted on minLength and
maxLength. On the client, I was able to send that "complexType" with more
than 50 characters, and it went through fine.
Thanks.

Signature
Mike Logan
> How do I validate messages? If my schema has a simpleType with facets like
> "minExclusive" and "maxLength" will the .Net framework validate the message
[quoted text clipped - 3 lines]
> <System.Web.Services.WebMethodAttribute(), _
>
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://me.com/xml
/wsdl/AppSec/getApplicationList",
> RequestElementName:="getApplicationListRequest",
> RequestNamespace:="http://me.com/xml/xsd/AppSec1.xsd",
> ResponseNamespace:="http://me.com/xml/xsd/AppSec1.xsd",
> Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
> Public MustOverride Function getApplicationList() As
> <System.Xml.Serialization.XmlElementAttribute("apps")> application()
[quoted text clipped - 4 lines]
>
> Thanks, Mike L.
Steven Cheng[MSFT] - 01 Nov 2005 14:53 GMT
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

Signature
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
X-Tomcat-ID: 53221011
References: <4016FE91-C136-4C05-853D-564C1E44BF08@microsoft.com>
<889CC1B2-3EB5-4C11-A52C-30D3D47FF5FA@microsoft.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_4EBBA602"
Content-Transfer-Encoding: 7bit
From: stcheng@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.public.dotnet.framework.webservices
Message-ID: <EfJJmw22FHA.1172@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 222
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.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/issues/03/07/XMLSchemaValidation/default.a
spx
Also, some additional tech article and reference on SOAPExtension:
# Using SOAP Extensions in ASP.NET
http://msdn.microsoft.com/msdnmag/issues/04/03/ASPColumn/default.aspx
#Altering the SOAP Message Using SOAP Extensions
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconAlteringSOAPMessag
eUsingSOAPExtensions.asp?frame=true
Regards,
Steven Cheng
Microsoft Online Support

Signature
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: AcXa7JF9Y74BLeiNRSSh4yojEX+1uQ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2dhbg==?=" <MikeLogan@community.nospam>
References: <4016FE91-C136-4C05-853D-564C1E44BF08@microsoft.com>
Subject: RE: Validate messages
Date: Thu, 27 Oct 2005 04:50:03 -0700
Lines: 40
Message-ID: <889CC1B2-3EB5-4C11-A52C-30D3D47FF5FA@microsoft.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.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8383
X-Tomcat-NG: microsoft.public.dotnet.framework.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
"complexType" that a child element that was restricted on minLength and
maxLength. On the client, I was able to send that "complexType" with more
than 50 characters, and it went through fine.
Thanks.

Signature
Mike Logan
"Mike Logan" wrote:
> How do I validate messages? If my schema has a simpleType with facets
like
> "minExclusive" 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.Services.WebMethodAttribute(), _
>
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://me.com/xml
/wsdl/AppSec/getApplicationList",
> RequestElementName:="getApplicationListRequest",
> RequestNamespace:="http://me.com/xml/xsd/AppSec1.xsd",
> ResponseNamespace:="http://me.com/xml/xsd/AppSec1.xsd",
> Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
> Public MustOverride Function getApplicationList() As
> <System.Xml.Serialization.XmlElementAttribute("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.