Defining a JAX-WS Web service on WebLogic

Procedure

  1. Set the properties necessary for your application server in sandbox.cfg:
    Parameter Description
    WEBSERVICES_BUILDS Required. Can take a comma separated list that can include YIFWebService and SIXBeanXapiJaxWS.
    XBEAN_PACKAGE Optional. By default, the xbean package names and namespace generated for JAX-WS web services include the word "documentation." Use this parameter to replace the word "documentation" with another string. This value can be any string which would form a valid java package name.
    Important: Regardless of how it is entered, Sterling Order Management System Software
    JAXB_LOCAL_SCOPING Required. Valid values are true/false. Set to true. This flag affects the way that JAXB generates beans. Everything becomes “toplevel” so all classes will exist in the default package rather than existing in a hierarchy. Typically, for Sterling Order Management System Software
    JAXB_ALWAYS_ANNOTATE_CLASSNAMES Required. The classes that are generated by JAXB are given “1-up” numbers at the end of their names to prevent having multiple classes with the same name when top level scoping is used.

    By default, this flag is included and set to true (yes, annotate all classes).

    If you prefer to minimize the use of one-up numbers, specify the AnnotateClassNames attribute in the webservicebeans.xml file for selected APIs, as shown in the following example.
    <Bean BeanName="ParticipantBean"  BeanPackage="com.sterlingcommerce.jaxws.participant. webservices" > <Apis> <Api AnnotateClassNames="true"  Name="getOrganizationHierarchy"  ExposedName="getOrganizationHierarchy" /> <Api AnnotateClassNames="true"  Name="getOrganizationList"  ExposedName="getOrganizationList" /> <Api AnnotateClassNames="false"  Name="getPersonInfoList"  ExposedName="getPersonInfoList" /> <Api AnnotateClassNames="false" Name="login"  ExposedName="login" /> </Apis> </Bean>
    SUPPRESS_JAXWS_HANDLERS

    By default, Sterling Order Management System Software

  2. If using a SUN or Oracle JDK, edit <INSTALL_DIR>/bin/build.properties.in to set the following property:

    jaxws.compiler.jvm.args=-J-XX:MaxPermSize=512m -J-Xmx768m

  3. Save the file, navigate to the bin directory, and run the setupfiles command:
    • For UNIX/Linux: <INSTALL_DIR>/bin/setupfiles.sh
    • For Windows: <INSTALL_DIR>\bin\setupfiles.cmd
  4. In the <INSTALL_DIR>/repository/eardata/platform/webservices folder, locate the webservicebeans.xml.sample file. Copy the file to webservicebeans.xml. This is the file you will edit.
    webservicebeans.xml attributes Description
    Bean attributes
    Note: Do not put the same API into two beans.
    BeanName Required. Enter a descriptive name for the web service. The first letter of the BeanName must be an uppercase letter.

    This name is used by the WSDL generator and reflected in the client code.

    For example, a company named "Dave's BBQ" might use the following:

    BeanName=DavesBBQJaxWS
    BeanPackage Required. Enter a descriptive name for the package. Each bean must have a unique package name. This name is used by the WSDL generator and reflected in the client code.

    For example, a company named "Dave's BBQ" might use the following:

    BeanPackage="com.DavesBBQ
    API element attributes
    Api Name The name of the API that you wish to expose.
    ExposedName The name that is used in the Web Services Description Language (WSDL) file. This is the name that is used to call the web service programmatically. When specifying a service name for ExposedName, choose a literal that does not match any of the standard application API names.

    The exposed name must start with a lower case letter.

    AnnotateClassNames Specify the AnnotateClassNames attribute on the webservicebeans.xml to indicate which APIs need to have annotations. This flag provides a more granular way of indicating that 1-up annotations are required for specific APIs as compared to the sandbox variable ALWAYS_ANNOTATE_CLASS_NAMES.
    Service element attributes
    Service Name The name of the service that you configured using the Service Builder.
    ExposedName The name that is used in the Web Services Description Language (WSDL) file. This is the name that is used to call the web service programmatically. When specifying a service name for ExposedName, choose a literal that does not match any of the standard application service names.

    The exposed name must start with a lower case letter.

    AnnotateClassName Specify the AnnotateClassNames attribute on the webservicebeans.xml to indicate which APIs need to have annotations.
    To expose an SDF service as a web service, you must also complete the procedure in Exposing an SDF service as a Web service on WebLogic.
  5. Save the file.
  6. Create the EAR as described in Creating the EAR on WebLogic. The web services defined in the file will be built when you create the application EAR.
    CAUTION:
    When building an ear with JAX-WS Web services, you may encounter out of memory errors. JAX-WS Web services will generate a java class for each element in the XSD, which can exceed the system memory. If the EAR build runs out of memory, then unnecessary APIs should be removed from the webservicebeans.xml file. Additionally, APIs with potentially large output XMLs may be exposed through services with reduced XSDs to eliminate unwanted elements.
    Tip: To a certain extent, the memory requirements for building JAX-WS beans is on a bean-by-bean basis. This means that in some cases, exposing a set of APIs through one JAX-WS bean can cause an out-of-memory error during the ear build. Exposing the same APIs by splitting them across multiple beans may prevent the out-of-memory error and enable the ear to build successfully.
  7. Later, if you want to add more APIs and services as JAX-WS web services, repeat these steps.