Discussion:
Obsolete class XmlSchemaCollection
(too old to reply)
mustang
2007-09-24 13:18:00 UTC
Permalink
I have created a custom receive pipeline component and I need to validate the
incoming message contents against the schema. Currently I use the pipeline
context property to obtain the schema. My code looks something like this:


private static System.Xml.Schema.XmlSchemaSet
GetSchemaSet(Microsoft.BizTalk.Component.Interop.IPipelineContext
pContext)
{
System.Xml.Schema.XmlSchemaSet schemaSet;
Microsoft.BizTalk.Component.Interop.IDocumentSpec docSpec;
System.Xml.Schema.XmlSchemaCollection schemaCollection;

try {
docSpec = pContext.GetDocumentSpecByType(DOC_SPEC_TYPE);
schemaCollection = docSpec.GetSchemaCollection();

if (schemaCollection.Count > 0) {
schemaSet = new System.Xml.Schema.XmlSchemaSet();
foreach (System.Xml.Schema.XmlSchema schema in schemaCollection) {
schemaSet.Add(schema);
}
}
}
catch { /* If any errors occur, just return a null SchemaSet */ }

return schemaSet;
}

According to Microsoft's documentation, XmlSchemaCollection is an obsolete
class, yet this is the return type for IDocumentSpec.GetSchemaCollection. Am
I handling this the wrong way, or is there another way I could be loading the
schemas into a XmlSchemaSet collection?

Thanks in advance.

-mustang
WenJun Zhang[msft]
2007-09-25 11:04:02 UTC
Permalink
Hi,

I've replied in your another thread. Using the GetSchemaCollection() call
is still a common approach to retrieve the schema. Another way is write
document spec info into the incoming message's context directly as the
Schema Resolver Component sample in SDK:

Schema Resolver Component (BizTalk Server Sample)
http://msdn2.microsoft.com/en-us/library/aa577629.aspx

Please let me know if you still have any concern on this issue.

Thanks.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
WenJun Zhang[msft]
2007-09-27 13:59:05 UTC
Permalink
Hi,

Just want to check if you still have any question regarding to this issue?

Thanks and have a great day.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...