MEX Sample Guide

INTRODUCTION

This samples demonstrates how to enable MEX request for a 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 metadata of your service.

HOW TO BUILD THE SAMPLE

MEX sample is located in the samples directory which is in WSO2WSAS root directory.

Prerequisites

To build the samples you need Apache Ant build tool

Follow these steps:

  1. Startup WSO2WSAS server
  2. Switch to MEX sample directory
  3. e.g. cd C:\wso2wsas-2.1\samples\MEX
  4. Type ant and press enter
  5. e.g. C:\wso2wsas-x.x\samples\MEX>ant

HOW TO CONFIGURE SERVICES

To enble MEX request support for samples services, follow the following steps
  1. Log in
  2. Click on Services link on the Manage section
  3. You will see HelloWorldService1, HelloWorldService2, HelloWorldService3 have been already deployed.
  4. Click on HelloWorldService1 link
  5. Clink on Manage Module Engagement link
  6. Select wso2mex from the drop down list and click engage button
  7. Repeat above three steps for HelloWorldService2 and HelloWorldService3

RUNNING THE CLIENT

  1. Switch to MEX sample directory
  2. Run run-client.bat (or run-client.sh if you are in Linux platform)
  3. Enter the URL of the target service
  4. You will prompt for the URL of the service which you wish get retrieve metadata
    e.g. Please enter the service URL:

    http://127.0.0.1:9762/services/HelloWorldService1
  5. Choose the type of metadata that you wish to retrieve
  6. e.g. If you wish you retrieve XML Schema documents you need type 1 
    	and press enter when the following is prompted.
    	

    Choose type of Metadata [1] XML Schema [1] WSDL [3] WS-Policy 1
  7. Specify the Identifier
  8. This is optional and you can skip it by just pressing enter
  9. Then it will print the results on console