HTTP Function Request and Response XML Schemas


This section documents the ddtek-http-request.xsd and ddtek-http-response.xsd XML Schema.

Request XML Schema

If your XQuery Web service client uses a request element (to specify a connection time out or retries, for exmple), it should conform to the ddtek-http-request.xsd XML Schema.

The request header contains all header info that is to be sent to the server. This includes all request headers as specified in the http protocol, as well as server/service specific headers. The parameters are configuration settings. Except for authentication credentials, none of the parameter info provided is transmitted to the server.

If no value is specified for a parameter, the default setting is used.

 
<?xml version="1.0"?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
  <xsd:schema elementFormDefault="qualified">- 
    <xsd:element name="request">- 
      <xsd:complexType>- 
        <xsd:sequence>- 
          <xsd:element name="request-header" minOccurs="0" maxOccurs="1">- 
            <xsd:complexType>- 
              <xsd:sequence>- 
                <xsd:element name="header" minOccurs="0" 
                             maxOccurs="unbounded">- 
                  <xsd:complexType> 
                    <xsd:attribute name="name" type="xsd:string" 
                                   use="required"/> 
                     <xsd:attribute name="value" type="xsd:string" 
                                    use="required"/> 
                   </xsd:complexType> 
                 </xsd:element> 
               </xsd:sequence> 
             </xsd:complexType> 
          </xsd:element> 
        </xsd:sequence> 
        <xsd:attribute name="streaming" type="YesNo" use="optional" 
                       default="yes"/> 
        <xsd:attribute name="http-version" type="HttpVersion" use="optional" 
                        default="http_1_1"/> 
        <xsd:attribute name="connection-timeout" type="xsd:int" 
                       use="optional"/> 
        <xsd:attribute name="socket-timeout" type="xsd:int" use="optional"/> 
        <xsd:attribute name="socket-linger" type="xsd:int" use="optional"/> 
        <xsd:attribute name="socket-sendbuffer" type="xsd:int" 
                       use="optional"/> 
        <xsd:attribute name="socket-receivebuffer" type="xsd:int" 
                       use="optional"/> 
        <xsd:attribute name="tcp-nodelay" type="xsd:int" use="optional"/> 
        <xsd:attribute name="username" type="xsd:string" use="optional"/> 
        <xsd:attribute name="password" type="xsd:string" use="optional"/> 
        <xsd:attribute name="proxy-username" type="xsd:string" 
                       use="optional"/> 
        <xsd:attribute name="proxy-password" type="xsd:string" 
                       use="optional"/> 
        <xsd:attribute name="response-data-type" type="ResponseDataType" 
                       use="optional"/> 
        <xsd:attribute name="cookie-policy" type="CookiePolicy" 
                       use="optional" default="RFC_2109"/> 
        <xsd:attribute name="proxy-host" type="xsd:string" use="optional"/> 
        <xsd:attribute name="proxy-port" type="xsd:int" use="optional"/> 
        <xsd:attribute name="wrap-exception" type="YesNo" use="optional"/> 
        <xsd:attribute name="retries" type="xsd:int" use="optional"/> 
        <xsd:attribute name="protocol-reject-head-body" type="YesNo" 
                       use="optional"/> 
        <xsd:attribute name="protocol-head-body-timeout" type="xsd:int" 
                       use="optional"/> 
        <xsd:attribute name="serialize" type="xsd:string" use="optional"/> 
      </xsd:complexType> 
    </xsd:element>- 
    <xsd:simpleType name="YesNo">- 
      <xsd:restriction base="xsd:string"> 
        <xsd:enumeration value="yes"/> 
        <xsd:enumeration value="no"/> 
      </xsd:restriction> 
    </xsd:simpleType>- 
    <xsd:simpleType name="HttpVersion">- 
      <xsd:restriction base="xsd:string"> 
        <xsd:enumeration value="http_1_0"/> 
        <xsd:enumeration value="http_1_1"/> 
      </xsd:restriction> 
    </xsd:simpleType>- 
    <xsd:simpleType name="ResponseDataType">- 
      <xsd:restriction base="xsd:string"> 
        <xsd:enumeration value="xml"/> 
        <xsd:enumeration value="text"/> 
        <xsd:enumeration value="base64"/> 
      </xsd:restriction> 
    </xsd:simpleType>- 
    <xsd:simpleType name="CookiePolicy">- 
      <xsd:restriction base="xsd:string"> 
        <xsd:enumeration value="netscape"/> 
        <xsd:enumeration value="RFC_2109"/> 
        <xsd:enumeration value="RFC_2965"/> 
        <xsd:enumeration value="ignore_cookies"/> 
      </xsd:restriction> 
    </xsd:simpleType> 
  </xsd:schema> 
</xsd:schema> 

Response XML Schema

Response elements returned by DataDirect XQuery HTTP functions (like ddtek:http-put, for example) conform to the following XML Schema, ddtek-http-response.xsd.

The top level attributes from the response element contain the status information returned by the server as outlined in the HTTP protocol. The attributes include the version information, the status code, and the reason phrase, respectively.

 
<?xml version="1.0"?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
   <xsd:schema elementFormDefault="qualified">- 
     <xsd:element name="response">- 
	    <xsd:complexType>- 
			 <xsd:sequence>- 
			   <xsd:element name="response-header" minOccurs="0" maxOccurs="1">- 
						<xsd:complexType>- 
							<xsd:sequence>- 
								<xsd:element name="header" minOccurs="0" 
											  maxOccurs="unbounded">- 
									<xsd:complexType> 
										<xsd:attribute name="name" type="xsd:string" 
										               use="required"/> 
										<xsd:attribute name="value" type="xsd:string" 
										               use="required"/> 
									</xsd:complexType> 
								</xsd:element> 
							</xsd:sequence> 
						</xsd:complexType> 
					</xsd:element> 
			     <xsd:element name="response-body" minOccurs="0" maxOccurs="1"/> 
			 </xsd:sequence> 
		  <xsd:attribute name="http-version" type="xsd:string" use="required"/> 
		  <xsd:attribute name="status-code" type="xsd:string" use="required"/> 
		  <xsd:attribute name="reason" type="xsd:string" use="required"/> 
	    </xsd:complexType> 
     </xsd:element> 
   </xsd:schema> 
</xsd:schema>