Deploying a Uniface Web Service

To enable call-in to Uniface web services:

  1. Create a Uniface service component, for example, MY_WS and compile it.

    A Uniface web service can be created as a Uniface service (SVC), session service (SSV), entity service (ESV), or a service with a non-Uniface implementation, such as COM or C.

    Consider the following when you develop a service to be used as a web service:

    IssueExplanation
    StateWeb services are stateless. To maintain state, you must specify parameters containing state information to be used by the service to retrieve the correct state.
    Return valueFor synchronous implementations, the return value of the SOAP request is mapped to $status and the type is fixed to int.
    Character setUTF-8
    Callback operationsYou can implement callback operations to process any SOAP envelope that the user wants, including those with encrypted content. For more information, see SOAP Callback Operations for Web Services Call-In .
  2. Export the signature of MY_WS using the /sto /mwr=ws command line switch. For more information, see Exporting WSDL and Schema Files for Web Services Call-In.
    /sto /mwr=ws MY_WS

    A my_wsdlw.wsdl file is generated in the project directory. If there are entities or occurrences as operations parameters, .xsd files are also generated,

  3. Deploy the web service.

    Note:  The following describes deployment into the Tomcat web server provided in the default Uniface installation. If you are using another web server, consult the web server documentation for instructions.

    1. Put the generated my_wsdlw.wsdl (and .xsd, if it is generated) in UnifaceAPSDir\uniface\webapps\uniface\WEB-INF\wsdl.

      If required, register the WSDLs on sites where you want your web services to be exposed.For example, use the Universal Description, Discovery, and Integration (UDDI), an XML-based worldwide business registry. UDDI provides a mechanism for describing a company and the services it offers, similar to the Yellow Pages provides for shoppers. The web services offered by the company can be registered in UDDI so the service can be located and used.

    2. Check the servlet SRD specification in the UnifaceAPSDir\uniface\webapps\uniface\WEB-INF\web.xml file. Find which UST is used by the Uniface Router. By default, it is wasv.
      <param-name>MIDDLEWARE</param-name>
      <param-value>UV8:machineName\userver|userver|wasv</param-value>
    3. From UnifaceAPSDir\common\adm\urouter.asn file, find the definition of this UST.

      For example, the following definition indicates that the MY_WS service should be deployed in the directory D:\Uniface.

      wasv = "D:\UnifaceAPS\common\bin\userver.exe" -dir="D:\Uniface" -asn=usysadm:wasv.asn

      If necessary for your deployment environment, create the UAR file to contain the compiled signature.

    4. Restart the web server and the Uniface Router to enable the changes to be applied.
  4. Test the web service.

    The simplest way to test it is using Uniface web service call-out functionality. You need to use the SOAP connector U2.0, because the binding style of my_wsdlw.wsdl is Document/Literal Wrapped. For more information, see Calling Web Services from Uniface.

Related Topics