REST - JSON to XML response conversion error in Service Connect

Hi,

We’ve been using REST functions in Service Connect workflows but the BAQ Execution keeps failing. The goal is to get data using BAQs and then process it further.

The REST calls in the flow are as follows:

  • DynamicQuery, GetByID
  • DynamicQuery, GetExecutionParametersByID
  • DynamicQuery, Execute

The two first methods go through fine but the execute keeps failing. It throws an error message saying:
- One or more errors occurred.
- JSON to XML response conversion has failed.
- Object reference not set to an instance of an object.

Here’s a screenshot of the activity progress.

Has anyone ever come across the same thing?

Thanks in advance!

Hello Antti,

I’m not a Service Connect person but the way I consume BAQ data is using the BaqSvc where you just pass the name of the BAQ and parameters in a single REST call. For example:

https://(your service address)/api/v1/BaqSvc/BAQName?Parm1=2014&Parm2=1&Parm3=1

You should be able to build the URL in SC, make the call, then process the JSON results.

Mark W.

P.S. Test your URLs in Postman (or even a web browser) first to make sure that is working then move into SC.

Hi Mark,

Thanks for your reply. The reason why we went with the Dynamic Query is when importing REST references the BAQSvc isn’t in the lists. We’ll give this a try and see if we can get it working.

SC%20Import%20REST%20Ref

That is correct. REST doesn’t import any references. It is all https. When you’re importing references, you’re using WCF Web Services. REST is a completely different animal - much lighter and loosely coupled.

Like I said, I’m not an SC person but if SC has a way to make an http request and work with the results then you can use REST. If you use the BAQ Web Services, then we need a more knowledgeable person to jump in here.

:wink:

Mark W.

Hi Mark,

When testing this through a browser it works nicely and returns the data correctly. …/api/v1/BaqSvc/[BAQName]

We gave this a try in SC and it responds ‘200 - OK’ but returns nothing. If we run …/api/v1/BaqSvc/ in SC it returns the list of BAQs just like in the browser. Any SC gurus out there?

Just checking if you ever got a resolution to this?