Invoking REST web service in IBM Integration Bus - web-services

I am here with a query of how to invoke a REST web service using a message flow in IBM's Integration bus.
My requirement is as follows:
Firstly I have a SOAP web service which I expose. This SOAP web service when gets invoked I want to call another web service which is a REST web service.
I developed two message flows.
The first one (a sample dummy message flow) in which I have a SOAP Input node, a Java Compute node and a SOAP Reply node. In this scenario, when I try to this SOAP web service and pass some Input then I get the same Input which I hope is an expected behavior.
Now the second flow is with a SOAP Input node, a HTTP Request node (for invoking a REST web service) and finally a SOAP Reply node. (3 nodes again in this flow).
I wanted to know if I am correctly implementing the second message flow here. If not, what else I need to add to this message flow so that my thing gets done nicely. If need to add some SOAP extract/envelope node to this flow.
The EXCEPTION I get whilst I try to invoke my SOAP web service is as follows:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: BIP3113E: Exception detected in message flow SingleArgMsgFlow.SOAP Input (broker IB9NODE)
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:190)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:131)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:120)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:90)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:141)
at $Proxy27.processRqst(Unknown Source)
at org.tempuri.singleargmsgset.SingleArgInvoker.main(SingleArgInvoker.java:15)
Any help would greatly be appreciated!! :)

Related

Oracle Service Bus multiple operations inside exposed SOAP service

Currently I am developing a ws with OSB using JDeveloper 11.
I have a simple web service, which calls an external SOAP service.
My composite.xml file:
Operations of my BPEL Soap service
Operations of remote SOAP Service
BPEL Component
I have few questions regarding the current development strategy. How shall I add new operations to my BPEL SOAP? I added a new method (getCompanyDetails()) by editing ApusBPELProcess.xsd (added new request and response types) and ApusBPELProcess.wsdl (added new operation, message and etc). Is this the correct way for adding new operations?
Now I can call only one method of the remote SOAP service by using an "Invoke" component from BPEL constructs.
My BPEL design:
How can I call bind a method from my BPEL SOap (1) to a method from remote service (2) ? For example: when client calls method process from my BPEL Soap (1), I want to do some validation on input parameters and then call getServiceCompanies from remote SOAP (2). And so when client calls another method from BPEL Soap (1) I want to call some other methods on remote SOAP (2).
Will be very thankful if someone can show me a diagram, with required components. Because I read about "Mediator" components, but I don't know how to use them in my current situation.
Thanks in advance.
One option is, You can use Pick activity that can have multiple onMessage branches for each operation exposed by your BPEL service.
Similarly, Invoke activity has an option to select the operation of the Remote SOAP service that you need to call.
So your composite would look like Pick activity with an OnMessage branch with BPELoperation1 selected, then logic to do validation and then invoke with remoteoperation1 selcted.And another onMEssage branch with BPELoperation2 selected, logic to do validations and invoke with remoteoperation2 selected.
I found a solution with Mediator component. Maybe it will help someone.
Ok, I added a Mediator component between my exposed service and remote service. Mediator component will do request routing and data transformation between these two services. For each method in my exposed service I added a BPEL process to the other endpoint of Mediator (I will do some method specific validation/other logic inside these BPEL processes).
My final composite.xml:
Methods of my exposed service
Mediator
The remote service what I call
Inside Mediator component I do routing and transformation. For each method of my exposed service (1) I have a routing rule in Mediator (2).
Mediator component rules:
4a, 4b - Methods of my exposed service
4c - button for adding new routing rule
4d - button for adding transformation rule (generally you will have a pair of transformation rules for a method - request/response)
Transformation files are .xsl files that do information convertion between two endpoints.
My .xsl files:
Content of a .xsl file:
Here I am doing iteration through the response data (for-each component).
And finally inside of each BPEL process I have an "Invoke" component (5) which calls the appropriate method on the remote service.
Hope it will someone. Good luck!

Asynchronous Web service in Java

How to create Asynchronous web service in java using eclipse??
I have created a normal web service in Java using eclipse. I am calling an external jar, which is taking long time to complete the process. By that time my web service is getting an exception throwing timed out exception.
In order to over come the problem, decided to create asynchronous web service, but couldn,t find proper details. Please help.
no one responded to the question...
Found tentative solution for this....in order to over come the timed out exception, as soon as the request is received by the web service immediate response a unique id is sent acknowledging the request. A thread is initiated inside the web service for the corresponding request, which will take care of the process and stores the response in a table with a unique id for the request.

How to pass collection<?> over JAX-WS web service

In my project I need to write a web service which will receive Collection<?> as a parameter.. I am using apache CXF.. After I have written the service method I am unable to test it using SOAP UI (It is not generating any request).. My question is - Is it possible to receive Collection<?> over web service? I need to receive Collection of any object type.. Please help..
You need to work directly with SOAP messages.

Client Generation in web service(jax)

I made a web service endpoint and exposed a method now i wanna add more parameter to my method
so each time i change in my method i have to regenerate my client. Is there any way so that i
dont have to generate my client again and again.
No, there is no way. If you change the method then the WSDL file is changed also. Web services communicates through SOAP between client and server. When you deploy your web service application and it has been changed, so how then client supposed to know if there is a new method or a new parameters added if the classes was generated from the old WSDL file. Client will send a SOAP request according to the old WSDL and the server won't be able to understand the SOAP message received from the client if there was any changes made to WSDL part related to the received message.
You could design a better webservice/endpoint that accepts a standalone xml document as argument so that the operation signature stays the same, even when you add more parameters.
More generally, it's bad form for a web service to expose it operations as literal method signatures.

Invoke BPEL from a Webservice in OpenESB

Right now i'm developing a composite application using Open ESB. I got my
application tested through a test case by sending a request SOAP message,
and it works great.
The problem is, i want my composite application to be able to be used like
a webservice so i could call the composite application from Python using SOAPpy,
not by sending an edited SOAP message like in the test case.
How can i achieve that? Should i invoke the BPEL process from a webservice?
I already read "A Gentle Introduction: Exploring OpenESB" and "Building SOA-Based
Composite Applications Using NetBeans IDE 6". Both of the books create an interface
for the composite application, not using the composite application like a webservice.
Thanks in advance,
Well, by definition, each BPEL process is rendered as a Web service. In other words: the only possibility to invoke a BPEL process is to invoke the web service interface provided by the BPEL process (the myRole of the partnerlink that is used for inbound message activties). When your test case also submits a SOAP message to the BPEL process, any other Web service client can do the same.
Sorry for late answer but this can help other users.
Of course they will not use the composite applications as web service simply because it - the composite app - is a client consuming the web service that you have defined using the BPEL ( Business Process Execution LANGUAGE ).
Now the question is, how to get the wsdl for our web service ?
Answer :
go to your composite application
select " wsdl ports " select the wsdl that you have created in "BPEL MODEL" project.
right click => properties => location , then copy location value
replace {httpdefaultport} by 9080
add ?wsdl to the end of the location