Monday, April 04, 2011

How to get the WSDL of a Proxy Service in OSB

I had a lot of confusion with Proxy service and wsdl of proxy service concept.
Through this section i will try to just answer the different confusion i had.
First of all we need to understand is that OSB is not a platform for designing your business process.It is only used for routing and transformation and some simple logics.So if you have created a simple transformation and you assume that you will get a wsdl for the same then you are wrong.A wsdl is an independent unit so it must contain some business logic some operation to perform..So the most important thing to get the wsdl of a proxy service is that it should contain a business service which is doing some operation,Now with this logic we will create create a proxy service and see how we can get the wsdl of that proxy service.

I will create a simple java program then will create a simple web service out of that java class.Will use this in osb and see how we can find the wsdl of OSB proxy service.


So first of all we will write a Java program with a single method.
I am using Jdeveloper utility to develop my java code and generate web service.

I created an application an a project,within the project i will create a simple Java class with a simple method as shown below.



Now right click in the java program and say create a web service.




It will come up with a gui and i am not aware of the different gui pages that

comes so i just keep saying next and finally finish the wizard.






Once you will say finish you will see a web.xml generated for you as shown below.






Now go to you Jdeveloper Run tab and click on start integrated weblogic server.

Once the Integrated Weblogic server is started test the web service that you have
generated now.



Test it



When asked for option choose the second option as shown below



AS you will select it the process will be deployed to Integrated weblogic server and automatically a test page will come up,Just test this page with some imput and send request to get the output


Now click on the test java code and show the wsdl file.

It will show you the wsdl file and its location.






Now once you get the WSDL we will import the wsdl in to our OSB console.

Create a new project a new folder and within that create a WSDL service and import

the WSDL as shown,Don't give any name to the wsdl file.Just browse for the Wsdl

file and as soon as you will select the wsdl the name will be automatically

populated.





Now create a business service based on the wsdl service and select the WSDL that

we have just imported to the console



Choose the port



choose the default configuration and save it.Now create a proxy service using this

business service as shown




Now activate the changes and now you should see three resources in your panel

the wsdl ,business service(BS) and the proxy service(PS)



Now test the proxy



you can see the response as below



Now we have a working scenario now we want to know the wsdl for the proxy service
that we have,The wsdl of a proxy service is represented as

http://hostname:osb-port/end-pointURI for proxy?wsdl

Now we will see in our case how we can find the wsdl for proxy.

first of all log in to Admin console and find out the port for OSB





Now click on the TestPS proxy service and find out the Endpoint URL

So now we have got all the unknown parameter in our formula.Just putting all the

information in our fomrula our request will look something like this.

http://localhost:8011/Sample/DBADapter/TestPS?wsdl



you can get you wsdl

2 comments:

Anonymous said...

I am a regular follower of your blog and i personally feel this is one of your best article,I have some great offer for you,Let me know how to reach you..email..mobile..

Tito Luján said...

Hello, your excercise can to run too in server AdminServer, with port 7001?