1. Sverre Tvedt
  2. PowerBuilder
  3. Monday, 25 March 2019 09:57 AM UTC

We are using 2017 R3.

For some time now we have been consuming .NET Soap web services from one of our business partners. They now require us to migrate to a new web service technology, called RPC/JSON. This is outside negotiation.

I should like to have some advice on how to do this in the simplest way. With Soap, everything is generated in minutes and the serialization/des. is wholly automatic and all one has to think about is the content of the interface objects. These interface classes are pretty complex and deeply nested and so far they never fail unless the wsdl is ill-formed. We have a number of partners offering Soap web services.

The current plan is to use the httpclient object, and re-use all the interface classes from the Soap version. Next I think that I have to serialize/deserialize JSON back and forth between these and the httpclient object.

Is there a better overall strategy? If not,do I have to add serialization/des. methods to all interface classes, using the JSONGenerator/JSONParser objects or is there a simpler way?  Any new features to expect in the next version of PB?

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 25 March 2019 17:16 PM UTC
  2. PowerBuilder
  3. # 1
Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 26 March 2019 07:58 AM UTC
  1. Helpful
  1. Sverre Tvedt
  2. Tuesday, 26 March 2019 09:46 AM UTC
Armeen: Good idea. But then I'm left with the problem of serializing/deserializing XML in place of JSON, which is automatic in native PB Soap client projects.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Tuesday, 26 March 2019 22:05 PM UTC
Yes you are right, you do have to do some extra work compared to the SOAP client. On the plus side, the HTTP Client is much more secure than the SOAP Client as it supports TLS 1.2 and TLS 1.3 coming soon.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Monday, 25 March 2019 11:19 AM UTC
  2. PowerBuilder
  3. # 2

If they are using JSON most likely it is a REST/JSON Web API.  PB 2017 R3 has a ton of new features in these regards.

I would recommend to go through Bruce Armstrong's REST bootcamp, which will just take 1 hour of your time: https://www.appeon.com/developers/library/videos/rest-bootcamp.html

Comment
  1. Kevin Ridley
  2. Monday, 25 March 2019 12:36 PM UTC
It's really not as bad as you think. Often you can create a dw that matches the JSON and just do dw.ImportJson. If the JSON is too complex, you can use the JSONParser and JSONPackage objects, or even a combination of those where you extract a json object(s) from a complex JSON string and import that into a dw or multiple dws. If you need help, check back here or look into outsourcing that portion. The good thing about that is it's similar to SOAP in that once you get it working, you should be fine unless they change to service.
  1. Helpful
  1. Sverre Tvedt
  2. Tuesday, 26 March 2019 07:50 AM UTC
Kevin, thank you. I appreciate all ideas. I've started looking into these methods and they look to me slightly higgledy-piggledy. The interface objects, particularly on the receiving side are hugely complex with deeply nested structures including arrays og objects within arrays of objects, large blobs and what not. It wont be easy for this purpose.

On the serialization side it looks more effective to make my own serialize-method for each interface object, with nested calls to similar methods in sub-objects (or arrays of sub objects) without using the generator object at all. On the return side the JSONparser object will provide some help in a similar fashion of nested method calls.

  1. Helpful
  1. Kevin Ridley
  2. Tuesday, 26 March 2019 15:08 PM UTC
Sverre,

I'm putting together a presentation for DropBox API that uses their RPC endpoint. I'm planning to coordinate with Armeen about maybe doing a webcast for that, but either way I will post it on CodeXchange when I'm done. I will look for this post and add a link here when it's uploaded. Feel free to shoot me a message on LinkedIN if you need any outside assistance.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.