MEX Sample Guide
INTRODUCTION
This samples demonstrates how to enable a Metadata Exchange (MEX) request for an arbitrary service,
how to use MEXClient to retrieve metadata from a service that supports MEX
requests and how to write your own data retrievers to configure the metadata of your
service.
HOW TO BUILD THE SAMPLE
The MEX sample is located in the samples directory which is in the WSO2WSAS root
directory.
Prerequisites
To build the samples you need the Apache Ant build tool
Follow these steps:
- Start the WSO2WSAS server
- Switch to the MEX sample directory
e.g. cd C:\wso2wsas-2.1\samples\MEX
- Type ant and press enter
e.g. C:\wso2wsas-x.x\samples\MEX>ant
HOW TO CONFIGURE SERVICES
To enable MEX request support for samples services, follow the following
steps
- Log in
- Click on the Services link in the Manage section on the left hand side panel.
You will see HelloWorldService1, HelloWorldService2,
HelloWorldService3 have been already deployed.
- Click on the HelloWorldService1 link
- Clink on the Manage Module Engagement link
- Select wso2mex from the drop down list and click the engage button
- Repeat above three steps for HelloWorldService2 and
HelloWorldService3
RUNNING THE CLIENT
- Switch to MEX sample directory
- Run run-client.bat (or run-client.sh if you are in Linux)
- Enter the URL of the target service
You will be prompted for the URL of the service of which you wish get
retrieve metadata
e.g. Please enter the service URL:
http://127.0.0.1:9762/services/HelloWorldService1
- Choose the type of metadata that you wish to retrieve
e.g. If you wish to retrieve XML Schema documents you need to type 1
and press enter when the following is prompted.
Choose type of Metadata
[1] XML Schema
[1] WSDL
[3] WS-Policy
1
- Specify the Identifier
This is optional and you can skip it by just pressing enter
- Then it will print the results on the console.