banner



How To Creat Proxy Service Wso2 Esb

You tin create a new proxy service or import an existing proxy service from an XML file, such every bit a Synapse configuration file using WSO2 EI tooling.

Prerequisites

You demand to have WSO2 EI tooling installed to create a new proxy service or to import an existing proxy service via tooling. For instructions on installing WSO2 EI tooling, see Installing Enterprise Integrator Tooling.

Step ane:Creating an ESB projection

First, create an ESB Solution Projection in ESB tooling. We will use this project to store the proxy service file.

  1. Open the Programmer Studio Dashboard (clickDeveloper Studio > Open Dashboard) and clickESB SolutionProject .

  2. Enter a name for the project and clickNext.
  3. Enter the Maven information near the project and clickStop.
  4. The new project will be listed in the projection explorer.

Step 2: Creating a new proxy service

Following sections describe how you tin can create a new proxy service.

  1. In Eclipse, click theDeveloper Studio menu and then clickOpen Dashboard. This opens theDeveloper Studio Dashboard.
  2. ClickProxy Serviceon theDeveloper Studio Dashboard.

    Importing a proxy service?

    If y'all already accept a proxy service created, you have the option of importing the XML configuration. Select Import Proxy Service  and follow the instructions on the UI. To create a new proxy service from scratch, keep with the post-obit steps.

  3. SelectCreate a New Proxy Service and clickAdjacent.

  4. Type a unique name for the proxy service, and select a proxy service template from the list shown below. These templates will automatically create the mediation logic relevant to each use instance.


    The templates are explained below.

    Template Blazon Clarification
    Pass-Through proxy Forwards messages to the endpoint without performing whatever processing on them. This proxy service is useful as a take hold of-all, so that messages that practise non meet the criteria to be handled by other proxy services are simply forwarded to the endpoint. When y'all select this proxy service type, y'all just specify the target endpoint as described in the previous step. You need to specify the following parameters:
    • Target Endpoint
    • Endpoint URL
    Transformer proxy Transforms all the incoming requests using XSLT and so forrard them to a given endpoint. It can also transform responses from the backend service. Specify the target endpoint every bit described in the previous stride, and so specify the location of the XSLT y'all want to use to transform requests, either by typing the path or by clickingBrowse and navigating to the XSLT, which tin be a file in the workspace or registry or tin can be a local entry. If you also want to transform the responses from the backend service, clickTransform Responses. You demand to specify the following parameters:
    • Target Endpoint
    • Endpoint URL
    • Request XSLT
    • Response XSLT
    Log Forwards proxy Logs all the incoming requests and frontwards them to a given endpoint. It can likewise log responses from the backend service before routing them to the client. Specify the log level for requests and responses, whereUncomplicatedlogsTo, From, WSAction, SOAPAction, ReplyTo, MessageID, and any backdrop, andFull logs all attributes of the message plus the SOAP envelope information. You need to specify the following parameters:
    • Target Endpoint
    • Endpoint URL
    • Request Log Level
    • Response Log Level
    WSDL-Based proxy A proxy service that is created from the remotely hosted WSDL of an existing spider web service. The endpoint information is extracted from the WSDL. In theURI field, enter the URL and URN of the WSDL. The URL defines the host accost of the network resource (tin be omitted if resource are not network homed), and the URN defines the resource name in local namespaces. For instance, if the URL is ftp://ftp.dlink.ru and the URN is/pub/ADSL/, you lot would enter ftp://ftp.dlink.ru/pub/ADSL/ for the URI. To ensure that the URI is valid, clickTest URI. You then enter the service name and port of the WSDL. Lastly, if you desire to publish this WSDL, clickPublish Aforementioned Service Contract. You demand to specify the following parameters:
    • WSDL URI
    • WSDL Service
    • WSDL Port
    • Publish Same Service Contract
    Secure proxy Uses WS-Security to process incoming requests and frontwards them to an unsecured backend service. Specify the target endpoint as described in the previous step, and and then specify the central of the security policy or click Browse and select information technology from the registry. Y'all need to specify the following parameters:
    • Target Endpoint
    • Endpoint URL
    • Security Policy
    Custom proxy A custom proxy service in which yous customize all the sequences, endpoints, transports, and other QoS settings by adding them to the mediation workflow afterwards the proxy service is created. You can likewise configure proxy services manually in XML. Following is an example of manually configuring a Synapse proxy service. For additional samples of manual proxy service configurations, see Proxy Service Samples.
  5. Click Finish. The proxy service is created in the src/main/synapse-config/proxy-service folder nether the ESB Config Project you specified, and the proxy service appears in the editor. Click its icon in the editor to view its properties.

