Repeating Dynamic Schema Elements
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Repeating Dynamic Schema Elements




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Repeating Dynamic Schema Elements  
Steve Murphy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 07:46 AM

Hi,

I'm a bit of a newbie to BizTalk so please bare with me as I ask this
question.

We are currently investigating utilizing BizTalk 2004 to handle order
provisioning for our enterprise. The process obviously involves receiving an
order schema/message, and processing the individual line items within the
order to provision each product ordered (presumably each product type has it
s
own schema). My problem is that depending on the product ordered, the
attributes will differ. I need to find a way to get biztalk to access
properties dynamically so I can access them from inside an orchestration and
make business decisions on them individually.

Do we need to promote elements of a schema even if they may not exist in a
given message, or can we promote dyamically (after determining the sub-schem
a
type), or do we need to write XPath queries to extract data manually.

Can this be done? or am I on the wrong track completely? Any help or links
to related examples would be greatly appreciated.

see below for my first attempt at the XSD schema we will need to process:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://OrderGateway.Order"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://OrderGateway.Order"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="Existing">
<xs:complexType>
<xs:sequence>
<xs:element name="Username">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Password">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="New">
<xs:complexType>
<xs:sequence>
<xs:element name="Firstname">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Lastname">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Email">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Phone">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Fax">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Mobile">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="StreetAddress">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Suburb">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="State">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Postcode">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Country">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Item">
<xs:complexType>
<xs:sequence>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:choice minOccurs="1">
<xs:element name="DomainRegistration">
<xs:complexType>
<xs:sequence>
<xs:element name="Domain">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="SupportingRule"
nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:choice minOccurs="0">
<xs:element name="Company">
<xs:complexType>
<xs:sequence>
<xs:element name="CompanyName">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="ABN">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="ACN">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RegisteredBusiness">
<xs:complexType>
<xs:sequence>
<xs:element name="BusinessName">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="State">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="RBN">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Proprietor">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element name="BillingPeriod">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Hosting">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="Platform">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="Size">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="BillingPeriod">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Thanks.





[ Post a follow-up to this message ]



    RE: Repeating Dynamic Schema Elements  
Matt Meleski


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:52 PM

Steve,

I would use xpath to access your xml elements/attributes
in your orchestration. There are a number of blog examples of using xpath
inside of
orchestrations in Alan Smith's bloggers guide to Biztalk :

http://geekswithblogs.com/asmith/ar...2/12/17341.aspx

Additionally, you could pass your XML instances to a .Net helper component
inside of your Orchestrations. These helper components would have the
necessary code in them to dynamically access data inside of your xml and
return
the necessary information back to your orchestration.

for example a .net helper class method would look like this:

public string getDynamicInformation(System.Xml.XmlDocument myOrchDocument)
{
// code here to access the document


}


Matt.

"Steve Murphy" wrote:

