Understanding iWay Business Services

In this section:

iWay Explorer provides web developers with a simple, consistent mechanism for extending the capabilities of the adapter. The iWay Business Services Provider (iBSP) exposes functionality as web services. It serves as a gateway to heterogeneous back-end applications and databases.

A web service is a self-contained, modularized function that can be published and accessed across a network using open standards. It is the implementation of an interface by a component and is an executable entity. For the caller or sender, a web service can be considered as a "black box" that may require input and delivers a result. A web service integrates within an enterprise as well as across enterprises on any communication technology stack, whether asynchronous or synchronous, in any format.


Top of page

x
Creating a Business Service

You can create a business service for an SQL statement, stored procedure, table function, or batch. A request and response schema must be available before a business service can be generated.



x
Procedure: How to Generate a Business Service

To generate a business service:

  1. If you are not connected to a defined target, connect to one, as described in How to Connect to a Defined Target.
  2. Expand the node to display the statements or procedures.
  3. Click the SQL statement or stored procedure for which you want to create a business service.
  4. In the right pane, move the pointer over Operations and select Create iWay Business Services.

    The Create Web Service information appears in the right pane.

  5. Choose whether to create a new service or use an existing service.

    If you select Use an existing service, a drop-down list appears from which you must select the service.

    If you select Create a new service, the Create Web Service pane opens on the right as shown in the following image.

    1. In the Service Name field, type a name to identify the web service (under the Service node in the left pane of the iWay Business Services tab).
    2. In the Description field, type a brief description of the web service.
    3. In the License field, select the license(s) with which you want to associate this business service. To select more than one, hold down the Ctrl key and click the licenses.
  6. Click Next.

    Another pane with the Method Name and Description fields opens.

    1. In the Method Name field, type a name to specify the name of the SQL statement or stored procedure to be added to the business service.
    2. In the Description field, type a brief description of the method.
  7. Click Finish.

    iWay Explorer switches the view to the iWay Business Services tab, and the new business service appears in the left pane.


Top of page

x
Testing a Business Service

After a business service is created, test it to ensure that it functions properly. iWay provides a test tool for testing the business service.



x
Procedure: How to Test a Business Service

To test a business service:

  1. If you are not on the iWay Business Services tab of iWay Explorer, click the tab to access business services.
  2. If it is not expanded, expand the list of business services under iWay Business Services.
  3. Expand the Services node.
  4. Select the name of the business service you want to test.

    The business service name appears as a link in the right pane.

  5. In the right pane, click the named business services link.

    The test option appears in the right pane.

    If you are testing a web service that requires XML input, an input field appears as shown in the following illustration. Options to browse, upload, view additional information, or invoke the input are available through buttons.

    If you are testing a web service for a parameterized SQL statement, an input area appears where you can enter the parameter value, as shown in the following illustration.

  6. Provide the input for the appropriate input pane.
  7. Click Invoke.

    iWay Explorer displays the results in the right pane as shown in the following illustration.


Top of page

x
Generating WSDL From a Web Service

Generating Web Services Description Language (WSDL) from a web service enables you to make the web service available to other services within a host server.



x
Procedure: How to Generate WSDL From a Web Service

To generate WSDL from a web service:

  1. Click the iWay Business Services tab to access business services.
  2. In the left pane, expand the list of services to display the web service for which you want to generate WSDL.
  3. Click the web service.

    The link for the service appears in the right pane.

  4. Right-click the Service Description link and choose Save Target As.
  5. Choose a location for the file and specify .wsdl for the extension.

    Note: The file extension must be .wsdl.

  6. Click Save.


Example: Viewing WSDL Generated from a Web Service

The following is an example of a WSDL file for a web service called MPS generated from a parameterized SQL statement against Legacy Data.