Configuring transports

A proxy service is created and exposed on the specified transports through the underlying Axis2 engine. The proxy service can exist a SOAP or REST/POX service over HTTP/S or SOAP, POX, Plain Text, or Binary/Legacy service for other transports such as JMS and VFS file systems. It exposes service EPRs as per the standard Axis2 conventions based on the service proper name.

Note

Axis2 does not allow custom URIs to exist set for services on some transports such equally HTTP/S. The proxy service could be exposed overall enabled Axis2 transports such as HTTP, HTTPS, JMS, Mailand File etc. or on a subset of these as specified with the optional transports aspect.

Configuring pinned servers

You tin can use thepinnedServers attribute to specify the list of Synapse servers where this proxy service should be deployed. If there is no pinned server listing, the proxy service is started in all server instances. ThepinnedServers attribute takes the Synapse server names separated by commas or spaces. The Synapse server proper noun is specified in the organisation propertySynapseServerName or through theaxis2.xml parameterSynapseConfig.ServerName. If neither of these are set, the server hostname is used, or it defaults tolocalhost. You lot tin can requite a proper noun to a Synapse server instance past specifying the property-DSynapseServerName=<ServerName> when y'all execute the startup scriptintegrator.bat orintegrator.sh, or by editingwrapper.conf to do this where Synapse is started as a service.

Configuring service parameters

The following service parameters are for specific transports:

Transport

Require

Parameter

Description

JMS

Optional

ship.jms.
ConnectionFactory

The JMS connection manufactory definition (from axis2.xml) to be used to
listen for letters for this service.

Optional

transport.jms.
Destination

The JMS destination proper name (Defaults to the service proper noun).

Optional

ship.jms.
DestinationType

The JMS destination type. Take values "queue" or "topic."

Optional

transport.jms.
ReplyDestination

The destination where a answer will be posted.

Optional

transport.jms.
Wrapper

The wrapper element for the JMS message.

VFS

Required

transport.vfs.
FileURI

The main File (or Directory) URI inthevfs* ship format, for this service.

Required

transport.vfs.
ContentType

The expected content type for files retrieved for this service. The VFS
ship uses this information to select the appropriate bulletin builder.
Examples:

  • text/xml for plain XML or SOAP
  • text/plain; charset=ISO-8859-i for text files
  • application/octet-stream for binary information

Optional

transport.vfs.
FileNamePattern

A file name regex pattern to match files against a directory specified
by the FileURI.

Optional

transport.
PollInterval

The poll interval (in seconds).

Optional

ship.vfs.
ActionAfterProcess

DELETE or MOVE.

Optional

transport.vfs.
MoveAfterProcess

The directory to motion files after processing (i.e. all files process
successfully).

Optional

transport.vfs.
ActionAfterErrors

DELETE or MOVE.

Optional

ship.vfs.
MoveAfterErrors

The directory to motion files after errors (i.e. some of the files
succeed but some fail).

Optional

ship.vfs.
ActionAfterFailure

DELETE or MOVE.

Optional

transport.vfs.
MoveAfterFailure

The directory to motion subsequently failure (i.e. all files neglect).

Optional

transport.vfs.
ReplyFileURI

Reply file URI.

