HTTP Request's response can only be opaque dataset?

Post Reply
web3dprint
Newbie
Posts: 8
Joined: Fri Feb 26, 2016 5:04 pm

HTTP Request's response can only be opaque dataset?

Post by web3dprint »

We would like to launch an HTTP Request asking an external web server information about a job, which returns XML data. To avoid more steps of XML pickups, we would like to embed the dataset directly in the job, but it is embedded as an opaque dataset, which is not querable. We tried to set the Content-Type on the response and the response (the web server is managed by us) but it always saves as opaque. Is it not possible to change the dataset type for the HTTP Response?
DustinYoder
Newbie
Posts: 5
Joined: Mon Jul 24, 2017 6:17 pm

Re: HTTP Request's response can only be opaque dataset?

Post by DustinYoder »

I also have the exact same issue. Don't see 'attach as dataset' in almost any documentation or in google searches. Is this actually being used by anyone? I try returning xml and json from my server with different Content-type headers, but cannot get anything except 'opaque' dataset. Someone please make an example of what needs to be passed in to Http Request action by the server that is being contacted. I really can't find almost any uses of the phrase 'attach as dataset' in the docs or on google when I add 'enfocus switch' to the search. Is there a dev portal or something with more technical information about how this should work? Thanks.
DustinYoder
Newbie
Posts: 5
Joined: Mon Jul 24, 2017 6:17 pm

Re: HTTP Request's response can only be opaque dataset?

Post by DustinYoder »

From my experimenting, I am determining that the response from http request action can be 'attached as dataset' but yes, that seems to be an opaque dataset.
So in my test I select 'attach as dataset' then give that dataset a name 'ResponseData'. To convert that to a JSON or XML dataset I put a JSON pickup as the next step. Then I select 'Metadata is opaque dataset' from the pickup method property and enter the opaque dataset name 'ResponseData' (I entered that in the http request action) I choose JSON as my pickup result since I wanted JSON dataset result rather than XML.
So I think if you want real usable data you have to do a pickup, but you can at least attach as dataset in the http request and then pickup from that attached dataset rather than having to write the response as a file and then pickup that file. I think this is a little cleaner doing it the described way.
Hope that helps someone because this really was confusing and not much documentation about this.

Maybe they should rename 'attach as dataset' to 'attach as opaque dataset' Or if you have the metadata module, just let you select to do a pickup right in the http request action and choose a format.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: HTTP Request's response can only be opaque dataset?

Post by Padawan »

If you run the latest version of Switch, then you can update the HTTP Request tool via the Switch Appstore. You'll get a completely rewritten app in Nodejs, one of the new features is just what you are looking for:
New Property for Response and Input job dataset model
This property subordinate property of Response if it is set to Attach as dataset; it allows you to define the dataset model of the response.

Options are:
Automatic (default). In this case, the dataset model is determined by the Content-type key in the header, for example, if the Content-type key is application/json, the dataset model will be JSON, if the Content-type key is application/vnd.cip4-jdf+xml or application/vnd.cip4-jmf +xml, the dataset model will be JDF.
Opaque
JSON
XML
JDF
Post Reply