WSDL BSF Extension

 

 

  1. Details :

 

The BSF binding is a WSDL binding that allows abstract functionality in the abstract service description (messages, operation and port types) to be mapped to the functionality offered by Scripts directly. This means that a script can be described using WSDL, and can be accessed as a WSDL- described service through WSIF.

This makes use of Bean Scripting Framework (BSF) to provide the scripting capabilities.

 

 

The BSF binding extends WSDL with the following extensibility elements:

 

<definitions ….>

 

     <!-- BSF binding -->

     <binding …>

             <bsf:binding/>

             <operation>*

                  <bsf:operation

                        methodnamenmtoken”

                        parameterOrder=”nmtoken” ?

                        returnPart=”nmtoken”? />?

               <input name=”nmtoken”? />?

               <output name=”nmtoken”? />?

              <fault name=”nmtoken”? />?

             </operation>

      </binding>

 

       <service … >

             <port>*

                      <bsf:script  lang=”nmtoken”

                              src=”nmtoken”? >

                        <!—actual script here -- >

                       </bsf:script>

             </port>

        </service>

</definitions>

 

 

 

Each element is described in detail below.

 

 


 

  1. Example :

 

In the following example, a dateConversion service is offered through Java Script.  The service exposes converData operation which takes three input parameters (input data string, input dataformat  and output dateformat) and returns the converted date string.

 

 

 

<?xml version='1.0' encoding='UTF-8'?>

<definitions name='DateConversion'

                 targetNamespace='http://xml.apache.org/axis/wsif/samples/js/DateConversion'

                 xmlns:tns='http://xml.apache.org/axis/wsif/samples/js/DateConversion'

             xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/"

             xmlns:bsf='http://schemas.xmlsoap.org/wsdl/bsf/'

             xmlns:xsd='http://www.w3.org/2001/XMLSchema'

             xmlns='http://schemas.xmlsoap.org/wsdl/'>

 

   <message name='convertDateRequest'>

      <part name='dateString' type='xsd:string'/>

      <part name='inFormat' type='xsd:string'/>

      <part name='outFormat' type='xsd:string'/>

   </message>

 

   <message name='convertDateResponse'>

      <part name='result' type='xsd:string'/>

   </message>

 

   <portType name='DateConversionPortType'>

      <operation name='convertDate'>

         <input message='tns:convertDateRequest'/>

         <output message='tns:convertDateResponse'/>

      </operation>

   </portType>

 

   <binding name='DateConversionBSFBinding'

            type='tns:DateConversionPortType'>

     <bsf:binding/>

    <operation name="convertDate">

      <bsf:operation

         methodName="convertDate"

         parameterOrder="dateString inFormat outFormat"

         returnPart="result" />

      <input name="convertDateRequest"/>

      <output name="convertDateResponse"/>

    </operation>

  </binding>

 

   <service name='DateConversion'>

      <port name='DateConversionPort'

            binding='tns:DateConversionBSFBinding'>

            <!-- vendor-specific deployment information needs to be entered here -->

            <bsf:script lang="javascript" src="C:\\bhuvan\\wsif-2_0\\samples\\bpel\\Test.js"/>

      </port>

   </service>

</definitions>