WebSphere WebSphere Application Server Network Deployment, Version 6.0.x Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Including SOAP header schemas in the SDO repository

Why and when to perform this task

Mediations accessing SOAP headers should ensure that 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. Normally 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:
<soapenv:Header>
<hns0:myClientToken xmlns:hns0="http://www.ibm.com/wbc">
         		<UseRoutingId>true</ UseRoutingId >
         		<RoutingID>5</ RoutingID >
      	</hns0: myClientToken >
</soapenv:Header>
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, complete the following steps:

Steps for this task

  1. Create a Jacl script called sdoXSDImport.jacl that contains the following code:
    #
    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]]
    Note: 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:
    $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.
    wsadmin -f sdoXSDImport.jacl your_header.xsd your_header_namespace
    where
    • your_header.xsd is the name of the file that contains your header schema.
    • your_header_namespace is the target namespace for the header. For example http://yourCompany.com/yourNamespace.
Related concepts
Guidance for tuning mediations for performance
Related tasks
Learning about programming mediations

Task topic

Terms of Use | Feedback

Last updated: 15 Mar 2007
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.pmc.nd.doc\tasks\tjw_tune_xsd.html

© Copyright IBM Corporation 2004, 2007. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)