Chapter 1: ServiceMap Document: A Simple Example

<ServiceMap xmlns="http://www.extreme.indiana.edu/namespaces/2004/01/gFac"
            xmlns:simpleService="http://www.extreme.indiana.edu/services/simpleService">
</ServiceMap>

<ServiceMap xmlns="http://www.extreme.indiana.edu/namespaces/2004/01/gFac"
            xmlns:simpleService="http://www.extreme.indiana.edu/services/simpleService">

    <service>
        <serviceName targetNamespace="http://www.extreme.indiana.edu/services/simpleService">SimpleService</serviceName>
        <serviceDescription>A simple service that lists the files in the given directory</serviceDescription>
    </service>


</ServiceMap>

<ServiceMap xmlns="http://www.extreme.indiana.edu/namespaces/2004/01/gFac"
            xmlns:simpleService="http://www.extreme.indiana.edu/services/simpleService">

    <service>
        <serviceName targetNamespace="http://www.extreme.indiana.edu/services/simpleService">SimpleService</serviceName>
        <serviceDescription>A simple service that lists the files in the given directory</serviceDescription>
    </service>

    <portType>
        <method>
            <!-- Method names cannot have special characters like blank spaces in them -->
            <methodName>List</methodName>
            <methodDescription> List files in the given directory </methodDescription>

            <application>
                <applicationName targetNamespace="http://www.extreme.indiana.edu/application/simpleApplication">LS-Application</applicationName>
                <description>This application lists the files in a directory</description>
            </application>   
        </method>
    </portType>
   

</ServiceMap>

As we mentioned before, when a client invokes an operation on a service, the services runs the associated application and all the input parameters along with their values are passed on to the application. If you don't want the input parameter names to be passed on to the application and want just the input parameter values to be passed on to the application, then you must use the attribute "paramValuesOnly=true" in the "application" element as shown below.

<application paramValuesOnly="true">
    <applicationName targetNamespace="http://www.extreme.indiana.edu/application/simpleApplication">LS-Application</applicationName>
    <description>This application lists the files in a directory</description>
</application>

<ServiceMap xmlns="http://www.extreme.indiana.edu/namespaces/2004/01/gFac"
            xmlns:simpleService="http://www.extreme.indiana.edu/services/simpleService">

    <service>
        <serviceName targetNamespace="http://www.extreme.indiana.edu/services/simpleService">SimpleService</serviceName>
        <serviceDescription>A simple service that lists the files in the given directory</serviceDescription>
    </service>

    <portType>
        <method>
            <!-- Method names cannot have special characters like blank spaces in them -->
            <methodName>List</methodName>
            <methodDescription> List files in the given directory </methodDescription>

            <application>
                <applicationName targetNamespace="http://www.extreme.indiana.edu/application/simpleApplication">LS-Application</applicationName>
                <description>This application lists the files in a directory</description>
            </application>

            <inputParameter>
                <parameterName>directoryName</parameterName>
                <parameterType>String</parameterType>
                <parameterDescription>This name of the directory that has to be listed</parameterDescription>
            </inputParameter>

        </method>
    </portType>

</ServiceMap>

Specify the output parameters of the method: You must specify at least one output parameter for a method. The output parameter is the output result when the application is invoked. If you want the entire standard out of the application as the value of the output parameter, the "parameterType" for the output parameter must be “StdOut”. A list of supported output parameter types are listed below

<ServiceMap xmlns="http://www.extreme.indiana.edu/namespaces/2004/01/gFac"
            xmlns:simpleService="http://www.extreme.indiana.edu/services/simpleService">
    <service>
        <serviceName targetNamespace="http://www.extreme.indiana.edu/services/simpleService">SimpleService</serviceName>
        <serviceDescription>A simple service that lists the files in the given directory</serviceDescription>
    </service>
    <portType>
        <method>
            <!-- Method names cannot have special characters like blank spaces in them -->
            <methodName>List</methodName>
            <methodDescription> List files in the given directory </methodDescription>
            <application>
                <applicationName targetNamespace="http://www.extreme.indiana.edu/application/simpleApplication">LS-Application</applicationName>
                <description>This application lists the files in a directory</description>
            </application>
            <inputParameter>
                <parameterName>directoryName</parameterName>
                <parameterType>String</parameterType>
                <parameterDescription>This name of the directory that has to be listed</parameterDescription>
            </inputParameter>

            <outputParameter>
                <parameterName>StandardOut</parameterName>
                <parameterType>StdOut</parameterType>
                <parameterDescription>The standard out of the application</parameterDescription>
            </outputParameter>

        </method>
    </portType>
</ServiceMap>

Supported output parameter types in the ServiceMap document:

If the value of the output parameter is a string in the standard out of the application then you must provide a name for the output parameter and a regular expression that will match the value of the output parameter. For example.

<outputParameter>
    <parameterName>OutputParamName</parameterName>
    <parameterType>String</parameterType>
    <parameterDescription>The output result of the application</parameterDescription>
    <regExp>outfile\d[a-zA-Z].*</regExp>
</outputParameter>

In the above example, if the standard out of the application contains a string that matches the specified regular expression, the application service will return the string that matches the regular expression as the output result of the application in the response message to the client/user. The supported data types for output parameters are the same as that for input parameters.

[ << ] [ < ] [ Home ] [ > ] [ >> ]