Multiple clients with different encoding/contenttype

One of the flow services is having the below steps:

  1. pub:xml:documentToXmlString → Set encode = true
  2. pub:flow:setResponse → content_type “text.xml”

Returns the string that is prepared in step 2.

From the client perspective, this works if HTTPClient is used.
But some of our services are using java API to call this flowservice. when this flow service is called from Java, I am receiving Null.
If I change encode = false and not set content_type, then from java I am able to receive. But I can’t change the code since some consumers are using
HTTPClient. So what is the best approach to this scenario. I don’t want to duplicate the code and change these params just for another client.

encode=true has nothing to do with the issue. You should leave that as true.

For content-type, the correct value is text/xml, not text.xml. But perhaps that was a typo in your post?

For clients using the IS Java API the service will need to return the XML string as an output parameter of the service.

Thanks for the response. yes, that’s typo. I do return xml string as reponse.

I use below steps to prepare my output response:

  1. pub:xml:documentToXmlString → Set encode = true
  2. pub:flow:setResponse → content_type “text.xml”

Result of step 1 is used to set the “response” variable in Step 2. But java call is not able to see the output where as HTTPClient can…

Yes, you’re returning it as a response to an HTTP client, not to a Java API client. The setResponse is for HTTP/FTP clients only.

Declare an output variable on your service. Make sure it is populated on exit. The Java API caller will see it.