File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes SOA and ESB and the fly likes Integrating Web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » SOA and ESB
Bookmark "Integrating Web service" Watch "Integrating Web service" New topic
Author

Integrating Web service

ashi mu
Greenhorn

Joined: Oct 21, 2003
Posts: 5
Please pardon if I am posting it in the wrong arena. I am a newbie.

I have a web service A - its a wrapper to a mainframe service.
I have a web service B - that talks to sql server.
Now I need to invoke the web service A, invoke web service B, apply some data validation/filtering rules and be able to reuse this result. This service will be invoked from Web apps and mobile apps.
Should the above be a new web service C.

How should I proceed? Any advice/pointers appreciated.
Please provide details/steps as this is my first web service.
Thanks,
Ashi
Rajasekhar Pentakota
Ranch Hand

Joined: Aug 28, 2007
Posts: 38

I dont think you need to use third webservice necessarily. You can call Service A and Service B and combine/filter the results and return programmatically. But it depends on requirement on how the client and server are distributed in this context.

Thanks
Raja
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1382
Are you using ESD for Integrating WebServices ?
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

kri shan wrote:Are you using ESD for Integrating WebServices ?

Can you describe what is ESD? Did you mean ESB?
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1382
I referred ESB (Enterprise Service Bus) only.
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

ashi mu wrote:...and mobile apps.
...

Consider using RESTful services for mobile devices, it's more lightweight. You can convert SOAP envelope to JSON with ESB facilities, as kri shan mentioned.
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 98
In SOA terms, it is best practice to have another service which will "invoke" on other services.

The two services Service A and Service B are technically called as Business/Elementary services. The third service is called as Orchestration service.

If you are using any SOA/ESB product like Mulesoft ESB/TIBCO AMX Service Grid/Oracle SOA Suite, then all the services and their runtimes are managed by the container of the respective product. So, the communication (connections etc.) betwen the orchestration services and underlying business service is seemless. This is also called as "Service Virtualization".

Orchestration is one of the building block for any BPM implementation, because it is performing multiple sequential techinal operations on diferent systems (Mainframe and SQL server in your case) to realize some business funtionality.

Hope this helps


Regards, Sujeeth Pakala
SCJP, SCWCD, SCBCD, ICAD, XML Master Basic, Certified SOA Professional
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Sujeeth Pakala wrote:
Orchestration is one of the building block for any BPM implementation, because it is performing multiple sequential techinal operations on diferent systems (Mainframe and SQL server in your case) to realize some business funtionality.

Thanks, very informative.
Is it possible to have multiple orchestration services (distributed)? What can be practical use case for that?
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 98
Yes of course, it is legal to define multiple orchestration services having common business swervices.

Practical example is....

1. Orchestration service with Name "TransferAmount" -> This orchestrates on business services : "CheckBalance", "DebitAmount", "CreditAmount" may be other utility service for validation etc.
2. Orchestration service with Name "ActivateRecurringDeposit" -> This orchestrates on business services : "CreateDepositAccount", "DebitAmount", "CreditAmount", "ReportToCustomer"...

All these services are expected to run in a same container.
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1382
It may follow (not sure) WebService Broker design pattern, If you add orchestration service to invoke other services.
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Sujeeth Pakala wrote:Yes of course, it is legal to define multiple orchestration services having common business swervices.

Thanks Sujeeth, but I meant orchestration services which has parent-child relationship between each other, like:
"TransferAmount" -> This orchestrates on business services : "CheckBalance", "DebitAmount", "CreditAmount" may be other utility service for validation etc.
"PaySalary" -> This orchestrates on orchestration service "TransferAmount" and business service "ReportToCustomer".

Sujeeth Pakala wrote:All these services are expected to run in a same container.

Is it really requirement? By container I understand server with Axis2/CXF installed (I'm not aware of facilities of Mulesoft ESB/TIBCO AMX Service Grid/Oracle SOA Suite you mentioned), is it correct?
If so, I don't see any restrictions on having 1 orchestration service on one server and multiple business services on second server (so all services spread across 2 containers).
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 98
Surlac,

Thanks.

One of the good advantage of SOA is loose coupling. So, using the word "relationship" is crime ;-) [ kidding ]

A service is a function that is well-defined, self-contained, and does not depend on the context or state of other services. So, there will not be any parent-child relationship in case of orchestration services.

Although, our example does not imply on parent-child relationship, infact it implies on re-usability. "TransferAmount" service is common in the example you provided, this prooves that it is re-used

Axis2/CXF are JSX-WS tools and provide runtime environments to run java based web services. SOA/ESB containers are more than that.

There is nothing like a SOA container. SOA is a architecutal approach. ESB is a technical implementation aids in delivering SOA. A commercial ESB/SOA platform products are able to provide runtime enviroments for service implementations in different technologies like C, Java, .Net etc. The most common features of ESB tool are:

- Shares resources. exampe: think of few services access common database.
- Service virtualization

Hope this helps.

surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Sujeeth Pakala wrote:
"TransferAmount" service is common in the example you provided, this prooves that it is re-used

No doubt it is reused, but I can see 3 layers of services in this case (2 orchestration layers - 1'st do more global operation, 2'nd orchestrates low-level services - and business services layer). From your answer I see that it's also acceptable in practice.

Is it also valid pattern to use orchestration services in case if they use same subset of elementary/business web-services but in different order? For example:
"PaySalaryAndNotify" -> This orchestrates on orchestration service "TransferAmount" and business service "ReportToCustomer" ('salary transferred').
"NotifyAndPaySalary" -> orchestrates business service "ReportToCustomer" ('salary will be transferred in minutes') and uses orchestration service "TransferAmount".

Sujeeth Pakala wrote:
Axis2/CXF are JSX-WS tools and provide runtime environments to run java based web services. SOA/ESB containers are more than that.

I've used WSO2 ESB before, and I saw that it's actually uses Synapse, Axis2, CXF under the hood, because it's fast, proven frameworks by Apache. Is it also case for Mulesoft ESB/TIBCO AMX Service Grid/Oracle SOA Suite, or they use own proprietary components?

Thanks for all you help, Sujeeth. Could you please advice what should I read (book maybe) next in order to know more about practical usage of orchestration services? Maybe there is good opensource project where I can learn from?
Afzal Rehman
Ranch Hand

Joined: Dec 16, 2009
Posts: 39
You can use ESB with BPEL orchestration that might help you . if you are using Oracle SOA Suite then you can expose BPEL process with ESB.


SCJP 6.0
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 98
Is it also valid pattern to use orchestration services in case if they use same subset of elementary/business web-services but in different order?


Absolutely acceptable. Orchestrated service is type of business service with a functional boundary directly associated with a specific business task or process is based on the task model .It all depends on the functional context of the orchestration services.

I've used WSO2 ESB before, and I saw that it's actually uses Synapse, Axis2, CXF under the hood, because it's fast, proven frameworks by Apache.


Yes, same case for other commercial products. They support multiple runtimes, because design characteristics of the orchestration services are somewhat distinct due to specific nature of underlying technology.

Any BPM books will gives you practical use of orchestration services. But, I like to following books of Thomas Erl on SOA and Cloud computing. They are simply good.

For the moment I am reading SOA: Principles of Service Design.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integrating Web service