<definitions xmlns:tns="urn:schemas-iwaysoftware-com:iwse"
  targetNamespace="urn:schemas-iwaysoftware-com:iwse"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
  xmlns:m11="urn:iwaysoftware:ibse:jul2003:VSAM:response"
  xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:m1="urn:iwaysoftware:ibse:jul2003:VSAM"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <types>
    <xs:schema targetNamespace="urn:schemas-iwaysoftware-com:iwse"
      elementFormDefault="qualified">
      <xs:element name="ibsinfo">
        <xs:complexType>
          <xs:sequence>
            <xs:element type="xs:string" name="service"/>
            <xs:element type="xs:string" name="method"/>
            <xs:element type="xs:string" name="license"/>
            <xs:element type="xs:string" minOccurs="0" name="disposition"/>
            <xs:element type="xs:string" minOccurs="0" name="Username"/>
            <xs:element type="xs:string" minOccurs="0" name="Password"/>
            <xs:element type="xs:string" minOccurs="0" name="language"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    <xs:schema targetNamespace="urn:schemas-iwaysoftware-com:iwse"
      elementFormDefault="qualified">
      <xs:element name="adapterexception">
        <xs:complexType>
          <xs:sequence>
            <xs:element type="xs:string" name="error"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    <xs:schema targetNamespace="urn:iwaysoftware:ibse:jul2003:VSAM"
      xmlns:m1="urn:iwaysoftware:ibse:jul2003:VSAM"
      elementFormDefault="qualified">
      <xs:element name="VSAM">
        <xs:complexType>
          <xs:sequence>
            <xs:element type="xs:string" name="emp_id"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    <xs:schema targetNamespace="urn:iwaysoftware:ibse:jul2003:VSAM:response"
      xmlns:m11="urn:iwaysoftware:ibse:jul2003:VSAM:response"
      elementFormDefault="qualified">
      <xs:element name="VSAMResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="RESULT">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="MPSVSAM">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element minOccurs="0" name="RESULTSET_1">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element minOccurs="0" name="ROW" maxOccurs="unbounded">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element type="xs:string" name="EMP_ID"/>
                                    <xs:element type="xs:string" name="FIRST_NAME"/>
                                    <xs:element type="xs:string" name="LAST_NAME"/>
                                    <xs:element type="xs:string" name="DEPT"/>
                                    <xs:element type="xs:string" name="COMP_NAME"/>
                                  </xs:sequence>
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute type="xs:string" use="required" name="cid"/>
        </xs:complexType>
      </xs:element>
    </xs:schema>
  </types>
  <message name="VSAMIn">
    <part element="m1:VSAM" name="parameters"/>
  </message>
  <message name="VSAMOut">
    <part element="m11:VSAMResponse" name="parameters"/>
  </message>
  <message name="MPSHeader">
    <part element="tns:ibsinfo" name="header"/>
  </message>
  <message name="AdapterException">
    <part element="tns:adapterexception" name="fault"/>
  </message>
  <portType name="MPSSoap">
    <operation name="VSAM">
      <documentation/>
      <input message="tns:VSAMIn"/>
      <output message="tns:VSAMOut"/>
      <fault message="tns:AdapterException" name="AdapterExceptionFault"/>
    </operation>
  </portType>
  <binding type="tns:MPSSoap" name="MPSSoap">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="VSAM">
      <soap:operation style="document" soapAction="MPS.VSAMRequest@production@@"/>
      <input>
        <soap:body use="literal"/>
        <soap:header part="header" message="tns:MPSHeader" use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
      <fault name="AdapterExceptionFault">
        <soap:fault use="literal" name="AdapterExceptionFault"/>
      </fault>
    </operation>
  </binding>
  <service name="MPS">
    <documentation>MPS</documentation>
    <port binding="tns:MPSSoap" name="MPSSoap1">
      <soap:address location="http://iwayntk1:7001/ibse/IBSEServlet/XDSOAPRouter"/>
    </port>
  </service>
</definitions>

Top of page

x
Identity Propagation

If you test or execute a web service using a third party XML editor, for example XMLSPY, the Username and Password values that you specify in the SOAP header must be valid and are used to connect to RDBMS. The user name and password values that you provided for RDBMS during target creation using iWay Explorer are overwritten for this web service request.

The following is a sample SOAP header that is included in the WSDL file for a web service:

<SOAP-ENV:Header>
  <m:ibsinfo xmlns:m="urn:schemas-iwaysoftware-com:iwse">
    <m:service>String</m:service>
    <m:method>String</m:method>
    <m:license>String</m:license>
    <m:disposition>String</m:disposition>
    <m:Username>String</m:Username>
    <m:Password>String</m:Password>
    <m:language>String</m:language>
  </m:ibsinfo>
</SOAP-ENV:Header>

Note: You can remove the following tags from the SOAP header, since they are not required.

<m:disposition>String</m:disposition>
<m:language>String</m:language>

iWay Software