BizTalk Server - HOWTO resolve schema by an XML instance root element

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server > June 2004 > HOWTO resolve schema by an XML instance root element





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HOWTO resolve schema by an XML instance root element
Viktor

2004-06-28, 7:28 pm

Hi,

http://msdn.microsoft.com/library/d....asp?frame=true article says:

"Pipeline components that receive XML messages determine the message type by examining the message root element and namespace. If a schema does not have a namespace defined for it, the message type is "<rootNode>".

I have an XML instance coming out of a third-party system and it does not carry the "xmlns" attribute: <DocumentType1>...</DocumentType1> for example. So I created a schema with targetNamespace="DocumentType1" and deployed it to the BizTalk Server. Howeve
r, when I submit the message I get the following error:

"The disassembler cannot retrieve the document specification by using this type: "DocumentType1". Either the schema is not deployed correctly, or more than one schema is deployed for the same message type."

So apparently BizTalk can not resolve the schema. I also tried setting targetNamespace to "http://DocumentType1", "http://BizTalk_Server_Project1.DocumentType1", "http://tempuri.org/DocumentType1" nothing worked. As soon as I change the instance to someth
ing like "ns0:<DocumentType1 xmlns:ns0="http://BizTalk_Server_Project1.DocumentType1">...</ns0:DocumentType1>" and deploy the schema with targetNamespace="http://BizTalk_Server_Project1.DocumentType1" it works fine, but this is not something I can get out
of the third-party system. I do not like the idea of hardwiring the schema in a custom pipeline component to solve the issue.

Any Help on getting this to work is much appreciated,

Viktor
Tatyana Yakushev [MSFT]

2004-06-29, 5:51 pm

You need to set target namespace to empty value because the XML doesn't have any namespace.
Root node name should be DocumentType1 because this is the name of the root in your XML.

Did you know that Schema Editor can generate schema for you based on the XML instance?
Create new or open existing project, right-click on the project in solution explorer, in the context menu select Add | Add Generated Items...
At the dialog select "Generate Schemas".
At the new dialog set Document Type to "Well-Formed XML", select instance document and click OK.

Regards,
Tatyana

--------------------
>Thread-Topic: HOWTO resolve schema by an XML instance root element
>thread-index: AcRdQxeRC3aa49inRI+3JQncuq2ooQ==
>X-WBNR-Posting-Host: 65.110.174.162
>From: =?Utf-8?B?VmlrdG9y?= <Viktor@discussions.microsoft.com>
>Subject: HOWTO resolve schema by an XML instance root element
>Date: Mon, 28 Jun 2004 12:07:01 -0700
>Lines: 15
>Message-ID: <BFE8B6ED-27B0-4CC8-A5EE-3EABBFFCB946@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.biztalk.server
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.server:9764
>X-Tomcat-NG: microsoft.public.biztalk.server
>
>Hi,
>
>http://msdn.microsoft.com/library/d....asp?frame=true article says:
>
>"Pipeline components that receive XML messages determine the message type by examining the message root element and namespace. If a schema does not have

a namespace defined for it, the message type is "<rootNode>".
>
>I have an XML instance coming out of a third-party system and it does not carry the "xmlns" attribute: <DocumentType1>...</DocumentType1> for example. So I

created a schema with targetNamespace="DocumentType1" and deployed it to the BizTalk Server. However, when I submit the message I get the following error:
>
>"The disassembler cannot retrieve the document specification by using this type: "DocumentType1". Either the schema is not deployed correctly, or more than one

schema is deployed for the same message type."
>
>So apparently BizTalk can not resolve the schema. I also tried setting targetNamespace to "http://DocumentType1",

"http://BizTalk_Server_Project1.DocumentType1", "http://tempuri.org/DocumentType1" nothing worked. As soon as I change the instance to something like "ns0:
<DocumentType1 xmlns:ns0="http://BizTalk_Server_Project1.DocumentType1">...</ns0:DocumentType1>" and deploy the schema with
targetNamespace="http://BizTalk_Server_Project1.DocumentType1" it works fine, but this is not something I can get out of the third-party system. I do not like the idea of
hardwiring the schema in a custom pipeline component to solve the issue.
>
>Any Help on getting this to work is much appreciated,
>
>Viktor
>



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

Viktor

2004-06-29, 5:52 pm

That worked - thank you very much! And the tool is really useful.

I do have a follow up question though...

Do promoted properties supposed to work with such schemas that do not have a namespace?

My schema carries a promoted attribute which I then wire up in a send port's filter. It works fine when both my schema and the property schema have the targetNamespace specified. As soon as I set namespace for my schema to empty and submit now stripped me
ssage - the send port isn't getting message anymore and I am observing "Could not find a matching subscription for the message" error written to event log. Property schema seems to require a namespace - once I set it to blank it puts one back in.

Thanks in advance,

Viktor

"Tatyana Yakushev [MSFT]" wrote:

> You need to set target namespace to empty value because the XML doesn't have any namespace.
> Root node name should be DocumentType1 because this is the name of the root in your XML.
>
> Did you know that Schema Editor can generate schema for you based on the XML instance?
> Create new or open existing project, right-click on the project in solution explorer, in the context menu select Add | Add Generated Items...
> At the dialog select "Generate Schemas".
> At the new dialog set Document Type to "Well-Formed XML", select instance document and click OK.
>
> Regards,
> Tatyana
>
> --------------------
> a namespace defined for it, the message type is "<rootNode>".
> created a schema with targetNamespace="DocumentType1" and deployed it to the BizTalk Server. However, when I submit the message I get the following error:
> schema is deployed for the same message type."
> "http://BizTalk_Server_Project1.DocumentType1", "http://tempuri.org/DocumentType1" nothing worked. As soon as I change the instance to something like "ns0:
> <DocumentType1 xmlns:ns0="http://BizTalk_Server_Project1.DocumentType1">...</ns0:DocumentType1>" and deploy the schema with
> targetNamespace="http://BizTalk_Server_Project1.DocumentType1" it works fine, but this is not something I can get out of the third-party system. I do not like the idea of
> hardwiring the schema in a custom pipeline component to solve the issue.
>
>
> --
>
> This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
> Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com