Discussion:
How to use Axis2C (REST) as 'gateway' to an existing app
Christian Wiese
2013-06-08 10:20:10 UTC
Permalink
Hello all,



IŽm completely new to Axis2c so I have an absolute beginner questions, but I
havenŽt found an answer yet so maybe you could point me to the right
direction.



I currently have a more or less finished application on an embedded
linux-PC. This application gather different information and data from a lot
of places. Now I would like to use a REST-API to get and set some of this
data. Firstly I hopped I could easily integrate axis2c into my application
(as a REST-server) but I realized that it offered a standalone server with
services I can implement.



So to my question:

Is there a concept or idea how I can use the axis2c server and use it as
some sort of gateway/REST-server for my existing application? Should I write
an axis2c-service that routes the incoming calls to my existing program
like:

External call <-REST-> axis2c-service <-UDP-> existing tool

Or maybe implement an axis2c-client into my existing application which also
connect to the axis2c-server?



Am I right that it is not possible to implement an axis2c-service into my
running application? It would be some sort of library which is linked at
runtime into my program.



Thanks in advance

Chris
GIACAMOND
2013-06-09 12:10:40 UTC
Permalink
Hi Christian,



I’m currently working on an integration project which involve an old legacy
TXSeries / Cobol environment on AIX, and REST-API to invoke Web Service. I
used AXIS2C 1.7 Client API, build with libxml2 2.9. I had to apply a small
fix in the http_sender.c module (see JIRA AXIS2C-1626), to make-it work. I
have also implement XPATH search query from the client side.



You just can use a stub module from your existing application, that will be
link with dynamic libraries, or integrate directly the native AXIS2C client
API.



You should consider generating / building both AXIS2C and LIBXML2 from your
own installation. It make it much more flexible when it’s time to build.



Have fun,



Jean-Marc



