CS 2007 OrderGroupCollecion to PurchaseOrder with BizTalk2006 - best practice

Hi

I am querying CS 2007 with an OrderQuery from within Biztalk 2006 and this returns a group of Purchase orders.

My question:

As i only want to process 1 Purchase order at a time should / can i envelope the OrderGroupCollection within a receive pipe or should i use a looping map once the message has arrived in the Orcastration

Thanks in advance

Simon




Answer this question

CS 2007 OrderGroupCollecion to PurchaseOrder with BizTalk2006 - best practice

  • zdrae

    Hey Simon,

    You mention that you are "Querying through a OrdersQuery" and it's returning a group of Purchase Orders. That is correct. On a Orders Query using the Orders Adapter Send Port, you do not have the option to specific one order per message, it will return multiple orders per message in this case. Jeff is right, on the receive port(on Orders Export), you do have the option for one order per message versus multiple orders per message.

    So if you are using the Orders Send Adapter's Order Query functionality, you will need to use a pipeline or orchestration to dissassemble the message into multiple purchase orders per message.

    Hope this helps!

    Alan



  • BobInIndy

    My apologies Alan, your last post has lead me to identify what we where doing wrong in the enveloping. Our xpath expression was pointing to the actual PurchaseOrder node when it should have been pointing to the containing node of the document we wanted to envelope. As a result it was trying to envelope at the OrderForms level and not the PurchaseOrder level. We rectified the problem by changing the xpath expression to :

    /*[local-name()='OrderGroups' and namespace-uri()='']

    Thankyou for your fast responses.

    Cheers

    Glyn



  • Paul.Brown

    Hey Glyn,

    How and where are you splitting the OrderGroup collection Are you splitting on the "<PurchaseOrder>" node It "sounds" like you are splitting it at the OrderForm level and BizTalk is trying to resolve that message against that schema, which doesn't exist out of the box. If you are splitting against the PurchaseOrder schema then you should be fine. I need more information on exactly what/how you are splitting the order to be confident.

    In terms of target namespaces, you do not need target namespaces if you only have one schema associated with the root node. For instance, if you have two schema documents that have <PurchaseOrder> as the root node, then BizTalk will use the Target Namespace to resolve against the different versions. So if you have only 1 schema with that root node, you don't need a target namespace. Clear as mud, right :-)

    Let me know if this helps or if you have additional questions/concerns.

    Thanks

    Alan



  • Ross Watson

    Simon,

    The CS2007 "Orders" Adapter for BTS2006 contains an "Adapter Endpoint Property" called "Orders Per Message" which can be set to "One Order Per Message". This should create separate messages, each containing only one purchase order. This property is set using the BizTalk Server 2006 Administrative Console.

    Jeff Lynch
    MVP Windows Server System - Commerce Server
    http://codebetter.com/blogs/jeff.lynch



  • Chang Chen

    Many thanks

    Simon



  • BhuttCrackSpackle

    Awesome, glad you were able to find the fix.

    Let us know if you have anymore questions/issues.

    Thanks

    Alan



  • David_68

    Hi Alan,

    I am currently trying to dissasemble an OrderGroupCollection into individual purchase orders in an xml pipeline using an envelope in the OrderGroupCollection pointing to the PurchaseOrder node, however, Biztalk when it recives the Collection message and tries to slit the message throws an exception due to not being able to frind the OrderForms schema document.

    I have deployed all the schemas found in the sdk as 1 dll so it should find all the correct schemas.

    Should we be adding target namespaces to teh out of the box schemas

    Is what i am trying to do possible and if so are there any gotchas

    Thanks for your help in advance.

    Cheers

    Glyn



  • MEder

    Hey Glyn,

    Where are you making these settings at below Is this in the Configure Pipeline screen for the default XMLPipeline or have you created a custom pipeline in Visual Studio Is this set through an Orchestration

    Envelope property on the Schema node to Yes, and set the Body XPath property on the OrderGroups node to

    /*[local-name()='OrderGroups' and namespace-uri()='']/*[local-name()='PurchaseOrder' and namespace-uri()='']


    Thanks

    Alan



  • KimberlyL

    Hi Alan,

    The above settings where applied to the OrderGroupCollectionSchema in the properties window in Visual Studio.
    We are using the default XML pipeline, and we are not using any orchestrations.
    We where following an example on enveloping from the Biztalk 2006 Recipes: A Problem - Solution Approach. However it does not seem to work in this scenario, or more likely we are doing it wrong.

    How would you recommend that we envelope / de-envelope the message

    Cheers

    Glyn

  • niallhannon

    Hi Alan,

    Thanks for your quick response, We have set the Envelope property on the Schema node to Yes, and set the Body XPath property on the OrderGroups node to

    /*[local-name()='OrderGroups' and namespace-uri()='']/*[local-name()='PurchaseOrder' and namespace-uri()='']

    We configured an Order Adapter as a receive port and configured it to provide multiple orders per message. Currently we have a Send Port listening on the Receive port and writing the orders to a file location.

    When we run the receive location with a pass through pipeline we get a message for each call in the output folder, however when we switch the pipeline to an XML Receive pipline we get the following errors,

    There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port: "ReceivePort2" URI: "CommerceServerOrdersReceive://CSOrder2/https://levisbo.dev.snowvalley.com/OrdersWebService/OrdersWebService.asmx" Reason: Finding the document specification by message type "OrderForms" failed. Verify the schema deployed properly.

    and

    A message received by adapter "CommerceServerOrders" on receive location "Receive Location3" with URI "CommerceServerOrdersReceive://CSOrder2/https://levisbo.dev.snowvalley.com/OrdersWebService/OrdersWebService.asmx" is suspended.
    Error details: There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port: "ReceivePort2" URI: "CommerceServerOrdersReceive://CSOrder2/https://levisbo.dev.snowvalley.com/OrdersWebService/OrdersWebService.asmx" Reason: Finding the document specification by message type "OrderForms" failed. Verify the schema deployed properly.
    MessageId: {FBA0619F-7D75-4D21-970E-4CCC0CD63ECE}
    InstanceID: {380120EC-038A-42AE-8143-4A7D618AF215}

    Thanks for your help in advance.

    Cheers

    Glyn








  • CS 2007 OrderGroupCollecion to PurchaseOrder with BizTalk2006 - best practice