on 10-19-2010 3:44 PM
Hello,
I am looking for a help that I need to insert/add a namespace prefix in incoming xml.
I have a Proxy Synchronous webservice call to thirdparty application from ECC through PI, we are getting the below reponse xml without namspace prefixes.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- XML Validation Outbound Channel Response -->
<getUpdateListResp xmlns="http://xyz/mdm" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<item xmlns="">46000</item>
<item xmlns="">46001</item>
<item xmlns="">46002</item>
</getUpdateListResp>
I need to insert namespace prefix to the above xml as shown below:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- XML Validation Outbound Channel Response -->
<ns0:getUpdateListResp xmlns:ns0 ="http://xyz/mdm" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns0:item xmlns="">46000</ns0:item>
<ns0:item xmlns="">46001</ns0:item>
<ns0:item xmlns="">46002</ns0:item>
</ns0:getUpdateListResp>
I have checked the forum and blogs for AnnonymizerBean for outgoing(request) xml but I did not see how to alter incoming xml
Appriciate your help on this?
Thanks,
Laxman
> I have checked the forum and blogs for AnnonymizerBean for outgoing(request) xml but I did not see how to alter incoming xml
You can put the XMLAnnnymizerBean after the standard module, then it works on the response message.
If you do mapping for the response, you need not add the prefixes, as the XML is semantically identical.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
I am partially able to add prefix to the XML.
Here what I did for Module Configuration:
1. Added Module AF_Modules/XMLAnonymizerBean after std module in Soap Receiver Adapter
2. Parameter Name: anonymizer.acceptNamespaces
Parameter Value : http://xyz/mdm ns0
Below is the reponse xml with namespace prefix only in the root tag, no prefix for child tags.
<?xml version='1.0' encoding='utf-8'?>
<ns0:getUpdateListResp xmlns:ns0='http://xyz/mdm'>
<item>46246</item>
<item>46247</item>
<item>46248</item>
</ns0:getUpdateListResp>
How do I get the namespace prefix to all the tags in the XML?
Thanks,
Laxman
In your original payload you have a tag:
<item xmlns="">46000<item>
This means that this item has no namespace. the xmlns="" attributes removes namespace from parent node.
when you add a prefix like this:
<ns0:item xmlns="">46000</ns0:item>
it does not really make sense.
When your ECC proxy is created from same WSDL, then it should work with the XML response structure.
If not, you should add a mapping.
Hi Stefan,
Yes, I have created all the Interface objects with the WSDL only.
I tried again its the same issue.
I have tested the mapping program from ESR Mapping test Tab, when I copy the xml (webservice Response) into Test tab and run then its simply ignoring all the xml tags where it has xmlns=''. And I tried taking this attribute from the xml then mapping program reads every tag and maps to the target structure.
Please let me know if I am still missing anything.
Thanks,
Laxman
Make sure you have given the namespace declaration in 'XML Namespace' tab in your response MT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.