> Hi,
>
> I'm a bit of a newbie to BizTalk so please bare with me as I ask this
> question.
>
> We are currently investigating utilizing BizTalk 2004 to handle order
> provisioning for our enterprise. The process obviously involves receiving 
an
> order schema/message, and processing the individual line items within the
> order to provision each product ordered (presumably each product type has 
its
> own schema). My problem is that depending on the product ordered, the
> attributes will differ. I need to find a way to get biztalk to access
> properties dynamically so I can access them from inside an orchestration a
nd
> make business decisions on them individually.
>
> Do we need to promote elements of a schema even if they may not exist in a
> given message, or can we promote dyamically (after determining the sub-sch
ema
> type), or do we need to write XPath queries to extract data manually.
>
> Can this be done? or am I on the wrong track completely? Any help or links
> to related examples would be greatly appreciated.
>
> see below for my first attempt at the XSD schema we will need to process:
>
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema xmlns="http://OrderGateway.Order"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://OrderGateway.Order"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>   <xs:element name="Order">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element name="Customer">
>           <xs:complexType>
>             <xs:sequence>
>               <xs:choice minOccurs="1" maxOccurs="1">
>                 <xs:element name="Existing">
>                   <xs:complexType>
>                     <xs:sequence>
>                       <xs:element name="Username">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Password">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                     </xs:sequence>
>                   </xs:complexType>
>                 </xs:element>
>                 <xs:element name="New">
>                   <xs:complexType>
>                     <xs:sequence>
>                       <xs:element name="Firstname">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Lastname">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Email">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Phone">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:positiveInteger" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Fax">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:positiveInteger" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Mobile">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:positiveInteger" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="StreetAddress">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Suburb">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="State">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Postcode">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                       <xs:element name="Country">
>                         <xs:complexType>
>                           <xs:simpleContent>
>                             <xs:extension base="xs:string" />
>                           </xs:simpleContent>
>                         </xs:complexType>
>                       </xs:element>
>                     </xs:sequence>
>                   </xs:complexType>
>                 </xs:element>
>               </xs:choice>
>             </xs:sequence>
>           </xs:complexType>
>         </xs:element>
>         <xs:element name="Item">
>           <xs:complexType>
>             <xs:sequence>
>               <xs:sequence minOccurs="1" maxOccurs="unbounded">
>                 <xs:choice minOccurs="1">
>                   <xs:element name="DomainRegistration">
>                     <xs:complexType>
>                       <xs:sequence>
>                         <xs:element name="Domain">
>                           <xs:complexType>
>                             <xs:simpleContent>
>                               <xs:extension base="xs:string" />
>                             </xs:simpleContent>
>                           </xs:complexType>
>                         </xs:element>
>                         <xs:element minOccurs="0" name="SupportingRule"
> nillable="true">
>                           <xs:complexType>
>                             <xs:simpleContent>
>                               <xs:extension base="xs:string" />
>                             </xs:simpleContent>
>                           </xs:complexType>
>                         </xs:element>
>                         <xs:choice minOccurs="0">
>                           <xs:element name="Company">
>                             <xs:complexType>
>                               <xs:sequence>
>                                 <xs:element name="CompanyName">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                                 <xs:element name="ABN">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                                 <xs:element name="ACN">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                               </xs:sequence>
>                             </xs:complexType>
>                           </xs:element>
>                           <xs:element name="RegisteredBusiness">
>                             <xs:complexType>
>                               <xs:sequence>
>                                 <xs:element name="BusinessName">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                                 <xs:element name="State">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                                 <xs:element name="RBN">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                                 <xs:element name="Proprietor">
>                                   <xs:complexType>
>                                     <xs:simpleContent>
>                                       <xs:extension base="xs:string" />
>                                     </xs:simpleContent>
>                                   </xs:complexType>
>                                 </xs:element>
>                               </xs:sequence>
>                             </xs:complexType>
>                           </xs:element>
>                         </xs:choice>
>                         <xs:element name="BillingPeriod">
>                           <xs:complexType>
>                             <xs:simpleContent>
>                               <xs:extension base="xs:positiveInteger" />
>                             </xs:simpleContent>
>                           </xs:complexType>
>                         </xs:element>
>                       </xs:sequence>
>                     </xs:complexType>
>                   </xs:element>
>                   <xs:element name="Hosting">
>                     <xs:complexType>
>                       <xs:sequence>
>                         <xs:element minOccurs="1" name="Platform">
>                           <xs:complexType>
>                             <xs:simpleContent>
>                               <xs:extension base="xs:string" />
>                             </xs:simpleContent>
>                           </xs:complexType>
>                         </xs:element>
>                         <xs:element minOccurs="1" name="Size">
>                           <xs:complexType>
>                             <xs:simpleContent>
>                               <xs:extension base="xs:positiveInteger" />
>                             </xs:simpleContent>
>                           </xs:complexType>
>                         </xs:element>
>                         <xs:element minOccurs="1" name="BillingPeriod">
>                           <xs:complexType>
>                             <xs:simpleContent>
>                               <xs:extension base="xs:positiveInteger" />
>                             </xs:simpleContent>
>                           </xs:complexType>
>                         </xs:element>
>                       </xs:sequence>
>                     </xs:complexType>
>                   </xs:element>
>                 </xs:choice>
>               </xs:sequence>
>             </xs:sequence>
>           </xs:complexType>
>         </xs:element>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
> </xs:schema>
>
> Thanks.





[ Post a follow-up to this message ]



    RE: Repeating Dynamic Schema Elements  
Steve Murphy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-23-04 07:46 AM

Thanks Mat,

From you reply I assume that I'm at least headed in the right direction (in
terms of what I expect biztalk to do).

Being still in a proof of concept phase of the project I'll investigate both
of your suggested methods and try to post back some info on which we ended u
p
running with.

Steve.

"Matt Meleski" wrote:
[vbcol=seagreen]
> Steve,
>
> I would use xpath to access your xml elements/attributes
> in your orchestration. There are a number of blog examples of using xpath
> inside of
> orchestrations in Alan Smith's bloggers guide to Biztalk :
>
> http://geekswithblogs.com/asmith/ar...2/12/17341.aspx
>
> Additionally, you could pass your XML instances to a .Net helper component
> inside of your Orchestrations. These helper components would have the
> necessary code in them to dynamically access data inside of your xml and
> return
> the necessary information back to your orchestration.
>
> for example a .net helper class method would look like this:
>
> public string getDynamicInformation(System.Xml.XmlDocument myOrchDocument)
> {
>    // code here to access the document
>
>
> }
>
>
> Matt.
>
> "Steve Murphy" wrote:
> 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:11 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register