WAS v8.5 > Tune performance > Tune web services > Tune bus-enabled web services

Including SOAP header schemas in the SDO repository

Use this task to improve mediation performance by inserting the SOAP header schema into the SDO repository. Mediations accessing SOAP headers should ensure the SOAP header schema is made available to the SDO repository. This simplifies access to the header fields (see Web Services code example) and can provide a significant performance benefit. Usually the schema (.xsd file) for a SOAP header is already available to the application developer.

Here is an example of a header (used for routing) that is passed in the SOAP message:

Here is an example of an associated header schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           targetNamespace="http://www.ibm.com/wbc" 
           elementFormDefault="unqualified"> <xs:element name=" myClientToken">   <xs:complexType>     <xs:sequence>       <xs:element name="UseRoutingId" type="xs:string"/>       <xs:element name="RoutingID" type="xs:string"/>     </xs:sequence>   </xs:complexType> </xs:element> </xs:schema>

To insert the schema into the SDO repository...

  1. Create a script containing the following code:

    • For Jython, create a script called sdoXSDImport.py:
      #
      xsdFile=sys.argv[0]
      xsdKey=sys.argv[1]
      sdoRep=AdminControl.queryNames("*,type=SdoRepository,node=%s" % AdminControl.
      getNode)
      print AdminControl.invoke(sdoRep , importResource([xsdKey , xsdFile]))

    • For Jacl, create a script called sdoXSDImport.jacl:
      #
      set xsdFile [lindex $argv 0]
      set xsdKey  [lindex $argv 1]
      set sdoRep [$AdminControl queryNames *,type=SdoRepository,node=[$AdminControl
       getNode]]
      puts [$AdminControl invoke $sdoRep importResource [list $xsdKey $xsdFile]]

    To create an equivalent script for removing a resource from the SDO repository, take a copy of this script and modify the final line as follows:

    • Using Jython:

        AdminControl.invoke(sdoRep , "removeResource" , [[xsdKey , "false"]])
    • Jacl:

        $AdminControl invoke $sdoRep removeResource [list $xsdKey false]

  2. Use the wsadmin scripting client to insert the schema into the SDO repository by entering the following command.

    • To use the Jython script:

        wsadmin -lang jython -f sdoXSDImport.py your_header.xsd your_header_namespace
    • To use the Jacl script:

        wsadmin -f sdoXSDImport.jacl your_header.xsd your_header_namespace

    where

    • your_header.xsd is the name of the file containing your header schema.
    • your_header_namespace is the target namespace for the header. For example http://yourCompany.com/yourNamespace.


Related concepts:

Performance tuning for mediations
Mediation programming


+

Search Tips   |   Advanced Search