on 02-17-2011 3:22 PM
Hi all,
This concern an outbound scenario for GS1 DespatchAdvice message format.
We have to provide xml message with the sh: prefix tag in the outbound xml file like this :
<?xml version="1.0" encoding="UTF-8"?>
<sh:StandardBusinessDocument xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:deliver="urn:ean.ucc:deliver:2" xmlns:eanucc="urn:ean.ucc:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader ../Schemas/sbdh/StandardBusinessDocumentHeader.xsd urn:ean.ucc:2 ../Schemas/DespatchAdviceProxy.xsd">
<sh:StandardBusinessDocumentHeader>
<sh:HeaderVersion>1.0</sh:HeaderVersion>
<sh:Sender>
<sh:Identifier Authority="EAN.UCC">8654897000024</sh:Identifier>
<sh:ContactInformation>
<sh:Contact>parnter contact info.</sh:Contact>
<sh:ContactTypeIdentifier>Seller</sh:ContactTypeIdentifier>
</sh:ContactInformation>
</sh:Sender>
<sh:Receiver>
I have loaded the xsd as an external definition.
The message is ok, expecting for this <sh: prefix that I was not able to produce..
Here is the message produced by XI :
<?xml version="1.0" encoding="UTF-8"?>
<StandardBusinessDocument
xmlns = "http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
eanucc = "urn:ean.ucc:2"
xsi = "http://www.w3.org/2001/XMLSchema-instance"
schemaLocation = "http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader ../Schemas/sbdh/StandardBusinessDocumentHeader.xsd urn:ean.ucc:2 ../Schemas/DespatchAdviceProxy.xsd"
deliver = "urn:ean.ucc:deliver:2">
<StandardBusinessDocumentHeader>
<HeaderVersion>1.0</HeaderVersion>
<Sender>
<Identifier Authority = "EAN.UCC">65464689684</Identifier>
<ContactInformation>
<Contact>myParnterSeller</Contact>
<ContactTypeIdentifier>Seller</ContactTypeIdentifier>
</ContactInformation>
</Sender>
<Receiver>
<Identifier Authority = "EAN.UCC">608549819</Identifier>
<ContactInformation>
<Contact>myPartnerBuyer</Contact>
<ContactTypeIdentifier>Buyer</ContactTypeIdentifier>
</ContactInformation>
</Receiver>
<DocumentIdentification>
<Standard>EAN.UCC</Standard>
Any idea how to generate this prefix in the tag ??
We are using SAP XI 3.0 SP19.
Any help is welcome.
Regards,
>> Any idea how to generate this prefix in the tag ??
Yes, There are 2 ways to achieve this. 1 XMLAnonymizerBean and 2. Java Mapping
Using XMLAnonymizerBean is very simple. Go to module tab of your communication channel and do the module configuration to achieve this.
If your scenario is async use this module bean first followed by standard adapter.
Parameter Name: anonymizer.acceptNamespaces
Parameter Value: http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader sh
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use XMLAnonymizerBean
/people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
This tool is mostly used to remove namespaces and prefixes, but it also allows to add or change a prefix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
Thanks for the help.
I am agreee that the tag should not be mandatory, the xml message is semantically identicall, but our partner request it...
I have tried the way you suggested with the XMLAnonymizerBean module.
Using the module, it add sh prefrix to all tags, but I would only add the prefix to the tag that are part of the node StandardBusinessDocumentHeader lik in this example :
<?xml version="1.0" encoding="UTF-8" ?>
- <sh:StandardBusinessDocument xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:deliver="urn:ean.ucc:deliver:2" xmlns:eanucc="urn:ean.ucc:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader ../Schemas/sbdh/StandardBusinessDocumentHeader.xsd urn:ean.ucc:2 ../Schemas/DespatchAdviceProxy.xsd">
- <sh:StandardBusinessDocumentHeader>
<sh:HeaderVersion>1.0</sh:HeaderVersion>
+ <sh:Sender>
+ <sh:Receiver>
+ <sh:DocumentIdentification>
</sh:StandardBusinessDocumentHeader>
- <eanucc:message>
- <entityIdentification>
<uniqueCreatorIdentification>0081563909</uniqueCreatorIdentification>
- <contentOwner>
<gln>8715365000009</gln>
</contentOwner>
</entityIdentification>
- <command>
- <eanucc:documentCommand>
- <documentCommandHeader type="ADD">
any idea how to add this tag prefix to some nodes of the message only ?
<?xml version="1.0" encoding="utf-8" ?>
- <sh:StandardBusinessDocument xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader">
- <sh:StandardBusinessDocumentHeader>
<sh:HeaderVersion>1.0</sh:HeaderVersion>
+ <sh:Sender>
+ <sh:Receiver>
+ <sh:DocumentIdentification>
</sh:StandardBusinessDocumentHeader>
- <sh:message> From here sh prefix is not expected
- <sh:entityIdentification>
<sh:uniqueCreatorIdentification>0081298965</sh:uniqueCreatorIdentification>
- <sh:contentOwner>
<sh:gln>3012502620904</sh:gln>
</sh:contentOwner>
</sh:entityIdentification>
- <sh:command>
- <sh:documentCommand>
- <sh:documentCommandHeader type="ADD">
- <sh:entityIdentification>
<sh:uniqueCreatorIdentification>0081298965</sh:uniqueCreatorIdentification>
- <sh:contentOwner>
<sh:gln>3012502620904</sh:gln>
</sh:contentOwner>
</sh:entityIdentification>
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.