C Event Connector Samples

This appendix provides sample implementations for a SCOM 2012 event connector.

Example C-1 connectorDeploy.xml

<?xml version="1.0" encoding="UTF-8"?>
<ManagementConnector xmlns="http://xmlns.oracle.com/sysman/connector">
  <Name>SCOM 2012 Connector</Name>
  <Version>12.1.0.1.0</Version>
  <EMCompatibleVersion>12.1.0.1.0</EMCompatibleVersion>
  <Description>Microsoft System Center Operations Manager 2012 Integration with Enterprise Manager</Description>
  <Category>EventConnector</Category>
  <NewTargetType>
    <TargetTypeName>scom_managed_host</TargetTypeName>
    <TargetTypeDisplayName>SCOM Managed Host</TargetTypeDisplayName>
    <DefaultTargetName>generic_scom_managed_host</DefaultTargetName>
    <DefaultTargetDisplayName>Generic SCOM Managed Host</DefaultTargetDisplayName>
  </NewTargetType>
  <HTTPBasicAuthentication>
    <Username required="true">
      <VariableName>Username</VariableName>
      <DisplayName>SCOM Web Service Username</DisplayName>
    </Username>
    <Password required="true">
      <VariableName>Password</VariableName>
      <DisplayName>SCOM Web Service Password</DisplayName>
    </Password>
  </HTTPBasicAuthentication>
  <Service>
    <Method>setup</Method>
    <WebServiceEndpoint>
      <![CDATA[http://<host name>:8080/services/SCOM/SCOMService]]>
    </WebServiceEndpoint>
    <SOAPAction>setup</SOAPAction>
    <SOAPBindingType>SOAP11HTTP_BINDING</SOAPBindingType>
  </Service>
  <Service>
    <Method>initialize</Method>
    <WebServiceEndpoint>
      <![CDATA[http://<host name>:8080/services/SCOM/SCOMService]]>
    </WebServiceEndpoint>
    <SOAPAction>initialize</SOAPAction>
    <SOAPBindingType>SOAP11HTTP_BINDING</SOAPBindingType>
  </Service>
  <Service>
    <Method>createEvent</Method>
    <WebServiceEndpoint>
      <![CDATA[http://<host name>:8080/services/SCOM/EventService]]>
    </WebServiceEndpoint>
    <SOAPAction>createEvent</SOAPAction>
    <SOAPBindingType>SOAP11HTTP_BINDING</SOAPBindingType>
  </Service>
  <Service>
    <Method>updateEvent</Method>
    <WebServiceEndpoint>
      <![CDATA[http://<host name>:8080/services/SCOM/EventService]]>
    </WebServiceEndpoint>
    <SOAPAction>updateEvent</SOAPAction>
    <SOAPBindingType>SOAP11HTTP_BINDING</SOAPBindingType>
  </Service>
  <Service>
    <Method>uninitialize</Method>
    <WebServiceEndpoint>
      <![CDATA[http://<host name>:8080/services/SCOM/SCOMService]]>
    </WebServiceEndpoint>
    <SOAPAction>uninitialize</SOAPAction>
    <SOAPBindingType>SOAP11HTTP_BINDING</SOAPBindingType>
  </Service>
  <TemplateRegistration>
    <FileName>setup_request.xml</FileName>
    <InternalName>setup</InternalName>
    <TemplateName>Setup Request</TemplateName>
    <TemplateType>OutboundXML</TemplateType>
    <Description>This is the request xml file for the setup method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>setup_response.xsl</FileName>
    <InternalName>setup</InternalName>
    <TemplateName>Setup Response</TemplateName>
    <TemplateType>InboundXSL</TemplateType>
    <Description>This is the response xsl file for the setup method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>setup_request.xml</FileName>
    <InternalName>initialize</InternalName>
    <TemplateName>Initialize Request</TemplateName>
    <TemplateType>OutboundXML</TemplateType>
    <Description>This is the request xml file for the initialize method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>createEvent_request_2012.xsl</FileName>
    <InternalName>createEvent</InternalName>
    <TemplateName>Create Event Request</TemplateName>
    <TemplateType>OutboundXSL</TemplateType>
    <Description>This is the request xsl file for the createEvent method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>createEvent_response.xsl</FileName>
    <InternalName>createEvent</InternalName>
    <TemplateName>Create Event Response</TemplateName>
    <TemplateType>InboundXSL</TemplateType>
    <Description>This is the response xsl file for the createEvent method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>updateEvent_request_2012.xsl</FileName>
    <InternalName>updateEvent</InternalName>
    <TemplateName>Update Event Request</TemplateName>
    <TemplateType>OutboundXSL</TemplateType>
    <Description>This is the request xsl file for the updateEvent method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>updateEvent_response.xsl</FileName>
    <InternalName>updateEvent</InternalName>
    <TemplateName>Update Event Response</TemplateName>
    <TemplateType>InboundXSL</TemplateType>
    <Description>This is the response xsl file for the updateEvent method</Description>
  </TemplateRegistration>
  <TemplateRegistration>
    <FileName>cleanup_request.xml</FileName>
    <InternalName>uninitialize</InternalName>
    <TemplateName>Uninitialize Request</TemplateName>
    <TemplateType>OutboundXML</TemplateType>
    <Description>This is the request xml file for the uninitialize method</Description>
  </TemplateRegistration>
</ManagementConnector>

Example C-2 setup_request.xml

<?xml version="1.0" encoding="UTF-8" ?>
<register xmlns="http://oracle.com/services/adapter-framework"/>

Example C-3 setup_response.xsl

<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <xsl:template match="/">
    <SetupResponse xmlns="http://xmlns.oracle.com/sysman/connector">
      <ConnectorVariable>
        <VariableName>REGISTRATION_ID</VariableName> 
        <VariableValue>Dummy</VariableValue>
      </ConnectorVariable>
    </SetupResponse>
  </xsl:template>
 
</xsl:stylesheet>

Example C-4 cleanup_request.xml

<?xml version="1.0" encoding="UTF-8" ?>
<oracleaf:deregister xmlns:oracleaf="http://oracle.com/services/adapter-framework">
  <deleteSubscriptions>true</deleteSubscriptions>
</oracleaf:deregister>

Example C-5 createEvent_request_2012.xsl

<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:a="http://xmlns.oracle.com/sysman/connector">
 
  <xsl:variable name="pad"><xsl:text>                                                                                     </xsl:text></xsl:variable>
 
  <xsl:template match="a:EMEvent">
    <oracleaf:create xmlns:oracleaf="http://oracle.com/services/adapter-framework">
      <event>
        <xsl:variable name="newLine">
          <xsl:text>
</xsl:text>
        </xsl:variable>
 
        <!-- SCOM alert description variables -->
        <xsl:variable name="occurDate">
          <xsl:choose>
            <xsl:when test="normalize-space(a:SystemAttributes/a:OccurredDate) != ''">
              <xsl:value-of select="substring-before(translate(a:SystemAttributes/a:OccurredDate, 'T', ' '), '.')"/>
            </xsl:when>
            <xsl:otherwise>N/A</xsl:otherwise> 
          </xsl:choose>
        </xsl:variable>
 
        <xsl:variable name="reportDate">
          <xsl:choose>
            <xsl:when test="normalize-space(a:SystemAttributes/a:ReportedDate) != ''">
              <xsl:value-of select="substring-before(translate(a:SystemAttributes/a:ReportedDate, 'T', ' '), '.')"/>
            </xsl:when>
            <xsl:otherwise>N/A</xsl:otherwise> 
          </xsl:choose>
        </xsl:variable>
 
        <xsl:variable name="fmtOccurDate">Occurred Date: <xsl:value-of select="$occurDate"/></xsl:variable>
        <xsl:variable name="fmtReportDate">Reported Date: <xsl:value-of select="$reportDate"/></xsl:variable>
        <xsl:variable name="fmtEventClass">Event Class: <xsl:value-of select="a:SystemAttributes/a:EventClass"/></xsl:variable>
        <xsl:variable name="fmtEventName">Event Name: <xsl:value-of select="a:SystemAttributes/a:EventName"/></xsl:variable>
        <xsl:variable name="fmtTargetType">Target Type: <xsl:value-of select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetType"/></xsl:variable>
        <xsl:variable name="fmtTargetName">Target Name: <xsl:value-of select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetName"/></xsl:variable>
        <xsl:variable name="fmtSeverity">Severity: <xsl:value-of select="a:SystemAttributes/a:Severity"/></xsl:variable>
        <xsl:variable name="fmtMessage">Message: <xsl:value-of select="a:SystemAttributes/a:Message"/></xsl:variable>
        <xsl:variable name="fmtUrl">Event URL: <xsl:value-of select="a:SystemAttributes/a:EventURL"/></xsl:variable>
        <xsl:variable name="targetPropsHeader"><xsl:text>Target Properties:</xsl:text></xsl:variable>
        <xsl:variable name="contextHeader"><xsl:text>Event Context:</xsl:text></xsl:variable>
        
        <!-- SCOM alert description -->
        <description><xsl:text>Received event reported by Oracle Enterprise Manager:</xsl:text>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtOccurDate"/> 
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtReportDate"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtEventClass"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtEventName"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtTargetType"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtTargetName"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtSeverity"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtMessage"/>
          <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtUrl"/>
          
          <xsl:for-each select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetProperty">
            <xsl:if test="position() = 1">
              <xsl:value-of select="$newLine"/><xsl:value-of select="$newLine"/><xsl:value-of select="$targetPropsHeader"/>
            </xsl:if>
            <xsl:value-of select="$newLine"/><xsl:text>    </xsl:text><xsl:value-of select="./a:Name"/>: <xsl:value-of select="./a:Value"/>
          </xsl:for-each>
          <xsl:for-each select="a:EventContextAttributes">
            <xsl:if test="position() = 1">
              <xsl:value-of select="$newLine"/><xsl:value-of select="$newLine"/><xsl:value-of select="$contextHeader"/>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="a:StringAttribute">
                <xsl:value-of select="$newLine"/><xsl:text>    </xsl:text><xsl:value-of select="a:StringAttribute/a:Name" />: <xsl:value-of select="a:StringAttribute/a:Value" />
              </xsl:when>
              <xsl:when test="a:NumberAttribute">
                <xsl:value-of select="$newLine"/><xsl:text>    </xsl:text><xsl:value-of select="a:NumberAttribute/a:Name" />: <xsl:value-of select="a:NumberAttribute/a:Value" />
              </xsl:when>
            </xsl:choose>
          </xsl:for-each>
        </description>
        
        <!-- SCOM alert name -->
        <summary>
          <xsl:value-of select="a:SystemAttributes/a:EventName"/>
        </summary>
 
        <!-- SCOM alert severity -->
        <severity>
          <xsl:choose>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">Information</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'INFORMATIONAL'">Information</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'WARNING'">Warning</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'MINOR_WARNING'">Warning</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CRITICAL'">Error</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'FATAL'">Error</xsl:when>
            <xsl:otherwise>Error</xsl:otherwise>
          </xsl:choose>
        </severity>
 
        <!-- SCOM alert priority -->
        <priority>
          <xsl:choose>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">Low</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'INFORMATIONAL'">Low</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'WARNING'">Normal</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'MINOR_WARNING'">Normal</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CRITICAL'">High</xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'FATAL'">High</xsl:when>
            <xsl:otherwise>Normal</xsl:otherwise>
          </xsl:choose>
        </priority>
 
        <!-- SCOM history log variables -->
        <xsl:variable name="tab"><xsl:text>    </xsl:text></xsl:variable>
        <xsl:variable name="colon"><xsl:text>: </xsl:text></xsl:variable>
        
        <xsl:variable name="paddedMessage">
          <xsl:call-template name="dopad">
            <xsl:with-param name="pText" select="$fmtMessage"/>
          </xsl:call-template>
        </xsl:variable>
 
        <xsl:variable name="urlpadlen">
          <xsl:value-of select="(ceiling(string-length($fmtUrl) div 85)) * 85"/>
        </xsl:variable>
        
        <xsl:variable name="targetProps">
          <xsl:for-each select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetProperty">
            <xsl:if test="position() = 1">
              <xsl:value-of select="substring(concat($pad,$targetPropsHeader,$pad),1,170)"/>
            </xsl:if>
            <xsl:value-of select="substring(concat($tab,./a:Name,$colon,./a:Value,$pad),1,85)"/>
          </xsl:for-each>
        </xsl:variable>
        
        <xsl:variable name="contextAttr">
          <xsl:for-each select="a:EventContextAttributes">
            <xsl:if test="position() = 1">
              <xsl:value-of select="substring(concat($pad,$contextHeader,$pad),1,170)"/>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="a:StringAttribute">
                <xsl:value-of select="substring(concat($tab,a:StringAttribute/a:Name,$colon,a:StringAttribute/a:Value,$pad),1,85)"/>
              </xsl:when>
              <xsl:when test="a:NumberAttribute">
                <xsl:value-of select="substring(concat($tab,a:NumberAttribute/a:Name,$colon,a:NumberAttribute/a:Value,$pad),1,85)"/>
              </xsl:when>
            </xsl:choose>
          </xsl:for-each>
        </xsl:variable>
 
        <xsl:variable name="history">
          <xsl:value-of select="substring(concat('Oracle Enterprise Manager created an event with the following attributes:', $pad),1,85)"/>
          <xsl:value-of select="$paddedMessage"/>
          <xsl:value-of select="substring(concat($fmtSeverity,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtReportDate,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtOccurDate,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtTargetName,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtTargetType,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtEventClass,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtEventName,$pad),1,85)"/>
          <xsl:value-of select="substring(concat($fmtUrl,$pad),1,$urlpadlen)"/>
          <xsl:value-of select="$targetProps"/>
          <xsl:value-of select="$contextAttr"/>
        </xsl:variable>
 
        <!-- SCOM history log information -->
        <logs>
          <log>
            <description><xsl:value-of select="$history"/></description>
          </log>
        </logs>
 
        <extended-fields>
          <!-- SCOM alert custom fields -->
          <!-- Uncomment fields to be set and replace "VALUE" with the actual value -->
          <!--
          <string-field name="CustomField1">VALUE</string-field>
          <string-field name="CustomField2">VALUE</string-field>
          <string-field name="CustomField3">VALUE</string-field>
          <string-field name="CustomField4">VALUE</string-field>
          <string-field name="CustomField5">VALUE</string-field>
          <string-field name="CustomField6">VALUE</string-field>
          <string-field name="CustomField7">VALUE</string-field>
          <string-field name="CustomField8">VALUE</string-field>
          <string-field name="CustomField9">VALUE</string-field>
          <string-field name="CustomField10">VALUE</string-field>
          -->
        </extended-fields>
      </event>
    </oracleaf:create>
  </xsl:template>
 
  <xsl:template name="dopad">
    <xsl:param name="pText"/>
    <xsl:param name="pDelim" select="' '"/>
    
    <xsl:if test="string-length($pText) &gt; 0">
      <xsl:variable name="str" select="substring($pText,1,85)"/>
      <xsl:variable name="line">
        <xsl:choose>
          <xsl:when test="contains($str,' ')">
            <xsl:call-template name="splitLine">
              <xsl:with-param name="pText" select="$str"/>
              <xsl:with-param name="pDelim" select="$pDelim"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$str"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      
      <xsl:value-of select="substring(concat($line,$pad),1,85)"/>
      <xsl:variable name="remstr">
        <xsl:value-of select="substring($pText,string-length($line)+1)"/>
      </xsl:variable>
      <xsl:call-template name="dopad">
        <xsl:with-param name="pText" select="$remstr"/>
        <xsl:with-param name="pDelim" select="$pDelim"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="splitLine">
    <xsl:param name="pText"/>
    <xsl:param name="pDelim" select="' '"/>
    
    <xsl:if test="contains($pText, $pDelim)">
      <xsl:value-of select="substring-before($pText, $pDelim)"/>
      <xsl:text> </xsl:text>
      <xsl:call-template name="splitLine">
        <xsl:with-param name="pText" select="substring-after($pText, $pDelim)"/>
        <xsl:with-param name="pDelim" select="$pDelim"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
</xsl:stylesheet>

Example C-6 createEvent_response.xsl

<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oracleaf="http://oracle.com/services/adapter-framework"
    xmlns:a="http://xmlns.oracle.com/sysman/connector">
 
  <xsl:template match="oracleaf:createResponse/return">
    <a:EMEventResponse>
      <xsl:choose>
        <xsl:when test="identifier">
          <a:SuccessFlag>true</a:SuccessFlag>
          <a:ExternalEventId>
            <xsl:value-of select="identifier"/>
          </a:ExternalEventId>
        </xsl:when>
        <xsl:otherwise>
          <a:SuccessFlag>false</a:SuccessFlag>
          <a:ErrorMessage>Request to create an event in SCOM failed</a:ErrorMessage>
        </xsl:otherwise>
      </xsl:choose>
    </a:EMEventResponse>
  </xsl:template>
 
</xsl:stylesheet>

Example C-7 updateEvent_request_2012.xsl

<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:a="http://xmlns.oracle.com/sysman/connector">
 
  <xsl:variable name="pad"><xsl:text>                                                                                </xsl:text></xsl:variable>
  
  <xsl:template match="a:EMEvent">
    <oracleaf:update xmlns:oracleaf="http://oracle.com/services/adapter-framework">
      <event>
 
        <!-- SCOM alert GUID to update -->
        <identifier>
          <xsl:value-of select="a:ExternalEventID"></xsl:value-of>
        </identifier>
 
        <!-- SCOM alert resolution state -->
        <status>
          <xsl:choose>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">255</xsl:when>
            <xsl:otherwise>0</xsl:otherwise>
          </xsl:choose>
        </status>
 
        <!-- SCOM history log variables -->
        <xsl:variable name="reportDate">
          <xsl:choose>
            <xsl:when test="normalize-space(a:SystemAttributes/a:ReportedDate) != ''">
              <xsl:value-of select="substring-before(translate(a:SystemAttributes/a:ReportedDate, 'T', ' '), '.')"/>
            </xsl:when>
            <xsl:otherwise>N/A</xsl:otherwise> 
          </xsl:choose>
        </xsl:variable>
        
        <xsl:variable name="_title">
          <xsl:choose>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">Oracle Enterprise Manager cleared event<xsl:value-of select="$pad"/></xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'WARNING'">Oracle Enterprise Manager changed event severity to Warning<xsl:value-of select="$pad"/></xsl:when>
            <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CRITICAL'">Oracle Enterprise Manager changed event severity to Critical<xsl:value-of select="$pad"/></xsl:when>
            </xsl:choose>
        </xsl:variable>
        <xsl:variable name="_reportDate">Reported Date: <xsl:value-of select="$reportDate"/><xsl:value-of select="$pad"/></xsl:variable>
        <xsl:variable name="_severity">Severity: <xsl:value-of select="a:SystemAttributes/a:Severity"/><xsl:value-of select="$pad"/></xsl:variable>
        <xsl:variable name="_message">Message: <xsl:value-of select="a:SystemAttributes/a:Message"/></xsl:variable>
 
        <xsl:variable name="paddedMessage">
          <xsl:call-template name="dopad">
            <xsl:with-param name="pText" select="$_message"/>
          </xsl:call-template>
        </xsl:variable>
        
        <xsl:variable name="_history">
          <xsl:value-of select="substring($_title,1,85)"/>
          <xsl:value-of select="substring($_reportDate,1,85)"/>
          <xsl:value-of select="$paddedMessage"/>
          <xsl:value-of select="substring($_severity,1,85)"/>
        </xsl:variable>
 
        <!-- SCOM history log information -->
        <logs>
          <log>
            <description><xsl:value-of select="$_history"/></description>
          </log>
        </logs>
 
        <extended-fields>
          <!-- SCOM alert custom fields -->
          <!-- Uncomment fields to be set and replace "VALUE" with the actual value -->
          <!--
          <string-field name="CustomField1">VALUE</string-field>
          <string-field name="CustomField2">VALUE</string-field>
          <string-field name="CustomField3">VALUE</string-field>
          <string-field name="CustomField4">VALUE</string-field>
          <string-field name="CustomField5">VALUE</string-field>
          <string-field name="CustomField6">VALUE</string-field>
          <string-field name="CustomField7">VALUE</string-field>
          <string-field name="CustomField8">VALUE</string-field>
          <string-field name="CustomField9">VALUE</string-field>
          <string-field name="CustomField10">VALUE</string-field>
          -->
        </extended-fields>
      </event>
    </oracleaf:update>
  </xsl:template>
 
  <xsl:template name="dopad">
    <xsl:param name="pText"/>
    <xsl:param name="pDelim" select="' '"/>
    
    <xsl:if test="string-length($pText) &gt; 0">
      <xsl:variable name="str" select="substring($pText,1,85)"/>
      <xsl:variable name="line">
        <xsl:choose>
          <xsl:when test="contains($str,' ')">
            <xsl:call-template name="splitLine">
              <xsl:with-param name="pText" select="$str"/>
              <xsl:with-param name="pDelim" select="$pDelim"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$str"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      
      <xsl:value-of select="substring(concat($line,$pad),1,85)"/>
      <xsl:variable name="remstr">
        <xsl:value-of select="substring($pText,string-length($line)+1)"/>
      </xsl:variable>
      <xsl:call-template name="dopad">
        <xsl:with-param name="pText" select="$remstr"/>
        <xsl:with-param name="pDelim" select="$pDelim"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="splitLine">
    <xsl:param name="pText"/>
    <xsl:param name="pDelim" select="' '"/>
    
    <xsl:if test="contains($pText, $pDelim)">
      <xsl:value-of select="substring-before($pText, $pDelim)"/>
      <xsl:text> </xsl:text>
      <xsl:call-template name="splitLine">
        <xsl:with-param name="pText" select="substring-after($pText, $pDelim)"/>
        <xsl:with-param name="pDelim" select="$pDelim"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
</xsl:stylesheet>

Example C-8 updateEvent_request_2012_alt.xsl

<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:a="http://xmlns.oracle.com/sysman/connector">
 
  <xsl:variable name="pad"><xsl:text>                                                                                     </xsl:text></xsl:variable>
  <xsl:variable name="syncHistory">true</xsl:variable>
  
  <xsl:template match="a:EMEvent">
    <xsl:choose>
      <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">
        <!-- The event has been cleared. Close the alert in SCOM -->
        <oracleaf:update xmlns:oracleaf="http://oracle.com/services/adapter-framework">
          <event>
            
            <!-- SCOM alert GUID to update -->
            <identifier>
              <xsl:value-of select="a:ExternalEventID"></xsl:value-of>
            </identifier>
            
            <!-- SCOM alert resolution state -->
            <status>255</status>
 
            <!-- SCOM history log information -->
            <logs>
              <log>
                <description>Oracle Enterprise Manager cleared alert</description>
              </log>
            </logs>
            
            <extended-fields>
              <string-field name="CloseAssociatedAlerts"><xsl:value-of select="a:ExternalEventID"></xsl:value-of></string-field>
              
              <!-- SCOM alert custom fields -->
              <!-- Uncomment fields to be set and replace "VALUE" with the actual value -->
              <!--
                <string-field name="CustomField1">VALUE</string-field>
                <string-field name="CustomField2">VALUE</string-field>
                <string-field name="CustomField3">VALUE</string-field>
                <string-field name="CustomField4">VALUE</string-field>
                <string-field name="CustomField5">VALUE</string-field>
                <string-field name="CustomField6">VALUE</string-field>
                <string-field name="CustomField7">VALUE</string-field>
                <string-field name="CustomField8">VALUE</string-field>
                <string-field name="CustomField9">VALUE</string-field>
                <string-field name="CustomField10">VALUE</string-field>
              -->
            </extended-fields>
          </event>
        </oracleaf:update>
      </xsl:when>
 
      <xsl:otherwise>
        <oracleaf:create xmlns:oracleaf="http://oracle.com/services/adapter-framework">
          <event>
            <xsl:variable name="newLine">
              <xsl:text>
</xsl:text>
            </xsl:variable>
 
            <!-- SCOM alert description variables -->
            <xsl:variable name="occurDate">
              <xsl:choose>
                <xsl:when test="normalize-space(a:SystemAttributes/a:OccurredDate) != ''">
                  <xsl:value-of select="substring-before(translate(a:SystemAttributes/a:OccurredDate, 'T', ' '), '.')"/>
                </xsl:when>
                <xsl:otherwise>N/A</xsl:otherwise> 
              </xsl:choose>
            </xsl:variable>
 
            <xsl:variable name="reportDate">
              <xsl:choose>
                <xsl:when test="normalize-space(a:SystemAttributes/a:ReportedDate) != ''">
                  <xsl:value-of select="substring-before(translate(a:SystemAttributes/a:ReportedDate, 'T', ' '), '.')"/>
                </xsl:when>
                <xsl:otherwise>N/A</xsl:otherwise> 
              </xsl:choose>
            </xsl:variable>
 
            <xsl:variable name="fmtOccurDate">Occurred Date: <xsl:value-of select="$occurDate"/></xsl:variable>
            <xsl:variable name="fmtReportDate">Reported Date: <xsl:value-of select="$reportDate"/></xsl:variable>
            <xsl:variable name="fmtEventClass">Event Class: <xsl:value-of select="a:SystemAttributes/a:EventClass"/></xsl:variable>
            <xsl:variable name="fmtEventName">Event Name: <xsl:value-of select="a:SystemAttributes/a:EventName"/></xsl:variable>
            <xsl:variable name="fmtTargetType">Target Type: <xsl:value-of select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetType"/></xsl:variable>
            <xsl:variable name="fmtTargetName">Target Name: <xsl:value-of select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetName"/></xsl:variable>
            <xsl:variable name="fmtSeverity">Severity: <xsl:value-of select="a:SystemAttributes/a:Severity"/></xsl:variable>
            <xsl:variable name="fmtMessage">Message: <xsl:value-of select="a:SystemAttributes/a:Message"/></xsl:variable>
            <xsl:variable name="fmtUrl">Event URL: <xsl:value-of select="a:SystemAttributes/a:EventURL"/></xsl:variable>
            <xsl:variable name="targetPropsHeader"><xsl:text>Target Properties:</xsl:text></xsl:variable>
            <xsl:variable name="contextHeader"><xsl:text>Event Context:</xsl:text></xsl:variable>
            
            <!-- SCOM alert description -->
            <description><xsl:text>Received event reported by Oracle Enterprise Manager:</xsl:text>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtOccurDate"/> 
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtReportDate"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtEventClass"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtEventName"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtTargetType"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtTargetName"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtSeverity"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtMessage"/>
              <xsl:value-of select="$newLine"/><xsl:value-of select="$fmtUrl"/>
              
              <xsl:for-each select="a:SystemAttributes/a:SourceInfo/a:TargetInfo/a:TargetProperty">
                <xsl:if test="position() = 1">
                  <xsl:value-of select="$newLine"/><xsl:value-of select="$newLine"/><xsl:value-of select="$targetPropsHeader"/>
                </xsl:if>
                <xsl:value-of select="$newLine"/><xsl:text>    </xsl:text><xsl:value-of select="./a:Name"/>: <xsl:value-of select="./a:Value"/>
              </xsl:for-each>
              <xsl:for-each select="a:EventContextAttributes">
                <xsl:if test="position() = 1">
                  <xsl:value-of select="$newLine"/><xsl:value-of select="$newLine"/><xsl:value-of select="$contextHeader"/>
                </xsl:if>
                <xsl:choose>
                  <xsl:when test="a:StringAttribute">
                    <xsl:value-of select="$newLine"/><xsl:text>    </xsl:text><xsl:value-of select="a:StringAttribute/a:Name" />: <xsl:value-of select="a:StringAttribute/a:Value" />
                  </xsl:when>
                  <xsl:when test="a:NumberAttribute">
                    <xsl:value-of select="$newLine"/><xsl:text>    </xsl:text><xsl:value-of select="a:NumberAttribute/a:Name" />: <xsl:value-of select="a:NumberAttribute/a:Value" />
                  </xsl:when>
                </xsl:choose>
              </xsl:for-each>
            </description>
            
            <!-- SCOM alert name -->
            <summary>
              <xsl:value-of select="a:SystemAttributes/a:EventName"/>
            </summary>
 
            <!-- SCOM alert severity -->
            <severity>
              <xsl:choose>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">Information</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'INFORMATIONAL'">Information</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'WARNING'">Warning</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'MINOR_WARNING'">Warning</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CRITICAL'">Error</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'FATAL'">Error</xsl:when>
                <xsl:otherwise>Error</xsl:otherwise>
              </xsl:choose>
            </severity>
 
            <!-- SCOM alert priority -->
            <priority>
              <xsl:choose>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">Low</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'INFORMATIONAL'">Low</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'WARNING'">Normal</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'MINOR_WARNING'">Normal</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CRITICAL'">High</xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'FATAL'">High</xsl:when>
                <xsl:otherwise>Normal</xsl:otherwise>
              </xsl:choose>
            </priority>
 
            <!-- SCOM history log variables -->
            <xsl:variable name="tab"><xsl:text>    </xsl:text></xsl:variable>
            <xsl:variable name="colon"><xsl:text>: </xsl:text></xsl:variable>
            
            <xsl:variable name="paddedMessage">
              <xsl:call-template name="dopad">
                <xsl:with-param name="pText" select="$fmtMessage"/>
              </xsl:call-template>
            </xsl:variable>
 
            <xsl:variable name="histTitle">
              <xsl:choose>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CLEAR'">Oracle Enterprise Manager cleared event<xsl:value-of select="$pad"/></xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'WARNING'">Oracle Enterprise Manager changed event severity to Warning<xsl:value-of select="$pad"/></xsl:when>
                <xsl:when test="a:SystemAttributes/a:SeverityCode = 'CRITICAL'">Oracle Enterprise Manager changed event severity to Critical<xsl:value-of select="$pad"/></xsl:when>
                </xsl:choose>
            </xsl:variable>
 
            <xsl:variable name="history">
              <xsl:value-of select="substring($histTitle,1,85)"/>
              <xsl:value-of select="substring(concat($fmtReportDate,$pad),1,85)"/>
              <xsl:value-of select="$paddedMessage"/>
              <xsl:value-of select="substring(concat($fmtSeverity,$pad),1,85)"/>
            </xsl:variable>
 
            <!-- SCOM history log information -->
            <logs>
              <log>
                <description><xsl:value-of select="$history"/></description>
              </log>
            </logs>
 
            <extended-fields>
              <string-field name="AssociateOriginalAlert"><xsl:value-of select="a:ExternalEventID"></xsl:value-of></string-field>
              <string-field name="SyncWithOriginalAlert"><xsl:value-of select="$syncHistory"></xsl:value-of></string-field>
 
              <!-- SCOM alert custom fields -->
              <!-- Uncomment fields to be set and replace "VALUE" with the actual value -->
              <!--
              <string-field name="CustomField1">VALUE</string-field>
              <string-field name="CustomField2">VALUE</string-field>
              <string-field name="CustomField3">VALUE</string-field>
              <string-field name="CustomField4">VALUE</string-field>
              <string-field name="CustomField5">VALUE</string-field>
              <string-field name="CustomField6">VALUE</string-field>
              <string-field name="CustomField7">VALUE</string-field>
              <string-field name="CustomField8">VALUE</string-field>
              <string-field name="CustomField9">VALUE</string-field>
              <string-field name="CustomField10">VALUE</string-field>
              -->
            </extended-fields>
          </event>
        </oracleaf:create>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
  <xsl:template name="dopad">
    <xsl:param name="pText"/>
    <xsl:param name="pDelim" select="' '"/>
    
    <xsl:if test="string-length($pText) &gt; 0">
      <xsl:variable name="str" select="substring($pText,1,85)"/>
      <xsl:variable name="line">
        <xsl:choose>
          <xsl:when test="contains($str,' ')">
            <xsl:call-template name="splitLine">
              <xsl:with-param name="pText" select="$str"/>
              <xsl:with-param name="pDelim" select="$pDelim"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$str"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      
      <xsl:value-of select="substring(concat($line,$pad),1,85)"/>
      <xsl:variable name="remstr">
        <xsl:value-of select="substring($pText,string-length($line)+1)"/>
      </xsl:variable>
      <xsl:call-template name="dopad">
        <xsl:with-param name="pText" select="$remstr"/>
        <xsl:with-param name="pDelim" select="$pDelim"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="splitLine">
    <xsl:param name="pText"/>
    <xsl:param name="pDelim" select="' '"/>
    
    <xsl:if test="contains($pText, $pDelim)">
      <xsl:value-of select="substring-before($pText, $pDelim)"/>
      <xsl:text> </xsl:text>
      <xsl:call-template name="splitLine">
        <xsl:with-param name="pText" select="substring-after($pText, $pDelim)"/>
        <xsl:with-param name="pDelim" select="$pDelim"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
 
</xsl:stylesheet>

Example C-9 updateEvent_response.xsl

<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:oracleaf="http://oracle.com/services/adapter-framework"
    xmlns:a="http://xmlns.oracle.com/sysman/connector">
 
  <xsl:template match="//return">
 
    <a:EMEventResponse>
      <xsl:choose>
        <xsl:when test="identifier">
          <a:SuccessFlag>true</a:SuccessFlag>
          <a:ExternalEventId>
            <xsl:value-of select="identifier"/>
          </a:ExternalEventId>
        </xsl:when>
        <xsl:otherwise>
          <a:SuccessFlag>false</a:SuccessFlag>
          <a:ErrorMessage>Request to update an event in SCOM failed</a:ErrorMessage>
        </xsl:otherwise>
      </xsl:choose>
    </a:EMEventResponse>
 
  </xsl:template>
 
</xsl:stylesheet>

Example C-10 connectorDeploy.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  <xsd:include schemaLocation="connectorCommon.xsd"/>
  <xsd:element name="ManagementConnector">
    <xsd:annotation>
      <xsd:documentation>Deployment Descriptor for Management Connectors</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Name" type="StringT64">                    
          <xsd:annotation>
              <xsd:documentation>
                The name of the connector type.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
        <xsd:element name="Version" type="VersionT">                    
          <xsd:annotation>
              <xsd:documentation>
                Version of the connector type.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
        <xsd:element name="EMCompatibleVersion" type="VersionT">                    
          <xsd:annotation>
              <xsd:documentation>
                The EM compabilitity version of the connector type.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
        <xsd:element name="Description" type="StringT256">                    
          <xsd:annotation>
              <xsd:documentation>
                The description of the connector type.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
        <xsd:element name="Category">                    
          <xsd:annotation>
              <xsd:documentation>
                The category of the connector type. It must be one of the three 
                values listed next.
              </xsd:documentation>
          </xsd:annotation>                     
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="EventConnector"/>
              <xsd:enumeration value="TicketingConnector"/>
              <xsd:enumeration value="ChangeManagementConnector"/>
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <!-- NewTargetType is for EventConnector only. -->
        <xsd:element name="NewTargetType" minOccurs="0">
          <xsd:annotation>
              <xsd:documentation>
                New target type definition for event connectors. This target type 
                will be registered with Enterprise Manager and target instances can 
                be created subsequently, including a default target. These targets
                are used to accommodate external events.
              </xsd:documentation>
          </xsd:annotation>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="TargetTypeName" type="StringStrictT64">                    
                <xsd:annotation>
                    <xsd:documentation>
                      The name of the target type.
                    </xsd:documentation>
                </xsd:annotation>                     
              </xsd:element>
              <xsd:element name="TargetTypeDisplayName" type="StringT128">                    
                <xsd:annotation>
                    <xsd:documentation>
                      The name of the target type, as shown on UI.
                    </xsd:documentation>
                </xsd:annotation>                     
              </xsd:element>
              <xsd:element name="DefaultTargetName" type="StringStrictT256">                    
                <xsd:annotation>
                    <xsd:documentation>
                      The name of the default target of the target type. The default 
                      target will be used as a generic bucket to hold external events.
                    </xsd:documentation>
                </xsd:annotation>                     
              </xsd:element>
              <xsd:element name="DefaultTargetDisplayName" type="StringT256">                    
                <xsd:annotation>
                    <xsd:documentation>
                      The name of the default target of the target type, to be displayed
                       on UI.
                    </xsd:documentation>
                </xsd:annotation>                     
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="SOAPHeaderAuthentication"
                     type="SOAPHeaderAuthenticationType" minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                Specification for SOAP Header authentication.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>             
        <xsd:element name="HTTPBasicAuthentication"
                     type="UsernamePasswordAuthenticationType" minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                Specification for HTTP basic authentication.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element> 
        <xsd:element name="UserNameTokenAuthentication"
                     type="UsernamePasswordAuthenticationType" minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                Specification for Username Token authentication.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>    
        <xsd:element name="ConfigVariable" type="ConfigVariableType"
                     minOccurs="0" maxOccurs="20">                    
          <xsd:annotation>
              <xsd:documentation>
                The vaiables used during connector configuration. These variables 
                are required by external system to complete connector configuration, 
                which includes regitering with the external system. For instance, 
                one configuration variable can be the resolution state required by 
                Microsoft Operation Manager.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>    
        <xsd:element name="ConnectivityTestVariable" type="ConfigVariableType"
                     minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                An optional variable used to test connection to an external server.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>    
        <xsd:element name="Service" type="ServiceType" maxOccurs="20">                    
          <xsd:annotation>
              <xsd:documentation>
                Specification for web services, which define how connector framework 
                can communicate with external system.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>    
        <xsd:element name="ExternalURL" type="ExternalURLType" minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                Secification for the URL link to the external server, including 
                the URL pattern and server specific variables. It is used to provide links 
                to external server for viewing ticket details.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>    
        <xsd:element name="TemplateRegistration" type="TemplateRegistrationType"
                     minOccurs="0" maxOccurs="50">                    
          <xsd:annotation>
              <xsd:documentation>
                Specification for template registration. A template is registered 
                based on the information provided in the element. A connector deployment 
                descriptor can have an optional list of upto 50 template registratin 
                elements.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>    
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="ServiceType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complext type for a web service. 
        </xsd:documentation>
    </xsd:annotation>                     
    <xsd:sequence>
      <xsd:element name="Method">
          <xsd:annotation>
              <xsd:documentation>
                The name of the web service method. Each connector category has a 
                predefined set of methods as defined next.
              </xsd:documentation>
          </xsd:annotation>       
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <!-- event connector: -->
            <xsd:enumeration value="setup"/>
            <xsd:enumeration value="initialize"/>
            <xsd:enumeration value="getNewAlerts"/>
            <xsd:enumeration value="getUpdatedAlerts"/>
            <xsd:enumeration value="acknowledgeAlerts"/>
            <xsd:enumeration value="updateAlerts"/>
            <xsd:enumeration value="createEvent"/>
            <xsd:enumeration value="updateEvent"/>
            <xsd:enumeration value="uninitialize"/>
            <xsd:enumeration value="cleanup"/>
            <!-- ticketing connector: -->
            <xsd:enumeration value="createTicket"/>
            <xsd:enumeration value="updateTicket"/>
            <xsd:enumeration value="getTicket"/>
            <!-- change management connector: -->
            <xsd:enumeration value="publishCS"/>
            <xsd:enumeration value="updateChangeRequest"/>
            <xsd:enumeration value="getChangeRequest"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name="WebServiceEndpoint" type="StringT256">                    
          <xsd:annotation>
              <xsd:documentation>
                The web service end point indicating a specific location for accessing 
                a service. 
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
      <xsd:element name="SOAPAction" type="StringT64" minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                The SOAP action which carries out the web service call for the method.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
      <xsd:element name="SOAPBindingType" minOccurs="0">                    
          <xsd:annotation>
              <xsd:documentation>
                The type of SOAP over HTTP binding. Choose from one of the four 
                options defined next.
              </xsd:documentation>
          </xsd:annotation> 
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="SOAP11HTTP_BINDING"/>
            <xsd:enumeration value="SOAP12HTTP_BINDING"/>
            <xsd:enumeration value="SOAP11HTTP_MTOM_BINDING"/>
            <xsd:enumeration value="SOAP12HTTP_MTOM_BINDING"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="SOAPHeaderAuthenticationType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complext type for SOAP Header Authentication.
        </xsd:documentation>
    </xsd:annotation>                     
    <xsd:sequence>
      <xsd:element name="Username" type="ConfigVariableType">                    
        <xsd:annotation>
            <xsd:documentation>
              The username of the authentication.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
      <xsd:element name="Password" type="ConfigVariableType">                    
        <xsd:annotation>
            <xsd:documentation>
              The password of the authentication.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
      <xsd:element name="AuthVariable" type="ConfigVariableType" minOccurs="0"
                   maxOccurs="20">                    
        <xsd:annotation>
            <xsd:documentation>
              An optional list of extra authentication variables besides username 
              and password.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element> 
      <xsd:element name="SOAPHeader" type="StringT256">                    
        <xsd:annotation>
            <xsd:documentation>
              A SOAP header string serving as template for the SOAP header. It is 
              to be updated with user inputs for variables defined above and 
              bound with a HTTP request.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="UsernamePasswordAuthenticationType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complext type for Username Password authentication.
        </xsd:documentation>
    </xsd:annotation>                     
    <xsd:sequence>
      <xsd:element name="Username" type="ConfigVariableType">                    
        <xsd:annotation>
            <xsd:documentation>
              The username of the authentication.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
      <xsd:element name="Password" type="ConfigVariableType">                    
        <xsd:annotation>
            <xsd:documentation>
              The password of the authentication.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="ConfigVariableType">                    
    <xsd:annotation>
        <xsd:documentation>
          This seciton defines a complext type for configuration variables.
        </xsd:documentation>
    </xsd:annotation>                     
    <xsd:sequence>
      <xsd:element name="VariableName" type="StringStrictT32">                    
        <xsd:annotation>
            <xsd:documentation>
              Name of the variable.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
      <xsd:element name="DisplayName" type="StringT64">                    
        <xsd:annotation>
            <xsd:documentation>
              Name of the variable used for display on UI.
            </xsd:documentation>
        </xsd:annotation>                     
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="required" type="xsd:boolean" default="false">                    
      <xsd:annotation>
          <xsd:documentation>
            A Flag indicating whether or not the variable is mandatory.
          </xsd:documentation>
      </xsd:annotation>                     
    </xsd:attribute>
  </xsd:complexType>
  <xsd:complexType name="ExternalURLType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for external URL.
        </xsd:documentation>
    </xsd:annotation>                     
    <xsd:sequence>
      <xsd:element name="Pattern" type="StringT256">                    
          <xsd:annotation>
              <xsd:documentation>
                The URL pattern used to format links to the external server.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element> 
      <xsd:element name="ConfigVariable" type="ConfigVariableType" minOccurs="0"
                   maxOccurs="50">
          <xsd:annotation>
              <xsd:documentation>
                An optional list of configuration variablees representing the details 
                of the external server. They are used for constructing links to 
                the server based on the URL pattern.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element> 
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="TemplateRegistrationType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for template registration metadata 
          which is used to register templates during connector deployment.
        </xsd:documentation>
    </xsd:annotation>                     
    <xsd:sequence>
      <xsd:element name="FileName" type="StringT256">                    
          <xsd:annotation>
              <xsd:documentation>
                The template file name.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element> 
      <xsd:element name="InternalName" type="StringStrictT128">                    
          <xsd:annotation>
              <xsd:documentation>
                A name representing the template in the connector framework.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element> 
      <xsd:element name="TemplateName" type="StringStrictT128">                    
          <xsd:annotation>
              <xsd:documentation>
                The template display name to be used on UI.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element>
      <xsd:element name="TemplateType">                    
          <xsd:annotation>
              <xsd:documentation>
                The template type as one of the three options defined next.
              </xsd:documentation>
          </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="InboundXSL"/>
            <xsd:enumeration value="OutboundXSL"/>
            <xsd:enumeration value="OutboundXML"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name="Description" type="StringT512">  
          <xsd:annotation>
              <xsd:documentation>
                A description of the template.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

Example C-11 EMEvent.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
   <xsd:include schemaLocation="connectorCommon.xsd"/>
   <xsd:element name="EMEvent">                    
      <xsd:annotation>
          <xsd:documentation>
            This section defines an EM event made available through the connector 
            framework.
          </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="ConnectorGUID" type="xsd:string">                    
              <xsd:annotation>
                  <xsd:documentation>
                    A unique ID to identify the connector used to forward 
                    the EM event to the targeted external event system.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="ExternalEventID" type="xsd:string"
                         minOccurs="0">                    
              <xsd:annotation>
                  <xsd:documentation>
                    The ID to identify the event created in the external event system. 
                    It is generated in the external system and used to update 
                    the external event.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="NotificationRuleOwner" type="xsd:string">                    
              <xsd:annotation>
                  <xsd:documentation>
                    The owner of the notification rule which delivers the event.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="NotificationRuleName" type="xsd:string">                    
              <xsd:annotation>
                  <xsd:documentation>
                    The name of the notification rule which delievers the event.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="ConnectorVariable" type="VariableType"
                         minOccurs="0" maxOccurs="50">                    
              <xsd:annotation>
                  <xsd:documentation>
                    An optional list of up ro 50 connector variables that contain 
                    name/value pairs. They correspond to the ConfigVariable defined 
                    in connectorDeploy.xsd.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="Property" type="PropertyType" minOccurs="0"
                         maxOccurs="50">                    
              <xsd:annotation>
                  <xsd:documentation>
                    An optinal list of up to 50 property variables as defined in 
                    connectorCommon.xsd.  
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="SystemAttributes"
                         type="EventSystemAttributesType">                    
              <xsd:annotation>
                  <xsd:documentation>
                    A list of attributes for events as defined by EM event system.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="EventClassSpecificAttributes">                    
              <xsd:annotation>
                  <xsd:documentation>
                    A list of attributes for events that are specific to the event 
                    class. 
                  </xsd:documentation>
              </xsd:annotation>
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:choice minOccurs="0" maxOccurs="200">
                     <xsd:element name="StringAttribute" type="StringValueType">                    
                      <xsd:annotation>
                          <xsd:documentation>
                            A String attribute.
                          </xsd:documentation>
                      </xsd:annotation>
                    </xsd:element>
                     <xsd:element name="NumberAttribute" type="StringValueType">                    
                    <xsd:annotation>
                        <xsd:documentation>
                          A Number attribute.
                        </xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                     <xsd:element name="RawAttribute" type="StringValueType">                    
                        <xsd:annotation>
                            <xsd:documentation>
                              An attribute of type Raw.
                            </xsd:documentation>
                        </xsd:annotation>
                      </xsd:element>
                     <xsd:element name="DateAttribute" type="DateValueType">                    
                        <xsd:annotation>
                            <xsd:documentation>
                              An attribute of type Date.
                            </xsd:documentation>
                        </xsd:annotation>
                      </xsd:element>
                     </xsd:choice>
                  </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
            <xsd:element name="EventContextAttributes">                    
              <xsd:annotation>
                  <xsd:documentation>
                    A list of contextual attributes that is captured by the source system at 
                    the point of event generation that could be useful for diagnosis.
                  </xsd:documentation>
              </xsd:annotation>
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:choice minOccurs="0" maxOccurs="200">
                     <xsd:element name="StringAttribute" type="StringValueType">                    
                        <xsd:annotation>
                            <xsd:documentation>
                              A String attribute.
                            </xsd:documentation>
                        </xsd:annotation>
                      </xsd:element>
                     <xsd:element name="NumberAttribute" type="StringValueType">                    
                        <xsd:annotation>
                            <xsd:documentation>
                              A Number attribute.
                            </xsd:documentation>
                        </xsd:annotation>
                      </xsd:element>
                     </xsd:choice>
                  </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
   <xsd:complexType name="EventSystemAttributesType">                    
      <xsd:annotation>
          <xsd:documentation>
            This section defines a complext type for system attributes provided by
             EM event system.
          </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="EventClass" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  The class of the event. For instance, target availability event, 
                  metric alert event, job status change event.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="EventID" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  The ID to identify a single event instance.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="SequenceID" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  ID to identify a sequene of events which share the same event life
                   cycle. 
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="OccurredDate" type="xsd:dateTime" minOccurs="0">                    
            <xsd:annotation>
                <xsd:documentation>
                  Date when the event occured.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="ReportedDate" type="xsd:dateTime">                    
            <xsd:annotation>
                <xsd:documentation>
                The date timestamp when the EM event publishing system is reporting 
                the event.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="DisplayTZ" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  The display timezone region associated with the event. Event 
                  publishers can specify the time zone the event should be displayed in.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="EventName" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  Name of the event.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="Severity" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  Severity level of the current event. The value changes based on local language setting.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
           <xsd:element name="SeverityCode" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  Internal Severity value of the current event.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="SourceInfo" type="SourceInfoType">                    
            <xsd:annotation>
                <xsd:documentation>
                  The source information of the EM subsystems or componenets that
                   raises the event.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="Message" type="xsd:string" minOccurs="0">                    
            <xsd:annotation>
                <xsd:documentation>
                  A description of the event.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="ActionMessage" type="xsd:string" minOccurs="0">                    
            <xsd:annotation>
                <xsd:documentation>
                  The action message for the event that helps diagnosing the issue. 
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="EventURL" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  A URL of the event on EM incident console.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="AutoClose" type="xsd:boolean">                    
            <xsd:annotation>
                <xsd:documentation>
                A flag indicating if an event is auto closed by the system, or it 
                has to be manually closed by users.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="EventCategory" type="xsd:string" minOccurs="0"
                      maxOccurs="50">                    
            <xsd:annotation>
                <xsd:documentation>
                  An optional list of event categories to which the event belongs.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="StringValueType">                    
      <xsd:annotation>
          <xsd:documentation>
            This section defines a complext type for a general name/value pair, both 
            in String.
          </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="Name" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  The name of the String.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="Value" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  The value of the String.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="DateValueType">                    
      <xsd:annotation>
          <xsd:documentation>
            This section defines a complext type for a name/value pair, with name 
            as a String name and value as a Date value.
          </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="Name" type="xsd:string">                    
            <xsd:annotation>
                <xsd:documentation>
                  The name of the Date.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
         <xsd:element name="Value" type="xsd:dateTime">                    
            <xsd:annotation>
                <xsd:documentation>
                  The value of the Date.
                </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
</xsd:schema>

Example C-12 connectorCommon.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  <xsd:include schemaLocation="externalEvent.xsd"/>
  <xsd:complexType name="SourceInfoType"> 
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complext type for Source Information.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="SourceObjInfo" type="SourceObjInfoType" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              This element defines the data structure for the source object, the EM 
              subsystem or component, that raises an EM event or an incident.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="TargetInfo" type="TargetInfoType" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              The element defines the data structure for an EM target as related 
              to the connector framework.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="SourceObjInfoType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for Source Object Information.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="ObjID" type="xsd:string">  
        <xsd:annotation>
            <xsd:documentation>
              The unique ID to identify the source object.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ObjName" type="xsd:string"> 
        <xsd:annotation>
            <xsd:documentation>
              The name of the source object.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ObjOwner" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              The owner of the source object.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="SourceObjType" type="xsd:string"> 
        <xsd:annotation>
            <xsd:documentation>
              The type of the source object.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="SourceObjSubType" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              The subtype of the source object.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="TargetInfoType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for target information.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="TargetGUID" type="xsd:string"> 
        <xsd:annotation>
            <xsd:documentation>
              A unique GUID for the target.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="TargetName" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
              Name of the target.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="TargetType" type="xsd:string"> 
        <xsd:annotation>
            <xsd:documentation>
              Type of the target.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="TargetTypeLabel" type="xsd:string"> 
        <xsd:annotation>
            <xsd:documentation>
              The display label of the target type.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="TargetURL" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
              The URL of the target. 
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="TargetProperty" type="PropertyType" minOccurs="0"
                   maxOccurs="50"> 
        <xsd:annotation>
            <xsd:documentation>
              An optional list of properties for the target.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="PropertyType"> 
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for a property attribute.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="Name" type="xsd:string">
          <xsd:annotation>
              <xsd:documentation>
                A string name defining a property attribute.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element> 
      <xsd:element name="Value" type="xsd:string" nillable="true">                    
          <xsd:annotation>
              <xsd:documentation>
                A non-null string value.
              </xsd:documentation>
          </xsd:annotation> 
        </xsd:element> 
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="VariableType"> 
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for a general variable.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="VariableName" type="StringStrictT32">
          <xsd:annotation>
              <xsd:documentation>
                Name of the variable. It has to be a string containing 1 or upto 
                32 upper case or lower case letters or numbers.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element> 
      <xsd:element name="VariableValue" type="StringT2048">
          <xsd:annotation>
              <xsd:documentation>
                Value of the variable. It has to be a string containing 1 or upto 
                2048 characters.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element> 
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="GetAlertsResponse">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for responses to a getAlerts request.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="Alert" minOccurs="0" maxOccurs="200">
          <xsd:annotation>
              <xsd:documentation>
                The individual alerts contained in the response. A response may have 
                upto 200 alerts.
              </xsd:documentation>
          </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="ExternalEvent">
              <xsd:annotation>
                  <xsd:documentation>
                    Details of the external event in the alert, as defined in 
                    ExternalEvent.xsd.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element> 
            <xsd:element name="InstanceVariable" type="VariableType"
                         minOccurs="0" maxOccurs="50">  
              <xsd:annotation>
                  <xsd:documentation>
                    A list of instance variables for the alert.
                  </xsd:documentation>
              </xsd:annotation>
            </xsd:element> 
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="ConnectorVariablesType">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complex type for connector variables. An element 
          of type ConnectorVariablesType may have up to 50 connector variables, as 
          defined next.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="ConnectorVariable" type="VariableType" minOccurs="0"
                   maxOccurs="50"> 
        <xsd:annotation>
            <xsd:documentation>
              A connector varialbe as a name/value pair. 
            </xsd:documentation>
        </xsd:annotation> 
      </xsd:element> 
    </xsd:sequence>
  </xsd:complexType>
  <xsd:simpleType name="StringT64">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          64 bytes.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="64"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringT128">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          128 bytes.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="128"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringT256">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          256 bytes.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="256"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringT512">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          512 bytes.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="512"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringT2048">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          2048 bytes.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="2048"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringStrictT16">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          16 bytes. The String can only contain lower or upper case letters, numbers, 
          and the underscore characters.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="16"/>
      <xsd:pattern value="([a-zA-Z0-9_])*"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringStrictT32">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          32 bytes. The String can only contain lower or upper case letters, numbers, 
          and the underscore characters.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="32"/>
      <xsd:pattern value="([a-zA-Z0-9_])*"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringStrictT64"> 
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          64 bytes. The String can only contain lower or upper case letters, numbers, 
          and the underscore characters.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="64"/>
      <xsd:pattern value="([a-zA-Z0-9_])*"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringStrictT128">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          128 bytes. The String can only contain lower or upper case letters, numbers, 
          and the underscore characters.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="128"/>
      <xsd:pattern value="([a-zA-Z0-9_])*"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="StringStrictT256">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          256 bytes. The String can only contain lower or upper case letters, numbers, 
          and the underscore characters.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="256"/>
      <xsd:pattern value="([a-zA-Z0-9_])*"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="VersionT">
    <xsd:annotation>
        <xsd:documentation>
          This section defines a simple type for a String with maximum length of 
          20 bytes. The String can only contain numbers and the period characters.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="20"/>
      <xsd:pattern value="([0-9.])*"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>

Example C-13 EMEventResponse.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  <xsd:include schemaLocation="connectorCommon.xsd"/>
  <xsd:element name="EMEventResponse">  
    <xsd:annotation>
        <xsd:documentation>
          The response from external server for an EM event it has received.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="SuccessFlag" type="xsd:boolean"> 
          <xsd:annotation>
              <xsd:documentation>
                The flag to indicate whether or not the event has been successfully
                 inserted or updated at the external system.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element> 
        <xsd:choice>
          <xsd:element name="ExternalEventId" type="StringT128">                    
            <xsd:annotation>
                <xsd:documentation>
                  The ID to identify the event created in the external event system. 
                  It is returned by the external system when the event is successfully 
                  inserted or updated.
                </xsd:documentation>
            </xsd:annotation> 
          </xsd:element> 
          <xsd:element name="ErrorMessage" type="StringT2048">
          <xsd:annotation>
              <xsd:documentation>
                The error message returned by the external system when the event 
                fails to be inserted or updated.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element> 
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Example C-14 externalEvent.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  <xsd:element name="ExternalEvent">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines the attribute requirement of an extenral event 
          for the connector framework to process it.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="SystemAttributes" type="ExternalEventSystemAttributesType">                    
          <xsd:annotation>
              <xsd:documentation>
                Attributes to capture general information about the external event 
                system. These attributes are system-specific, with all events from 
                the same external system sharing the same system attributes.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="EventClassAttributes"
                     type="ExternalEventClassAttributesType">                    
          <xsd:annotation>
              <xsd:documentation>
                Attributes to capture specific information required for the event 
                as defined in the event class.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="ExternalEventSystemAttributesType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complext type for system attributes required for 
          all external events.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="eventName" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              Name of the event.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="category" type="xsd:string" minOccurs="0" maxOccurs="50">                    
        <xsd:annotation>
            <xsd:documentation>
              The event category to which the event belongs.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="targetName" type="xsd:string">                    
        <xsd:annotation>
            <xsd:documentation>
              Name of the target on which event was generated. It refers 
              to an entity in external systems simillar to an EM target.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="targetType" type="xsd:string">                    
        <xsd:annotation>
            <xsd:documentation>
              The type of the target. Target types defined for event connectors 
              are used. See connectorDeploy.xsd.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="occurrenceDate" type="xsd:dateTime">                    
        <xsd:annotation>
            <xsd:documentation>
              Date when the event occured.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="detectedDate" type="xsd:dateTime">                    
        <xsd:annotation>
            <xsd:documentation>
              Date when the event was last detected.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="autoClose" type="xsd:boolean">                    
        <xsd:annotation>
            <xsd:documentation>
              A flag indicating if an event is auto closed by the system, or it 
              has to be manually closed by users.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="message" type="xsd:string">                    
        <xsd:annotation>
            <xsd:documentation>
              A description of the event.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="severity" type="xsd:string">                    
        <xsd:annotation>
            <xsd:documentation>
              Severity level of the event.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="ExternalEventClassAttributesType">                    
    <xsd:annotation>
        <xsd:documentation>
          This section defines a complext type for class specific attributes required 
          for all external events in the class.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="external_event_id" type="xsd:string">                    
        <xsd:annotation>
            <xsd:documentation>
              ID used in external system to identify the event.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="external_rule_id" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              Optional rule ID that delivered the event in the external system.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="external_host" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              Optional host information from extrernal system where event was generated.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="external_source" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              Optional source information from the external system.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="external_severity" type="xsd:string">                    
        <xsd:annotation>
            <xsd:documentation>
              Severity level of the event on external system.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="external_status" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              Status of the event on extenral system.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="custom_field1" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              An optional field.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="custom_field2" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              An optional field.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="custom_field3" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              An optional field.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="custom_field4" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              An optional field.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="custom_field5" type="xsd:string" minOccurs="0">                    
        <xsd:annotation>
            <xsd:documentation>
              An optional field.
            </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

Example C-15 setupResponse.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  
  <xsd:include schemaLocation="connectorCommon.xsd"/>
  <xsd:element name="SetupResponse" type="ConnectorVariablesType">                    
          <xsd:annotation>
              <xsd:documentation>
                Response from external system for a setup request. It consists of 
                a list of connector variables, i.e. name/value pairs.
              </xsd:documentation>
          </xsd:annotation> 
        </xsd:element> 
  
</xsd:schema>

Example C-16 initialize_response.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  
  <xsd:include schemaLocation="connectorCommon.xsd"/>
  <xsd:element name="InitializeResponse" type="ConnectorVariablesType">                    
          <xsd:annotation>
              <xsd:documentation>
                The response for an initialize reqeust. It contains a list of 
                connector variables, which are name/value pairs.
              </xsd:documentation>
          </xsd:annotation>
        </xsd:element> 
  
</xsd:schema>

Example C-17 uninitialize_response.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/sysman/connector"
            targetNamespace="http://xmlns.oracle.com/sysman/connector"
            elementFormDefault="qualified">
  
  <xsd:include schemaLocation="connectorCommon.xsd"/>
  <xsd:element name="UninitializeResponse" type="ConnectorVariablesType">                    
          <xsd:annotation>
              <xsd:documentation>
                The response for an uninitialize reqeust. It contains a list of 
                connector variables, which are name/value pairs.
              </xsd:documentation>
          </xsd:annotation>                     
        </xsd:element> 
  
</xsd:schema>