简体   繁体   中英

how to parse incoming XML file in HTTP request and generate s response based on incoming XML data in Tibco BW

I am new to TIBCO BW development. I need your expert opinion, as I am stuck to create a response XML file. Here is the scenario.

I get a XML file in the HTTP request and after parsing the incoming request XML structure, I have to create a response document which will act as a stub to the incoming request.

First I create a HTTP Receiver which will act as receiving the XML file in the HTTP request. Then I used Parse XML to parse the incoming XML document is correct or wrong. After this activity I am stuck, since I create the Render XML activity after this but it does not fetch the data even after I map the incoming request parsed by Parse XML activity, I can see during Testing time that it is getting the whole XML in the Input but even after mapping the output with input from Parsing, I get NULL values, hence facing errors.

Please let me know where I am doing wrong, or should I use any other method to catch the incoming values, such that I can create a proper response XML document to be used as Response.

Once you received the HTTP request, parsed the HTTP Post Data using the "Parse XML" activity, I really advice you to use a "Mapper" to map your input (received and parsed as an XML) to a XML output schema. This output can easily be returned after.

For example,

My HTTP client send me an XML like this 在此处输入图片说明

And I want to return an XML like this with the addition of a and b 在此处输入图片说明

The process : 处理

And the mapper

在此处输入图片说明

And the end, you can send the XML HTTP response like this :

在此处输入图片说明


EDIT (comment) : To edit the prefix namespaces in a process. You must click on the process (left hand menu) and on the bottom side, there is a button "Namespace Registry" 在此处输入图片说明 if you click on it you'll be able to change the prefix name. 在此处输入图片说明

But bear in mind, this kind of manipulation can break the existing mapping in the process because everything is XML based in Tibco BW.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM