bc-soap 4.1 consume - mode JSON

classic Classic list List threaded Threaded
9 messages Options
yla
Reply | Threaded
Open this post in threaded view
|

bc-soap 4.1 consume - mode JSON

yla
Hi,

I would like to expose an internal JBI service endpoint through a JSON format.

In the document, I see you need to change the mode to JSON in jbi.xml

I tried to do it

<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi xmlns:cdk5="http://petals.ow2.org/components/extensions/version-5" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:sql="http://petals.ow2.org/components/sql/version-1" version="1.0">
  <jbi:services binding-component="true">
    <jbi:consumes endpoint-name="GetDataServicesEndPoint" interface-name="sql:SqlInterface" service-name="sql:GetDataServices">
      <cdk5:timeout>30000</cdk5:timeout>
      <cdk5:operation>sql:select</cdk5:operation>
      <cdk5:mep>InOut</cdk5:mep>
      <soap:service-name>GetDataServices</soap:service-name>
      <soap:mode>JSON</soap:mode>
     
    </jbi:consumes>
  </jbi:services>
</jbi:jbi>

with or without commenting the lines
 <soap:enable-http-transport>true</soap:enable-http-transport>
 <soap:enable-jms-transport>false</soap:enable-jms-transport>

But when i set the mode to JSON,
I have this error
Description Resource Path Location Type
Invalid jbi.xml: the file could not be loaded and is probably a mal-formed XML document. jbi.xml /su-JSON-GetDataServices-consume/src/main/jbi line 1 Petals markers

and I cannot create the service assembly.

Has someone tried this configuration and can help me ?

Regards
Yves
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

Vincent Zurczak
This post was updated on .
Hi,

I don't know the version of Petals you are using, but there is no JSON mode in the SOAP connector. What document are you referring to?

The best approach would be develop your own binding component for this use case.
« Petals M.D. »
yla
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

yla
Hi Vincent,

I am using petals 4.0.

I found the reference to JSON mode in this documentation http://doc.petalslink.com/display/petalscomponents/Petals-BC-SOAP+4.1.x

So to sum it up, I need to develop my own binding component to expose an internal jbi service endpoint through JSON format ?

Regards

Yves
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

Vincent Zurczak
Hi,

You are right. This is a feature upgrade from the last version.
I had not heard about it. And this is probably why the studio does not know the JSON value.

You should ignore the warnings put by the studio. Package it as usual and deploy it in Petals.
Since the "mode" is an enumeration, and that JSON is not known by the studio, it indicates it is not valid. I will post a bug entry about this.
« Petals M.D. »
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

Christophe DENEUX
Administrator
Vincent,

IMO, a JSON support was existing in version 4.0.x (running on Petals 3.x) of the BC SOAP. It seems to me that it was removed from the version 4.1+, but the documentation was not updated. You are right, a dedicated binding-component would be needed.
Christophe DENEUX
Petals ESB Architect
Linagora
Twitter: @ChrisDENEUX
yla
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

yla
This post has NOT been accepted by the mailing list yet.
Hi Christophe, Vincent,

so the solution is to develop a dedicated binding-component.

Is it possible to start from your previous sources ( in version 4.0.x ) to create one new JSON component ?

Regards

Yves
yla
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

yla
Hi Christophe, Vincent,

do you think my request will be possible or not ?

Regards

Yves
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

Vincent Zurczak
Hi,

Yes, you could fork a previous version.
But IMO, it would be more simple to develop your own binding component.

Besides, the SOAP connector is quite big.
You may prefer start from a lighter connector and replace its logic by your own mapping between JSON and XML. Here is a suggestion of a not-so-old connector.

Instead of listening to HL7 (which are HTTP) connections, start a Jetty server and convert the received requests in Petals messages. That will be more simple than starting from the SOAP connector which has a Jetty but also Axis2...
« Petals M.D. »
yla
Reply | Threaded
Open this post in threaded view
|

Re: bc-soap 4.1 consume - mode JSON

yla
Hi Vincent,

thanks for your informations and recommandations.

Regards

Yves