Optional

transport.vfs.
ReplyFileName

Respond file proper noun (defaults to response XML).

Optional

transport.vfs.
MoveTimestampFormat

Timestamp prefix format for candy file name.
java.text.SimpleDateFormat compatible string. due east.chiliad. yyMMddHHmmss'-'.

Configuring security

Any supplied WS-Policies utilize as service-level policies, and whatsoever service parameters can be passed into the proxy services'AxisService case using the parameter elements (for case, the JMS destination). If the proxy service should enable Security, the appropriate modules could be engaged, and specified service level policies will employ.

You also have the option of using the management console to create proxy services: Click theMain tab on the direction panel, go toManage ->Services ->Add, and and then clickProxy Service. TheCreate Proxy Service from Template screen appears.

Step 3: Deploying the proxy service in the ESB server

In one case you lot have added the security policy to your proxy service every bit explained in the previous topics, you demand to create aBlended Application project with a CAR file. You can so deploy the CAR file in the ESB server:

  1. Right-click theProject Explorer and clickNew > Project.
  2. From the window that opens, clickBlended Application Project.
  3. Give a name to theComposite Application project and select the projects that you need to group into your C-App from the list of bachelor projects. Y'all demand to select theESB project, which contains the proxy service and security policy file respectively.

  4. Adjacent, deploy the Motorcar file in the ESB server.

Footstep 4: Enabling logs for services (Optional)

The advantage of having per-service log files is that it is very easy to analyze/monitor the basic logs relevant to a proxy service defined in the ESB. This file volition contain the complete log with every log statement, including the service logs that you have configured to be logged into a different log file. In other words, the service log is an additional log file, which will comprise a re-create of the logs to that particular service.

Follow the instructions below to configure the logs of a item service to be logged into a given log file.  The post-obit steps explain how to enable logs for a sample proxy service deployed in the ESB profile of WSO2 EI.

  1. See Sample 150 in Proxy Service Samples. It has a proxy service namedStockQuoteProxy.
  2. Configurelog4j to log the service specific logs to a file calledstock-quote-proxy-service.log in the logs directory of the EI installation directory.
    1. Open up thelog4j.properties file plant in theconf directory of the WSO2 EI installation directory using your favorite text editor and add together the following section to the stop of the file starting in a new line.

      log4j.category.SERVICE_LOGGER.StockQuoteProxy=DEBUG, SQ_PROXY_APPENDER log4j.additivity.SERVICE_LOGGER.StockQuoteProxy=faux log4j.appender.SQ_PROXY_APPENDER=org.apache.log4j.DailyRollingFileAppender log4j.appender.SQ_PROXY_APPENDER.File=logs/stock-quote-proxy-service.log log4j.appender.SQ_PROXY_APPENDER.datePattern='.'yyyy-MM-dd-HH-mm log4j.appender.SQ_PROXY_APPENDER.layout=org.apache.log4j.PatternLayout log4j.appender.SQ_PROXY_APPENDER.layout.ConversionPattern=%d{ISO8601} \[%X{ip}-%X{host}\] \[%t\] %5p %c{i} %m%n
    2. Save the file.
  3. Execute the sample client subsequently starting the server with sample 150: and the sample axis2 server with theSimpleStockQuote service deployed on information technology every bit per stated in the sample documentation.

    $<EI_HOME>/bin/wso2ei-samples.sh \-sn 150
  4. Audit the logs directory of the ESB profile's installation directory to see thestock-quote-proxy-service.log file.

Further, to demonstrate the log file rotation; this particular logger was configured to rotate the file in each minute whenever there is a log going into the service log. Therefore, if y'all execute the sample client once over again after one minute, yous will be able to run into the service log file rotation as well.

Source: https://docs.wso2.com/display/EI630/Creating+a+Proxy+Service

Posted by: gutierrezdialt1955.blogspot.com

0 Response to "How To Creat Proxy Service Wso2 Esb"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel