Wednesday, April 29, 2015

Consuming websevice in ADF with change in WSDL URLs between different Environments.

In projects where Web Services are consumed, most of the problems come when webservcies are deployed on different environments and url of Service/WSDL gets changed. In consuming application proxys are generated using on environment Service/WSDL and when application moves to another environments, the poxys need to consume the services deployed on that particular environment.

To achieve this requirement, there needs to be some mechanism or way where we can configure the environment Service URL in the consuming application and deploy the same to use the correct environment service.


Created a Simple Web Service and deployed it on both Local Integrated Server and Stand Alone server.





For consuming web service,  we generate proxy using DEV WSDL URL.









This generates all the types and proxys, To Test the service below is the simple client. In Actual projects there will be a Wrapper which will consume this service and expose to view layer as Data Control.




The code gives below output.



But the code above is static to the proxy of service/wsdl deployed on local server.

But what happens if the Service Endpoint / WSDL URL Changes. So for this use below code and this is the solution for the problem described in this post.



This gives the same out put. Now if the same Service/WSDL is moved to another location (IP) / Environment, the code looks like below .



This also gives the same output.



In Actual scenario the  Service URL will be placed in properties file and we can change the url in properties file for different environments.





3 comments:

  1. Hi,

    in actual scenario, using ADF your create an ADF web service connection in which the url is stored in the MDS and you can change it in the fusion middleware control. Much better than changing properties file IMO.

    -regards

    ReplyDelete
  2. Hi,

    I have done all the steps.Could you please tell me how to use Service URL from properties file in different environments.

    thanks in advance

    ReplyDelete
  3. last month he share is herbal medicine in some medical hospital and now he is well recognize as one of the best in West Africa, you don’t have to be sad any more or share your tears any more on this virus when the cure have already be find in 2013 if you want to get in touch with him in private contact him on his email dr.chalaherbalhome@mail.com Or you can visit his website on https://
    drchalaherbalhome.godaddysites.com or https://mywa.link/dr.chalaherbalhome

    ReplyDelete