De : Christian Wiese [mailto:wiese666-gM/Ye1E23mwN+***@public.gmane.org]
Envoyé : samedi 8 juin 2013 12:20
À : c-user-r8yd/***@public.gmane.org
Objet : [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello all,



IŽm completely new to Axis2c so I have an absolute beginner questions, but I
havenŽt found an answer yet so maybe you could point me to the right
direction.



I currently have a more or less finished application on an embedded
linux-PC. This application gather different information and data from a lot
of places. Now I would like to use a REST-API to get and set some of this
data. Firstly I hopped I could easily integrate axis2c into my application
(as a REST-server) but I realized that it offered a standalone server with
services I can implement.



So to my question:

Is there a concept or idea how I can use the axis2c server and use it as
some sort of gateway/REST-server for my existing application? Should I write
an axis2c-service that routes the incoming calls to my existing program
like:

External call <-REST-> axis2c-service <-UDP-> existing tool

Or maybe implement an axis2c-client into my existing application which also
connect to the axis2c-server?



Am I right that it is not possible to implement an axis2c-service into my
running application? It would be some sort of library which is linked at
runtime into my program.



Thanks in advance

Chris
Christian Wiese
2013-06-09 18:12:09 UTC
Permalink
Hello Jean-Marc,



thank you for your answer and hints.



But IŽm sorry, I donŽt get it L



Maybe I have a problem with the wording here. I understand ‘client’ as one
option to trigger a ‘service’. For example a webbrowser is a client. The
axis2c-client-API allows me to use the same service from my c-application.



So if I want to access the data gathered by my old program from within a
webbrowser I need to write a such an axis-client into my app. And these
‘client’ also connects to the service and gets all requests from the browser
forwarded?

i.e. browser <- -> axis-service <- -> axis-client (my app)



And a short second question J

I already implemented a first (dumb) service which react on a REST call
(URL). It returns the data in xml. Is it possible to return the values in a
simple string like: {val1=x;val2=y}



Kind regards

Chris



Von: GIACAMOND [mailto:jean-marc-K0RkNnOJTdz2eFz/***@public.gmane.org]
Gesendet: Sonntag, 9. Juni 2013 14:11
An: 'Apache AXIS C User List'
Betreff: RE: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hi Christian,



I’m currently working on an integration project which involve an old legacy
TXSeries / Cobol environment on AIX, and REST-API to invoke Web Service. I
used AXIS2C 1.7 Client API, build with libxml2 2.9. I had to apply a small
fix in the http_sender.c module (see JIRA AXIS2C-1626), to make-it work. I
have also implement XPATH search query from the client side.



You just can use a stub module from your existing application, that will be
link with dynamic libraries, or integrate directly the native AXIS2C client
API.



You should consider generating / building both AXIS2C and LIBXML2 from your
own installation. It make it much more flexible when it’s time to build.



Have fun,



Jean-Marc





De : Christian Wiese [mailto:wiese666-gM/Ye1E23mwN+***@public.gmane.org]
Envoyé : samedi 8 juin 2013 12:20
À : c-***@axis. <mailto:c-user-r8yd/***@public.gmane.org> apache.org
Objet : [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello all,



IŽm completely new to Axis2c so I have an absolute beginner questions, but I
havenŽt found an answer yet so maybe you could point me to the right
direction.



I currently have a more or less finished application on an embedded
linux-PC. This application gather different information and data from a lot
of places. Now I would like to use a REST-API to get and set some of this
data. Firstly I hopped I could easily integrate axis2c into my application
(as a REST-server) but I realized that it offered a standalone server with
services I can implement.



So to my question:

Is there a concept or idea how I can use the axis2c server and use it as
some sort of gateway/REST-server for my existing application? Should I write
an axis2c-service that routes the incoming calls to my existing program
like:

External call <-REST-> axis2c-service <-UDP-> existing tool

Or maybe implement an axis2c-client into my existing application which also
connect to the axis2c-server?



Am I right that it is not possible to implement an axis2c-service into my
running application? It would be some sort of library which is linked at
runtime into my program.



Thanks in advance

Chris
GIACAMOND
2013-06-11 12:11:47 UTC
Permalink
Hello Christian,



I believe I understand what you are trying to do!



Correct me if I’m wrong. What you are trying to do is to EXPOSE your
existing legacy as a Web Service, and not the opposite (legacy accessing Web
Service). This the opposite of what I have done (I create a Stub that is
use by my legacies to access Web Service).



This is also possible since AXIS2C let you write Server and or Client code.



So the correct statement should be:-

“So if I want to access the data gathered by my old program from within a
webbrowser I need to write a such AXIS2C-SERVER that will implement my app
(build as a share object)”.



i.e. browser <- -> axis-service <- -> my app.



“I already implemented a first (dumb) service which react on a REST call
(URL). It returns the data in xml. Is it possible to return the values in a
simple string like: {val1=x;val2=y}”



AXIS2C is the “C/C++” implementation of the Java AXIS. This is built for
Web Service (soap), and REST, which are XML driven. So if this is not what
you really need, maybe you should consider other tools, Like CGI script !



Kinds regards,



Jean-Marc





De : Christian Wiese [mailto:wiese666-gM/Ye1E23mwN+***@public.gmane.org]
Envoyé : dimanche 9 juin 2013 20:12
À : 'Apache AXIS C User List'
Objet : AW: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello Jean-Marc,



thank you for your answer and hints.



But IŽm sorry, I donŽt get it L



Maybe I have a problem with the wording here. I understand ‘client’ as one
option to trigger a ‘service’. For example a webbrowser is a client. The
axis2c-client-API allows me to use the same service from my c-application.



So if I want to access the data gathered by my old program from within a
webbrowser I need to write a such an axis-client into my app. And these
‘client’ also connects to the service and gets all requests from the browser
forwarded?

i.e. browser <- -> axis-service <- -> axis-client (my app)



And a short second question J

I already implemented a first (dumb) service which react on a REST call
(URL). It returns the data in xml. Is it possible to return the values in a
simple string like: {val1=x;val2=y}



Kind regards

Chris



Von: GIACAMOND [mailto:jean-marc-K0RkNnOJTdz2eFz/***@public.gmane.org]
Gesendet: Sonntag, 9. Juni 2013 14:11
An: 'Apache AXIS C User List'
Betreff: RE: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hi Christian,



I’m currently working on an integration project which involve an old legacy
TXSeries / Cobol environment on AIX, and REST-API to invoke Web Service. I
used AXIS2C 1.7 Client API, build with libxml2 2.9. I had to apply a small
fix in the http_sender.c module (see JIRA AXIS2C-1626), to make-it work. I
have also implement XPATH search query from the client side.



You just can use a stub module from your existing application, that will be
link with dynamic libraries, or integrate directly the native AXIS2C client
API.



You should consider generating / building both AXIS2C and LIBXML2 from your
own installation. It make it much more flexible when it’s time to build.



Have fun,



Jean-Marc





De : Christian Wiese [mailto:wiese666-gM/Ye1E23mwN+***@public.gmane.org]
Envoyé : samedi 8 juin 2013 12:20
À : c-***@axis. <mailto:c-user-r8yd/***@public.gmane.org> apache.org
Objet : [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello all,



IŽm completely new to Axis2c so I have an absolute beginner questions, but I
havenŽt found an answer yet so maybe you could point me to the right
direction.



I currently have a more or less finished application on an embedded
linux-PC. This application gather different information and data from a lot
of places. Now I would like to use a REST-API to get and set some of this
data. Firstly I hopped I could easily integrate axis2c into my application
(as a REST-server) but I realized that it offered a standalone server with
services I can implement.



So to my question:

Is there a concept or idea how I can use the axis2c server and use it as
some sort of gateway/REST-server for my existing application? Should I write
an axis2c-service that routes the incoming calls to my existing program
like:

External call <-REST-> axis2c-service <-UDP-> existing tool

Or maybe implement an axis2c-client into my existing application which also
connect to the axis2c-server?



Am I right that it is not possible to implement an axis2c-service into my
running application? It would be some sort of library which is linked at
runtime into my program.



Thanks in advance

Chris
Christian Wiese
2013-06-11 14:16:26 UTC
Permalink
Hello Jean-Marc,



you are absolute right. My wording was not good.



Can you give me a hint how to write a SERVER implementation for/into my
legacy-code. I do not want an axis-service as I can not embed my code into a
service-library. My first idea was to right an axis-service and connect it
with UDP (or pipes) to my old program. I hopped there is a better, native
method I donŽt now already.



Regarding the output format. The ‘{..}’-format should be JSON and is a
possible return for REST-calls. I found this fork:

https://code.google.com/p/axis2c-unofficial/

which implements JSON for axis2c. But I donŽt know why this is a fork…



Kind regards

Chris



Von: GIACAMOND [mailto:jean-marc-K0RkNnOJTdz2eFz/***@public.gmane.org]
Gesendet: Dienstag, 11. Juni 2013 14:12
An: 'Apache AXIS C User List'
Betreff: RE: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello Christian,



I believe I understand what you are trying to do!



Correct me if I’m wrong. What you are trying to do is to EXPOSE your
existing legacy as a Web Service, and not the opposite (legacy accessing Web
Service). This the opposite of what I have done (I create a Stub that is
use by my legacies to access Web Service).



This is also possible since AXIS2C let you write Server and or Client code.



So the correct statement should be:-

“So if I want to access the data gathered by my old program from within a
webbrowser I need to write a such AXIS2C-SERVER that will implement my app
(build as a share object)”.



i.e. browser <- -> axis-service <- -> my app.



“I already implemented a first (dumb) service which react on a REST call
(URL). It returns the data in xml. Is it possible to return the values in a
simple string like: {val1=x;val2=y}”



AXIS2C is the “C/C++” implementation of the Java AXIS. This is built for
Web Service (soap), and REST, which are XML driven. So if this is not what
you really need, maybe you should consider other tools, Like CGI script !



Kinds regards,



Jean-Marc



[…]
Stadelmann Josef
2013-06-12 09:06:24 UTC
Permalink
Hello Christian,



after reading this topic, I guess we are coming closer than ever.

We have some 120'000 Pascal Lines of Code on OpenVMS connected with a Oracle DB, a typical legacy situation

We run a web Axis2 web service (.aar) on Tomcat Java 1.6 on OpenVMS

The legacy code is connected via a ICCC Inter-Communication-Cluster-Channel,

implemented by a product from HP WSIT, generated java beans on the java side and C wrappers to your

applications API on the legacy server part.



Client side uses

VB.Net

C#.Net

WCF 4.0 .NET 4.0,

Stubs generated from WSDL using

Visual Studio 2010 add service reference menu and others (hand made)





SO - In order to integrate your legacy service it needs some sort of way to communicate two way with your legacy process or

have your legacy code become a library to be called by the service implementing code, this making your legacy functionality

available to your service providing code.



you write:

I do not want an axis-service as I cannot embed my code into a service-library.



question: what is your IDE build system; Visual Studio, NetBeans, Eclipse, any others

question: for which platform is your code developed

question: on which platform does your application run?

question: in which language is your legacy code written?

question: in which language to do prefer to develop your web service client?

question: in which language to do prefer to develop your web service server service?

question: do you think you can use a application server like tomcat or jboss or glassfish, if not why?

question: do you think you can use a different web service stack than Axis2/J or AXIS2/C maybe CXF, or Metro, .. ?

question: what kind of interface to access your applications functionality is today provided? a) GUI, b) Command Line, c9 API, d) PIPE, e) sockets f) others

question: do you want to connect may services from you client or from your server (service)

question: will your service behave like an agent,

that is to say -

an agent is a server and provides to your client a service but

to do so it becomes itself a client toward one to several servers consuming services from them



in general: can you outline a bit about your

a) requirements

b) logical functionality

c) architecture and constraints

d) highe level designe

e) preferred technique to implement

a. client

b. server

c. service

d.





Josef



Von: Christian Wiese [mailto:wiese666-gM/Ye1E23mwN+***@public.gmane.org]
Gesendet: Dienstag, 11. Juni 2013 16:16
An: 'Apache AXIS C User List'
Betreff: AW: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello Jean-Marc,



you are absolute right. My wording was not good.



Can you give me a hint how to write a SERVER implementation for/into my legacy-code. I do not want an axis-service as I can not embed my code into a service-library. My first idea was to right an axis-service and connect it with UDP (or pipes) to my old program. I hopped there is a better, native method I donŽt now already.



Regarding the output format. The '{..}'-format should be JSON and is a possible return for REST-calls. I found this fork:

https://code.google.com/p/axis2c-unofficial/

which implements JSON for axis2c. But I donŽt know why this is a fork...



Kind regards

Chris



Von: GIACAMOND [mailto:jean-marc-K0RkNnOJTdz2eFz/***@public.gmane.org]
Gesendet: Dienstag, 11. Juni 2013 14:12
An: 'Apache AXIS C User List'
Betreff: RE: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app



Hello Christian,



I believe I understand what you are trying to do!



Correct me if I'm wrong. What you are trying to do is to EXPOSE your existing legacy as a Web Service, and not the opposite (legacy accessing Web Service). This the opposite of what I have done (I create a Stub that is use by my legacies to access Web Service).



This is also possible since AXIS2C let you write Server and or Client code.



So the correct statement should be:-

"So if I want to access the data gathered by my old program from within a webbrowser I need to write a such AXIS2C-SERVER that will implement my app (build as a share object)".



i.e. browser <- -> axis-service <- -> my app.



"I already implemented a first (dumb) service which react on a REST call (URL). It returns the data in xml. Is it possible to return the values in a simple string like: {val1=x;val2=y}"



AXIS2C is the "C/C++" implementation of the Java AXIS. This is built for Web Service (soap), and REST, which are XML driven. So if this is not what you really need, maybe you should consider other tools, Like CGI script !



Kinds regards,



Jean-Marc



[...]
A***@public.gmane.org
2013-06-13 07:16:57 UTC
Permalink
Hello Christian

Just a stupid idea from another newbie:

You said originally, that you need to get and set some of the data or your application.

Dou you actually need to call the code of the application or could you just access it's data - i.e. get it directly out of the database? It might be easier to write a program, that does just the database access... - and it would open you the possiblity to use whatever technology is easiest to do that.

Andreas

________________________________
Von: Stadelmann Josef [mailto:josef.stadelmann-NaYkPCxpYJysDDwXjlF+***@public.gmane.org]
Gesendet: Mittwoch, 12. Juni 2013 11:06
An: Apache AXIS C User List
Betreff: AW: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app

Hello Christian,

after reading this topic, I guess we are coming closer than ever.
We have some 120'000 Pascal Lines of Code on OpenVMS connected with a Oracle DB, a typical legacy situation
We run a web Axis2 web service (.aar) on Tomcat Java 1.6 on OpenVMS
The legacy code is connected via a ICCC Inter-Communication-Cluster-Channel,
implemented by a product from HP WSIT, generated java beans on the java side and C wrappers to your
applications API on the legacy server part.

Client side uses
VB.Net
C#.Net
WCF 4.0 .NET 4.0,
Stubs generated from WSDL using
Visual Studio 2010 add service reference menu and others (hand made)


SO - In order to integrate your legacy service it needs some sort of way to communicate two way with your legacy process or
have your legacy code become a library to be called by the service implementing code, this making your legacy functionality
available to your service providing code.

you write:
I do not want an axis-service as I cannot embed my code into a service-library.

question: what is your IDE build system; Visual Studio, NetBeans, Eclipse, any others
question: for which platform is your code developed
question: on which platform does your application run?
question: in which language is your legacy code written?
question: in which language to do prefer to develop your web service client?
question: in which language to do prefer to develop your web service server service?
question: do you think you can use a application server like tomcat or jboss or glassfish, if not why?
question: do you think you can use a different web service stack than Axis2/J or AXIS2/C maybe CXF, or Metro, .. ?
question: what kind of interface to access your applications functionality is today provided? a) GUI, b) Command Line, c9 API, d) PIPE, e) sockets f) others
question: do you want to connect may services from you client or from your server (service)
question: will your service behave like an agent,
that is to say -
an agent is a server and provides to your client a service but
to do so it becomes itself a client toward one to several servers consuming services from them

in general: can you outline a bit about your

a) requirements

b) logical functionality

c) architecture and constraints

d) highe level designe

e) preferred technique to implement

a. client

b. server

c. service

d.


Josef

Von: Christian Wiese [mailto:wiese666-gM/Ye1E23mwN+***@public.gmane.org]
Gesendet: Dienstag, 11. Juni 2013 16:16
An: 'Apache AXIS C User List'
Betreff: AW: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app

Hello Jean-Marc,

you are absolute right. My wording was not good.

Can you give me a hint how to write a SERVER implementation for/into my legacy-code. I do not want an axis-service as I can not embed my code into a service-library. My first idea was to right an axis-service and connect it with UDP (or pipes) to my old program. I hopped there is a better, native method I donŽt now already.

Regarding the output format. The '{..}'-format should be JSON and is a possible return for REST-calls. I found this fork:
https://code.google.com/p/axis2c-unofficial/
which implements JSON for axis2c. But I donŽt know why this is a fork...

Kind regards
Chris

Von: GIACAMOND [mailto:jean-marc-K0RkNnOJTdz2eFz/***@public.gmane.org]
Gesendet: Dienstag, 11. Juni 2013 14:12
An: 'Apache AXIS C User List'
Betreff: RE: [Bulk] How to use Axis2C (REST) as 'gateway' to an existing app

Hello Christian,

I believe I understand what you are trying to do!

Correct me if I'm wrong. What you are trying to do is to EXPOSE your existing legacy as a Web Service, and not the opposite (legacy accessing Web Service). This the opposite of what I have done (I create a Stub that is use by my legacies to access Web Service).

This is also possible since AXIS2C let you write Server and or Client code.

So the correct statement should be:-
"So if I want to access the data gathered by my old program from within a webbrowser I need to write a such AXIS2C-SERVER that will implement my app (build as a share object)".

i.e. browser <- -> axis-service <- -> my app.

"I already implemented a first (dumb) service which react on a REST call (URL). It returns the data in xml. Is it possible to return the values in a simple string like: {val1=x;val2=y}"

AXIS2C is the "C/C++" implementation of the Java AXIS. This is built for Web Service (soap), and REST, which are XML driven. So if this is not what you really need, maybe you should consider other tools, Like CGI script !

Kinds regards,

Jean-Marc

[...]

Loading...