Oracle Service Bus multiple operations inside exposed SOAP service - web-services

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!

Related

SoapUI: Create mock service with pass-through behavior for selected methods

While developing a web application I have the following use case:
a 3rd party Web Service with quite a lot of methods is deployed on a test server A (with a single endpoint, e.g. http://3rdPartyServer/3rdPartySvc?WSDL)
a new method is about to be implemented in the near future, but I need to use it now
the rest of the methods are used throughout my code extensively
So I would like to do the following:
Create a mock service in SoapUI locally, based on the new WSDL which includes the new WS method (i.e. a superset of the WS methods currently on server A)
point my local application server to use the SoapUI mock service endpoint
mock only the response of the new WS method (create a dummy response for it in SoapUI)
let the other WS method calls to reach server A and return whatever it returns normally (i.e. use SoapUI as a proxy for these calls)
I've gone through the SoapUI documentation regarding service mocking and have used it numerous times, but could not find an option for such "pass-through" behavior.
When you read in your WSDL, the endpoint will point to your server.
Open your service, and select the service endpoint.
Add a second endpoint, to point to your mock. SoapUI has little bit of documentation showing this here. Only step "2. Getting Started" applies, not step 3!
In each of your tests, where you are using the mocked method, you will need to select the mock endpoint. Further discussion is here.

Invoking REST web service in IBM Integration Bus

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!! :)

XML Binding via Web Service (or JAXB)

I have to maintain a Java EE 5 web app.
A part of this app is the exchange of messages through web services (with WSDL contract).
The wsdl is used to generate the Java classes through the Eclipse wsdl2Java (I think it uses Axis)
Now I have to implement a modification where the server that we call via Web Service must be able to respond in an async way.
In fact the server will not respond immediately with the SOAP message response but, after a while, call a web service exposed by the client (our web app)
passing the SOAP Message response of the first call as a field (parameter) of this second Web service invocation.
The client then will save the SOAP response (or XML) in a file.
Is there a way to populate the already generated Java classes using this XML or SOAP message file? I mean a way to simulate the direct response of the server (feeding the Axis binding Stub)
I have also tried to use JAXB (to bind XML to JAVA) but since the SOAP message response is complex, when I call JAXBContext I receive an error:
CodPrestazione does not have a no-arg default constructor
since this class is an enum class generated by the wsdl2Java.
Is there a way to bypass this error without annotating or modifying the java class (this class is generated so I will be forced to modify this class at every re-generation)?
What is the best way to consume a saved SOAP message file(or XML)? Alternatively, how can I deserialize SOAP using Axis 1.3?

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