How do I create a Smart Object for JSON?


Badge +3

Hi, I believe K2 has some functionality to deal with JSON. I have an internal application written in C# and connect to an external application that returns JSON via a web call.

 

I would like to be able to call this service and make queries via K2 but I have no idea how I can do this. I have looked in the Smart Objects Services Tester but when I try to add an Endpoint WebService it fails for my URL with the popup error "Invalid WebService WSDL.

 

I have a URL string that is built up to query passing parameters which receives JSON however.

 

Can somebody please advise how I can do this? I'm fairly new to K2.

 

Thanks


5 replies

Userlevel 1
Badge +8

Unfortunately, there isn't a mechanism today out of the box for K2 to consume a web service that returns JSON as the response. There is a REST Web Service API in Beta that uses Swagger, but that hasn't been released yet. Maybe someone from K2 can comment on a time frame for that broker.

 

In the mean time, I did some poking around and found this JSON broker that might be able to help you. It is a community project so mileage may vary, but it is a starting point. http://community.k2.com/t5/K2-blackpearl/Json-Broker/ba-p/69694

 

Hope this helps.

 

S.

Badge +3

Thanks very much Scott, very helpful.

 

 I'll raise it with K2 support as well and will update this thread with the response.

Badge

Hi -

 

Is there a response yet?

We will be connecting to a third party application webservice using json.

 

Thanks!

Badge +6

I have the same problem in my project, and i I found this information 

http://community.k2.com/t5/K2-blackpearl/HTTP-Rest-Broker/ba-p/991

 

In this article is using HTTP REST Broker. I want to use during next days, trusting it help me with this problem.

 

Thank you

 

Juan Antonio

Badge +5

Hi, I recommend using the new K2 REST broker, just shipped with K2 4.7

 

Here is some info on using it. http://help.k2.com/onlinehelp/K2blackpearl/UserGuide/current/default.htm#ServiceBrokers/EndPoints/REST_Endpoint.htm 

 

It relies on having a Swagger descriptor defined which essentially tells the broker how to deal with JSON it receives. Many companies (including Microsoft) are taking this approach to workign with REST endpoints

 

There is a tool called RESTUnited whihc helps to create this swagger descriptor documentation . Its pretty easy to do. See this article for more info:

http://help.k2.com/kb001758

 

Hope this helps.

 

Dave

Reply