Skip to main content

Register webservices wsdl in OEG through script

In my previous Post blogger Mark O'Neill pointed me to check new version of OEG, which has been shipped with sample scripts. Last weekend i decided to spent some time to digging out these samples. The following a list of sample scripts which ship with the Gateway: - analyse Perform various analysis on configuration - certs Examples working with certificates - io Exporting and importing configuration - publish Publishing new types to the configuration - upgrade Upgrading older versions of configuration - users Examples working with users - ws Working with Webservices and WSDLs It's pretty easy yo run these scripts, for example sh run.sh ws\listWebServices.py will show the list of the registered web service. Similarly registerWebService.py will register web service wsdl into OEG. I have simply modify the script to register web services wsdl from file, where file contain a list of web service wsdl as follows:
http://www.restfulwebservices.net/wcf/WeatherForecastService.svc?wsdl
http://www.restfulwebservices.net/wcf/UNSPSCService.svc?wsdl
http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
http://www.restfulwebservices.net/wcf/StockQuoteService.svc?wsdl
and here is the modified jython script:
'''
Register WSDL in Gateway
'''


from java.util import ArrayList
from deploy import DeployAPI
from esapi import EntityStoreAPI
from com.vordel.client.manager.actions.services import AddWebServiceServletProcessor
from vtrace import Tracer
import common

t = Tracer(Tracer.INFO) # Set trace to info level

dep = DeployAPI(common.gw_deployURL, common.defUserName, common.defPassword)
es = dep.getStore('')

deployLocation = es.get('/[NetService]name=Service/[HTTP]name=Default Services')
wsGroup = es.get('/[WebServiceRepository]name=Web Service Repository/[WebServiceGroup]name=Web Services')

aws = AddWebServiceServletProcessor(es.es)
file = open("wsdls.txt", "r")
for line in file.readlines():
 print line
 deploymentPks = ArrayList()
 deploymentPks.add(deployLocation.getPK())
 aws.addWebService(wsGroup, line.strip(), deploymentPks, 60)
 res = dep.setStore(es)
 if res.getStatus() != True:
     t.error("Failed to deploy: " + res.getFailureReason())
     t.error("Failures: "+ Integer.toString(res.getErrorCount())) 

file.close()

es.close()
dep.logout()
Next step is to register web service and assign some global policy on them. P.S. Thank's to Mark O'Neill for pointing me about new OEG version

Comments

Popular posts from this blog

Apache Ignite deep dive, SQL engine

Apache Ignite  is an open source memory-centric distributed database, caching and comput- ing platform. From the beginning, it was designed as an in-memory data grid for developing a high-performance software system. So, it’s core architecture design is slightly different from the traditional NoSQL databases, which can simplify building modern applications with a flexible data model and simpler high availability, high scalability.     Moreover, to understand how to design application with any databases or framework properly, you must understand the architecture of the database or framework itself. By getting a better idea of the system, you can solve different problems in your enterprise architecture landscape, can select a comprehensive database or framework that is appropriate for your application and get the maximum benefits from the system. In this article we are going to explore the Apache Ignite SQL engine.      Under the hood...

Book review: High Performance in-memory computing with Apache Ignite by Sadruddin Md

A new title  The Apache Ignite book  has been released including Ignite 2.6 and above. Read the full book review by Sadruddin Md .

Quick start with In memory Data Grid, Apache Ignite

UP1: For complete quick start guide, see also the sample chapter of the book "High performance in-memory computing with Apache Ignite" here . Even you can find the sample examples from the GitHub repository . IMDG or In memory data grid is not an in-memory relational database, an NoSQL database or a relational database. It is a different breed of software datastore. The data model is distributed across many servers in a single location or across multiple locations. This distribution is known as a data fabric. This distributed model is known as a ‘shared nothing’ architecture. IMDG has following characteristics: All servers can be active in each site. All data is stored in the RAM of the servers. Servers can be added or removed non-disruptively, to increase the amount of RAM available. The data model is non-relational and is object-based.  Distributed applications written on the platform independent language. The data fabric is resilient, allowing non-disruptive au...