none
changing namespace of EDI schema RRS feed

  • Question

  • I have scenario that 850 is outbound as well as inbound. To deploy schema I need to change namespace I made this chaning in schema by  replacing target namespace and xmlns. But when I try to test it in visual studio structure of generated file is different than xml get from pipeline.  Please help me to fix this issue 

    Namespace change as below 

    <?xml version="1.0" encoding="utf-16" ?>
    - <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006" xmlns:btsedi="http://schemas.microsoft.com/BizTalk/2005/EdiSchemaEditorExtension" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:annotation>
    - <xs:appinfo>
    <schemaEditorExtension:schemaInfo namespaceAlias="btsedi" extensionClass="Microsoft.BizTalk.Edi.SchemaEditorExtension.EdiSchemaExtension" standardName="EDI" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
    <b:schemaInfo version="1.0" document_type="850" standard="EDI" standards_version="00401" root_reference="X12_00401_850" displayroot_reference="X12_00401_850" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" X12ConditionDesignator_Check="No" />
    </xs:appinfo>

    </xs:annotation>

    Generated output as below(I do not want to keep adding namespace for every element.

    <gen0:X12_00401_850 xmlns:gen0="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    - <ST>
    <ST01>850</ST01>
    <ST02>ST02</ST02>
    </ST>
    - <gen1:BEG xmlns:gen1="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <BEG01>00</BEG01>
    <BEG02>AB</BEG02>
    <BEG03>BEG03</BEG03>
    <BEG05>01230123</BEG05>
    </gen1:BEG>
    - <gen2:CUR xmlns:gen2="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <CUR01>001</CUR01>
    <CUR02>CUR</CUR02>
    </gen2:CUR>
    - <gen3:REF xmlns:gen3="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <REF01>01</REF01>
    - <gen4:C040 xmlns:gen4="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <C04001>01</C04001>
    <C04002>C04002</C04002>
    </gen4:C040>
    </gen3:REF>
    - <gen5:PER xmlns:gen5="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <PER01>1A</PER01>
    </gen5:PER>

    Monday, August 22, 2016 10:42 PM

Answers

  • Hi,

    Like the  Experts suggest change the EDI Schema namespace. You will be required to rebuild the map again.

    Another very important thing to check for will be all the XSLT and XPath used in your solution, make sure they are reflecting the new namespace you have incorporated since the project rebuild not give you any error pertaining to that, you will only find it at runtime.


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.


    Wednesday, August 24, 2016 2:34 PM
  • You should always change the namespace on the EDI messages because different Trading Partners will most often have slightly different requirements and changing the namespace is a way to separate the messages, even if they are the same EDI transaction.
    Tuesday, August 23, 2016 12:03 PM
    Moderator

All replies

  • NVM looks like file is issue not namespace
    Monday, August 22, 2016 11:04 PM
  • For clarity, all you should do is change the Target Namespace property on the <Schema> Node of the EDI Schema.  That's all.

    In practice, you should always do this.

    Monday, August 22, 2016 11:28 PM
    Moderator
  • Hi dnyanbhar,

    Input

    <?xml version="1.0" encoding="utf-16"?>

    -<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006" xmlns:btsedi="http://schemas.microsoft.com/BizTalk/2005/EdiSchemaEditorExtension" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    -<xs:annotation>
    -<xs:appinfo>
    <schemaEditorExtension:schemaInfonamespaceAlias="btsedi" extensionClass="Microsoft.BizTalk.Edi.SchemaEditorExtension.EdiSchemaExtension" standardName="EDI" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
    <b:schemaInfoversion="1.0" document_type="850" standard="EDI" standards_version="00401" root_reference="X12_00401_850" displayroot_reference="X12_00401_850" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" X12ConditionDesignator_Check="No" />
    </xs:appinfo>

    </xs:annotation>

    Output:

    gen0:X12_00401_850 xmlns:gen0="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    -<ST>
    <ST01>850</ST01>
    <ST02>ST02</ST02>
    </ST>
    -<gen1:BEG xmlns:gen1="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <BEG01>00</BEG01>
    <BEG02>AB</BEG02>
    <BEG03>BEG03</BEG03>
    <BEG05>01230123</BEG05>
    </gen1:BEG>
    -<gen2:CUR xmlns:gen2="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <CUR01>001</CUR01>
    <CUR02>CUR</CUR02>
    </gen2:CUR>
    -<gen3:REF xmlns:gen3="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <REF01>01</REF01>
    -<gen4:C040 xmlns:gen4="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <C04001>01</C04001>
    <C04002>C04002</C04002>
    </gen4:C040>
    </gen3:REF>
    -<gen5:PER xmlns:gen5="http://schemas.microsoft.com/BizTalk/EDI850IN/X12/2006">
    <PER01>1A</PER01>
    </gen5:PER>

    The target name space value in both the input and the output is same ..as Johns305 has pointed out the correct way to go in this or any case when you have same schema for input and output, you just need to change the target namespace property..this makes both the input and putput messages unique because the message type is nothing but targetnamespace#rootnode..thus changing the target namespace is sufficient to over come the issue..

    Regards


    Mandar Dharmadhikari

    Tuesday, August 23, 2016 3:34 AM
    Moderator
  • When dealing with standard schemas IMHO changing namespaces is not a good option. I however wish to understand more on why you think you cannot use the same schema for inbound and outbound processes ?

    The schema should be deployed as a common artifact and accessed by both processes. The orchestration port binding would ensure that your inbound and outbound messages do not get mixed up.

    Regards.

    Tuesday, August 23, 2016 4:47 AM
  • You should always change the namespace on the EDI messages because different Trading Partners will most often have slightly different requirements and changing the namespace is a way to separate the messages, even if they are the same EDI transaction.
    Tuesday, August 23, 2016 12:03 PM
    Moderator
  • Hi,

    Like the  Experts suggest change the EDI Schema namespace. You will be required to rebuild the map again.

    Another very important thing to check for will be all the XSLT and XPath used in your solution, make sure they are reflecting the new namespace you have incorporated since the project rebuild not give you any error pertaining to that, you will only find it at runtime.


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.


    Wednesday, August 24, 2016 2:34 PM