1

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.

Sanjib Behera
  • 101
  • 1
  • 13
  • Would you mind upload your BW project? I would assume there's a difference in what you defined as input structure of the Render XML activity and output of the Parse XML activity or the mapping between both of them – Seb Jul 30 '16 at 03:18

1 Answers1

1

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 enter image description here

And I want to return an XML like this with the addition of a and b enter image description here

The process : Process

And the mapper

enter image description here

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

enter image description here


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" enter image description here if you click on it you'll be able to change the prefix name. enter image description here

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

Greg Jeanmart
  • 666
  • 1
  • 5
  • 13
  • Thank you so much @gjeanmart for the detailed description of how to solve the issue using HTTP Pallete. as I was bit in a hurry, I transferred my code to use SOAP Pallete to receive the request and send response by SoapSendReply. everything is fine except the namespace, do you know how to replace the SOAP-ENV prefix to soapenv prefix and also the namespace prefix from ns0:username to username. – Sanjib Behera Jul 31 '16 at 21:19
  • 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 broke the existing mapping in the process because everything is XML based in Tibco BW. [I edited the answer with more details] – Greg Jeanmart Jul 31 '16 at 21:58
  • Hello @gjeanmart, thank you for the response. I am now stuck at last resort where the content-type of soapsendreply. here I have changed the mime contenttype to text/xml but the application which receives the response it always says that it receives as text/html, but in soapUI, I get the correct response as text/xml. here is the snapshot of the same:- "HTTP/1.1 200 OK[\r][\n]" "Server: Apache-Coyote/1.1[\r][\n]" "Content-Type: multipart/related; type="text/xml"; but in the applications logs, I find:- – Sanjib Behera Aug 01 '16 at 15:43
  • Hello @gjeanmart, thank you. I am now stuck at the content-type soapsendreply. Here I have changed the mime contenttype to text/xml but the application throw error, in soapUI,I get the correct response as text/xml. snapshot:- "HTTP/1.1 200 OK" "Server: Apache-Coyote/1.1" "Content-Type: multipart/related; type="text/xml"; but in the app logs, I find:- org.apache.cxf.interceptor.Fault: Response was of unexpected text/html ContentType. Incoming portion of HTML stream: java.lang.IllegalArgumentException: Cannot set a null value any leads to resolve the same. – Sanjib Behera Aug 01 '16 at 15:52