<?xml version="1.0" encoding="UTF-8"?>

<!--
Salesforce.com Web Services API version 2.0 ALPHA
Implementation details may change at any moment.  All interfaces are in flux.

Copyright, 1999-2003, SALESFORCE.com
All Rights Reserved
-->
<!--
NOTES: 

    1.) should we subclass Field and PicklistEntry?
    2.) how do we handle error codes?
    
-->

<definitions targetNamespace="urn:partner.soap.sforce.com"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="urn:partner.soap.sforce.com"
             xmlns:ens="urn:sobject.partner.soap.sforce.com"
             xmlns:fns="urn:fault.partner.soap.sforce.com"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <types>

        <schema elementFormDefault="qualified"
                targetNamespace="urn:sobject.partner.soap.sforce.com"
                xmlns="http://www.w3.org/2001/XMLSchema">

	    <import namespace="urn:partner.soap.sforce.com"/>


            <!-- Dynamic sObject -->
            <complexType name="sObject">
                <sequence>
                    <element name="type"               type="xsd:string"/>
                    <element name="fieldsToNull"       minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
                    <element name="Id"                 minOccurs="0" maxOccurs="1" type="tns:ID"/>
                    <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </complexType>

        </schema>

        <schema elementFormDefault="qualified"
                targetNamespace="urn:partner.soap.sforce.com"
                xmlns="http://www.w3.org/2001/XMLSchema">

	    <import namespace="urn:sobject.partner.soap.sforce.com"/>

            <!-- Our simple ID Type -->
            <simpleType name="ID">
                <restriction base="xsd:string">
                    <length value="18"/>
                    <pattern value='[a-zA-Z0-9]{18}'/>
                </restriction>
            </simpleType>

            <simpleType name="QueryLocator">
                <restriction base="xsd:string" />
            </simpleType>

            <!-- Shared Result Types -->
            <complexType name="QueryResult">
                <sequence>
                    <element name="done"         type="xsd:boolean"/>
                    <element name="queryLocator" type="tns:QueryLocator" nillable="true"/>
                    <element name="records"      minOccurs="0" maxOccurs="unbounded" type="ens:sObject"/>
                    <element name="size"         type="xsd:int"/>
                </sequence>
            </complexType>

            <!-- Search Result -->
            <complexType name="SearchResult">
                <sequence>
                    <element name="records" minOccurs="0" maxOccurs="unbounded" type="ens:sObject"/>
                    <element name="size"    type="xsd:int"/>
                </sequence>
            </complexType>

            <complexType name="GetServerTimestampResult">
                <sequence>
                    <element name="timestamp" type="xsd:dateTime"/>
                </sequence>
            </complexType>

            <complexType name="SetPasswordResult">
            </complexType>

            <complexType name="ResetPasswordResult">
                <sequence>
                    <element name="password" type="xsd:string"/>
                </sequence>
            </complexType>

            <complexType name="GetUserInfoResult">
                <sequence>
                    <element name="userId"          type="tns:ID"/>
                    <element name="userFullName"    type="xsd:string"/>
                    <element name="userEmail"       type="xsd:string"/>
                    <element name="userTimeZone"    type="xsd:string"/>
                    <element name="userLocale"      type="xsd:string"/>
                    <element name="userLanguage"    type="xsd:string"/>
                    <element name="userDefaultCurrencyIsoCode" type="xsd:string"/>
                    <element name="organizationName" type="xsd:string"/>
                    <element name="organizationMultiCurrency"  type="xsd:boolean"/>
                    <element name="currencySymbol"  type="xsd:string"/>
                </sequence>
            </complexType>

            <complexType name="LoginResult">
                <sequence>
                    <element name="serverUrl" nillable="true" type="xsd:string"/>
                    <element name="sessionId" type="xsd:string"/>
                    <element name="userId"    type="tns:ID"/>
                </sequence>
            </complexType>

            <simpleType name="StatusCode">
                <restriction base="xsd:string">
                    <enumeration value="null"/>
                    <enumeration value="UNKNOWN_EXCEPTION"/>
                    <enumeration value="null"/>
                    <enumeration value="null"/>
                    <enumeration value="null"/>
                    <enumeration value="null"/>
                    <enumeration value="null"/>
                    <enumeration value="INVALID_CONTENT_ENCODING"/>
                    <enumeration value="API_CURRENTLY_DISABLED"/>
                    <enumeration value="API_DISABLED_FOR_ORG"/>
                    <enumeration value="EXCEEDED_QUOTA"/>
                    <enumeration value="EXCEEDED_RATE_LIMIT"/>
                    <enumeration value="SERVER_UNAVAILABLE"/>
                    <enumeration value="MISSING_ARGUMENT"/>
                    <enumeration value="INVALID_ARGUMENT_TYPE"/>
                    <enumeration value="INVALID_APPLICATION"/>
                    <enumeration value="INVALID_TYPE"/>
                    <enumeration value="INVALID_OPERATION"/>
                    <enumeration value="UNSUPPORTED_API_VERSION"/>
                    <enumeration value="INVALID_CLIENT"/>
                    <enumeration value="UNSUPPORTED_CLIENT"/>
                    <enumeration value="INVALID_TYPE_FOR_OPERATION"/>
                    <enumeration value="INVALID_ID_FIELD"/>
                    <enumeration value="INVALID_CROSS_REFERENCE_KEY"/>
                    <enumeration value="INVALID_EMPTY_KEY_OWNER"/>
                    <enumeration value="REQUIRED_FIELD_MISSING"/>
                    <enumeration value="INSUFFICIENT_ACCESS_OR_READONLY"/>
                    <enumeration value="UNSPECIFIED_ARGS_TO_BATCH"/>
                    <enumeration value="BATCH_ARGS_NOT_ARRAY"/>
                    <enumeration value="BATCH_ARGS_NOT_STRUCT"/>
                    <enumeration value="DELETE_FAILED"/>
                    <enumeration value="UNSPECIFIED_EMAIL_ADDRESS"/>
                    <enumeration value="CANNOT_RESOLVE_NAME"/>
                    <enumeration value="INVALID_TYPE_ON_FIELD_IN_RECORD"/>
                    <enumeration value="FUNCTIONALITY_NOT_ENABLED"/>
                    <enumeration value="LAST_MODIFIED_SINCE_TOO_OLD"/>
                    <enumeration value="INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD"/>
                    <enumeration value="INVALID_FIELD_FOR_FILTERING"/>
                    <enumeration value="TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET"/>
                    <enumeration value="STORAGE_LIMIT_EXCEEDED"/>
                    <enumeration value="INVALID_BATCH_OPERATION"/>
                    <enumeration value="INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST"/>
                    <enumeration value="INVALID_CURRENCY_ISO"/>
                    <enumeration value="CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY"/>
                    <enumeration value="ENTITY_IS_DELETED"/>
                    <enumeration value="DUPLICATE_USERNAME"/>
                    <enumeration value="LICENSE_LIMIT_EXCEEDED"/>
                    <enumeration value="FIELD_INTEGRITY_EXCEPTION"/>
                    <enumeration value="CANNOT_UPDATE_CONVERTED_LEAD"/>
                    <enumeration value="NUMBER_OUTSIDE_VALID_RANGE"/>
                    <enumeration value="ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE"/>
                    <enumeration value="INVALID_FIELD_FOR_INSERT_UPDATE"/>
                    <enumeration value="INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY"/>
                    <enumeration value="INACTIVE_OWNER_OR_USER"/>
                    <enumeration value="INVALID_STATUS"/>
                    <enumeration value="ENTITY_IS_LOCKED"/>
                    <enumeration value="INVALID_CREDIT_CARD_INFO"/>
                    <enumeration value="FAILED_ACTIVATION"/>
                    <enumeration value="ENTITY_IS_ARCHIVED"/>
                    <enumeration value="INVALID_ASSIGNMENT_RULE"/>
                    <enumeration value="MAXIMUM_SIZE_OF_ATTACHMENT"/>
                    <enumeration value="DUPLICATE_CASE_SOLUTION"/>
                    <enumeration value="SHARE_NEEDED_FOR_CHILD_OWNER"/>
                    <enumeration value="CHILD_SHARE_FAILS_PARENT"/>
                    <enumeration value="CIRCULAR_DEPENDENCY"/>
                    <enumeration value="MALFORMED_ID"/>
                    <enumeration value="INVALID_SEARCH"/>
                    <enumeration value="CANNOT_REPARENT_RECORD"/>
                    <enumeration value="CUSTOM_ENTITY_OR_FIELD_LIMIT"/>
                    <enumeration value="DUPLICATE_DEVELOPER_NAME"/>
                    <enumeration value="CANT_DISABLE_CORP_CURRENCY"/>
                    <enumeration value="CANT_UNSET_CORP_CURRENCY"/>
                    <enumeration value="DUPLICATE_MASTER_LABEL"/>
                    <enumeration value="CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED"/>
                    <enumeration value="MAX_ACTIVE_RULES_EXCEEDED"/>
                    <enumeration value="ASSIGNEE_TYPE_REQUIRED"/>
                    <enumeration value="INVALID_ASSIGNEE_TYPE"/>
                    <enumeration value="MAX_ACTIONS_PER_RULE_EXCEEDED"/>
                    <enumeration value="MAX_TASK_DESCRIPTION_EXCEEEDED"/>
                    <enumeration value="MAXIMUM_SIZE_OF_DOCUMENT"/>
                    <enumeration value="INVALID_EMAIL_ADDRESS"/>
                    <enumeration value="MAXIMUM_CCEMAILS_EXCEEDED"/>
                    <enumeration value="INVALID_FILTER_ACTION"/>
                    <enumeration value="INVALID_FIELD_IN_QUERY"/>
                    <enumeration value="INVALID_TYPE_IN_QUERY_FILTER"/>
                    <enumeration value="INVALID_QUERY_FILTER_OPERATOR"/>
                    <enumeration value="QUERY_TIMEOUT"/>
                    <enumeration value="QUERY_EXCEEDED_MAX_ROWS"/>
                    <enumeration value="QUERY_EXCEEDED_MAX_ROWS_INLINE_FAULT"/>
                    <enumeration value="EXCEEDED_ID_LIMIT_ON_QUERY"/>
                    <enumeration value="INVALID_QUERY_SCOPE"/>
                    <enumeration value="INVALID_QUERY_LOCATOR"/>
                    <enumeration value="MALFORMED_QUERY"/>
                    <enumeration value="INVALID_BATCH_SIZE"/>
                    <enumeration value="MALFORMED_SEARCH"/>
                    <enumeration value="INVALID_SEARCH_SCOPE"/>
                    <enumeration value="INVALID_SESSION_ID"/>
                    <enumeration value="TRIAL_EXPIRED"/>
                    <enumeration value="INVALID_LOGIN"/>
                    <enumeration value="LOGIN_DURING_RESTRICTED_TIME"/>
                    <enumeration value="LOGIN_DURING_RESTRICTED_DOMAIN"/>
                    <enumeration value="PASSWORD_LOCKOUT"/>
                    <enumeration value="ORG_LOCKED"/>
                    <enumeration value="null"/>
                </restriction>
            </simpleType>


            <complexType name="Error">
                <sequence>
                    <element name="statusCode" type="tns:StatusCode"/>
                    <element name="message"    type="xsd:string"/>
                    <element name="fields"     minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
                </sequence>
            </complexType>
            
            <complexType name="SaveResult">
                <sequence>
                    <element name="id"        type="tns:ID"/>
                    <element name="success"   type="xsd:boolean"/>
                    <element name="errors"    minOccurs="0" maxOccurs="unbounded" type="tns:Error"/>     
                </sequence>
            </complexType>
            
            <complexType name="DeleteResult">
                <sequence>
                    <element name="id"        type="tns:ID"/>
                    <element name="success"   type="xsd:boolean"/>
                    <element name="errors"    minOccurs="0" maxOccurs="unbounded" type="tns:Error"/>     
                </sequence>
            </complexType>

            <complexType name="DescribeSObjectResult">
                <sequence>
                    <element name="name"           type="xsd:string"/>
                    <element name="custom"         type="xsd:boolean"/>

                    <!-- access fields -->
                    <element name="queryable"      type="xsd:boolean"/>
                    <element name="createable"     type="xsd:boolean"/>
                    <element name="updateable"     type="xsd:boolean"/>
                    <element name="deletable"      type="xsd:boolean"/>
                    <element name="undeletable"    type="xsd:boolean"/>
                    <element name="activateable"   type="xsd:boolean"/>
                    <element name="retrieveable"   type="xsd:boolean"/>
                    <element name="searchable"     type="xsd:boolean"/>
                    <element name="replicateable"  type="xsd:boolean"/>

                    <element name="fields"         minOccurs="0" maxOccurs="unbounded" type="tns:Field"/>
                </sequence>
            </complexType>

            <complexType name="DescribeGlobalResult">
                <sequence>
                    <element name="encoding"       type="xsd:string"/>
                    <element name="maxBatchSize"   type="xsd:int"/>
                    <element name="types"          minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
                </sequence>
            </complexType>

            <simpleType name="fieldType">
                <restriction base="xsd:string">
                    <enumeration value="string"/>
                    <enumeration value="picklist"/>
                    <enumeration value="combobox"/>
                    <enumeration value="reference"/>
                    <enumeration value="base64"/>
                    <enumeration value="boolean"/>
                    <enumeration value="currency"/>
                    <enumeration value="textarea"/>
                    <enumeration value="i4"/>
                    <enumeration value="double"/>
                    <enumeration value="percent"/>
                    <enumeration value="phone"/>
                    <enumeration value="id"/>
                    <enumeration value="date"/>
                    <enumeration value="datetime"/>
                    <enumeration value="url"/>
                    <enumeration value="email"/>
                </restriction>
            </simpleType>

            <simpleType name="soapType"> 
                <restriction base="xsd:string">
                    <enumeration value="tns:ID"/>
                    <enumeration value="xsd:base64Binary"/>
                    <enumeration value="xsd:boolean"/>
                    <enumeration value="xsd:double"/>
                    <enumeration value="xsd:int"/>
                    <enumeration value="xsd:string"/>
                    <enumeration value="xsd:dateTime"/>
                </restriction>
            </simpleType>

            <complexType name="Field">
                <sequence>
                    <!-- common field attributes -->
                    <element name="type"          type="tns:fieldType"/>
                    <element name="name"          type="xsd:string"/>
                    <element name="label"         type="xsd:string"/>

                    <element name="soapType"      type="tns:soapType"/> 

                    <element name="custom"        type="xsd:boolean"/>
                    <element name="nillable"      type="xsd:boolean"/>
                    <element name="required"      type="xsd:boolean"/>


                    <!-- string-specific properties -->
                    <element name="length"        type="xsd:int" nillable="true"/>
                    <element name="byteLength"    type="xsd:int" nillable="true"/>

                    <!-- picklist-specific properties -->
                    <element name="restrictedPicklist" type="xsd:boolean"/>
                    <element name="picklistValues"     minOccurs="0" maxOccurs="unbounded" type="tns:PicklistEntry"/>

                    <!-- referenceTo-specific properties -->
                    <element name="referenceTo"   minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
                    
                    <!-- number-specific properties -->
                    <element name="precision"    type="xsd:int" nillable="true"/>
                    <element name="scale"        type="xsd:int" nillable="true"/>
                    <element name="digits"       type="xsd:int" nillable="true"/>

                    <!-- access fields -->
                    <element name="selectable"   type="xsd:boolean"/>
                    <element name="filterable"   type="xsd:boolean"/>
                    <element name="createable"   type="xsd:boolean"/>
                    <element name="updateable"   type="xsd:boolean"/>
                </sequence>
            </complexType>
           
            <complexType name="PicklistEntry">
                <sequence>
                    <element name="label"          type="xsd:string"/>
                    <element name="value"          type="xsd:string"/>
                    <element name="defaultValue"   type="xsd:boolean"/>

                    <!-- type-specific attributes -->
                    <element name="active"         type="xsd:boolean"/>
                    <element name="corporate"      type="xsd:boolean"/>
                    <element name="scale"          type="xsd:int"/>
                    <element name="conversionRate" type="xsd:double"/>
                </sequence>
            </complexType>
            
            <!-- Login Message Types -->
            <element name="login">
                <complexType>
                    <sequence>
                        <element name="username" type="xsd:string"/>
                        <element name="password" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="loginResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:LoginResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Describe Message Types -->
            <element name="describeSObject">
                <complexType>
                    <sequence>
                        <element name="sObjectType" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="describeSObjectResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:DescribeSObjectResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Describe Message Types -->
            <element name="describeGlobal">
            </element>
            <element name="describeGlobalResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:DescribeGlobalResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Create Message Types -->
            <element name="create">
                <complexType>
                    <sequence>
                        <element name="sObjects" minOccurs="1" maxOccurs="unbounded" type="ens:sObject"/>
                    </sequence>
                </complexType>
            </element>
            <element name="createResponse">
                <complexType>
                    <sequence>
                        <element name="result" minOccurs="1" maxOccurs="unbounded" type="tns:SaveResult"/>
                    </sequence>
                </complexType>
            </element>
            
            <!-- Update Message Types -->
            <element name="update">
                <complexType>
                    <sequence>
                        <element name="sObjects" minOccurs="1" maxOccurs="unbounded" type="ens:sObject"/>
                    </sequence>
                </complexType>
            </element>
            <element name="updateResponse">
                <complexType>
                    <sequence>
                        <element name="result" minOccurs="1" maxOccurs="unbounded" type="tns:SaveResult" />
                    </sequence>
                </complexType>
            </element>

            <!-- Delete Message Types -->
            <element name="delete">
                <complexType>
                    <sequence>
                        <element name="ids"  minOccurs="1" maxOccurs="unbounded" type="tns:ID"/>
                    </sequence>
                </complexType>
            </element>
            <element name="deleteResponse">
                <complexType>
                    <sequence>
                        <element name="result" minOccurs="1" maxOccurs="unbounded" type="tns:DeleteResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Retrieve (ID List) Message Types -->
            <element name="retrieve">
                <complexType>
                    <sequence>
                        <element name="fieldList"   type="xsd:string"/>
                        <element name="sObjectType" type="xsd:string"/>
                        <element name="ids"    minOccurs="1" maxOccurs="unbounded" type="tns:ID"/>
                    </sequence>
                </complexType>
            </element>
            <element name="retrieveResponse">
                <complexType>
                    <sequence>
                        <element name="result" minOccurs="0" maxOccurs="unbounded" type="ens:sObject"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Create Query -->
            <element name="query">
                <complexType>
                    <sequence>
                        <element name="queryString" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="queryResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:QueryResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Next Batch of sObjects from a query -->
            <element name="queryMore">
                <complexType>
                    <sequence>
                        <element name="queryLocator" type="tns:QueryLocator"/>
                    </sequence>
                </complexType>
            </element>
            <element name="queryMoreResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:QueryResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Create Search -->
            <element name="search">
                <complexType>
                    <sequence>
                        <element name="searchString" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="searchResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:SearchResult"/>
                    </sequence>
                </complexType>
            </element>
            
            <element name="getServerTimestamp">
            </element>
            <element name="getServerTimestampResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:GetServerTimestampResult"/>
                    </sequence>
                </complexType>
            </element>

            <element name="setPassword">
                <complexType>
                    <sequence>
                        <element name="UserId" type="tns:ID"/>
                        <element name="Password" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="setPasswordResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:SetPasswordResult"/>
                    </sequence>
                </complexType>
            </element>

            <element name="resetPassword">
                <complexType>
                    <sequence>
                        <element name="UserId" type="tns:ID"/>
                    </sequence>
                </complexType>
            </element>
            <element name="resetPasswordResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:ResetPasswordResult"/>
                    </sequence>
                </complexType>
            </element>

            <element name="getUserInfo">
            </element>
            <element name="getUserInfoResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="tns:GetUserInfoResult"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Header Elements -->
            <element name="SessionHeader">
                <complexType>
                    <sequence>
                        <element name="sessionId" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            
            <element name="QueryOptions">
                <complexType>
                    <sequence>
                        <element name="batchSize" minOccurs="0" type="xsd:int"/>
                    </sequence>
                </complexType>
            </element>
            
            <element name="SaveOptions">
                <complexType>
                    <sequence>
                        <element name="autoAssign"          type="xsd:boolean"/>
                        <element name="assignmentRuleId"    type="tns:ID"/>
                    </sequence>
                </complexType>
            </element>
            
 
        </schema>

        <schema elementFormDefault="qualified"
                targetNamespace="urn:fault.partner.soap.sforce.com"
                xmlns="http://www.w3.org/2001/XMLSchema">

            <!-- Fault -->
            <complexType name="ApiFault">
                <sequence>
                    <element name="code"    type="xsd:int"/>
                    <element name="message"       type="xsd:string"/>
                </sequence>
            </complexType>
            <complexType name="LoginFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="LoginFault" type="fns:LoginFault"/>
            <complexType name="InvalidSObjectFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="InvalidSObjectFault" type="fns:InvalidSObjectFault"/>
            <complexType name="InvalidFieldFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="InvalidFieldFault" type="fns:InvalidFieldFault"/>
            <complexType name="MalformedQueryFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="MalformedQueryFault" type="fns:MalformedQueryFault"/>
            <complexType name="InvalidQueryLocatorFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="InvalidQueryLocatorFault" type="fns:InvalidQueryLocatorFault"/>
            <complexType name="MalformedSearchFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="MalformedSearchFault" type="fns:MalformedSearchFault"/>
            <complexType name="InvalidIdFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="InvalidIdFault" type="fns:InvalidIdFault"/>
            <complexType name="UnknownErrorFault">
                <complexContent>
                    <extension base="fns:ApiFault"/>
                </complexContent>
            </complexType>
            <element name="UnknownErrorFault" type="fns:UnknownErrorFault"/>

        </schema>

    </types>
    
    <!-- Header Message -->
    <message name="Header">
        <part element="tns:SessionHeader"    name="SessionHeader"/>
        <part element="tns:SaveOptions"      name="SaveOptions"/>
        <part element="tns:QueryOptions"     name="QueryOptions"/>
    </message>
    
    <!-- Fault Messages -->
    
    <message name="ApiFault">
        <part name="fault" type="fns:ApiFault"/>
    </message>

    <message name="LoginFault">
        <part name="fault" element="fns:LoginFault"/>
    </message>
    <message name="InvalidSObjectFault">
        <part name="fault" element="fns:InvalidSObjectFault"/>
    </message>
    <message name="InvalidFieldFault">
        <part name="fault" element="fns:InvalidFieldFault"/>
    </message>
    <message name="MalformedQueryFault">
        <part name="fault" element="fns:MalformedQueryFault"/>
    </message>
    <message name="InvalidQueryLocatorFault">
        <part name="fault" element="fns:InvalidQueryLocatorFault"/>
    </message>
    <message name="MalformedSearchFault">
        <part name="fault" element="fns:MalformedSearchFault"/>
    </message>
    <message name="InvalidIdFault">
        <part name="fault" element="fns:InvalidIdFault"/>
    </message>
    <message name="UnknownErrorFault">
        <part name="fault" element="fns:UnknownErrorFault"/>
    </message>

    
    <!-- Method Messages -->
    
    <message name="loginRequest">
        <part element="tns:login" name="parameters"/>
    </message>
    <message name="loginResponse">
        <part element="tns:loginResponse" name="parameters"/>
    </message>

    <message name="describeSObjectRequest">
        <part element="tns:describeSObject" name="parameters"/>
    </message>
    <message name="describeSObjectResponse">
        <part element="tns:describeSObjectResponse" name="parameters"/>
    </message>
    
    <message name="describeGlobalRequest">
        <part element="tns:describeGlobal" name="parameters"/>
    </message>
    <message name="describeGlobalResponse">
        <part element="tns:describeGlobalResponse" name="parameters"/>
    </message>

    <message name="createRequest">
        <part element="tns:create" name="parameters"/>
    </message>
    <message name="createResponse">
        <part element="tns:createResponse" name="parameters"/>
    </message>

    <message name="updateRequest">
        <part element="tns:update" name="parameters"/>
    </message>
    <message name="updateResponse">
        <part element="tns:updateResponse" name="parameters"/>
    </message>

    <message name="deleteRequest">
        <part element="tns:delete" name="parameters"/>
    </message>
    <message name="deleteResponse">
        <part element="tns:deleteResponse" name="parameters"/>
    </message>

    <message name="retrieveRequest">
        <part element="tns:retrieve" name="parameters"/>
    </message>
    <message name="retrieveResponse">
        <part element="tns:retrieveResponse" name="parameters"/>
    </message>

    <message name="queryRequest">
        <part element="tns:query" name="parameters"/>
    </message>
    <message name="queryResponse">
        <part element="tns:queryResponse" name="parameters"/>
    </message>

    <message name="queryMoreRequest">
        <part element="tns:queryMore" name="parameters"/>
    </message>
    <message name="queryMoreResponse">
        <part element="tns:queryMoreResponse" name="parameters"/>
    </message>

    <message name="searchRequest">
        <part element="tns:search" name="parameters"/>
    </message>
    <message name="searchResponse">
        <part element="tns:searchResponse" name="parameters"/>
    </message>
    
    <message name="getServerTimestampRequest">
        <part element="tns:getServerTimestamp" name="parameters"/>
    </message>
    <message name="getServerTimestampResponse">
        <part element="tns:getServerTimestampResponse" name="parameters"/>
    </message>

    <message name="setPasswordRequest">
        <part element="tns:setPassword" name="parameters"/>
    </message>
    <message name="setPasswordResponse">
        <part element="tns:setPasswordResponse" name="parameters"/>
    </message>

    <message name="resetPasswordRequest">
        <part element="tns:resetPassword" name="parameters"/>
    </message>
    <message name="resetPasswordResponse">
        <part element="tns:resetPasswordResponse" name="parameters"/>
    </message>

    <message name="getUserInfoRequest">
        <part element="tns:getUserInfo" name="parameters"/>
    </message>
    <message name="getUserInfoResponse">
        <part element="tns:getUserInfoResponse" name="parameters"/>
    </message>

    <!-- Soap PortType -->
    <portType name="Soap">
        <operation name="login">
            <documentation>Login to the Salesforce.com SOAP Api.</documentation>
            <input  message="tns:loginRequest" />
            <output message="tns:loginResponse" />
            <fault  message="tns:LoginFault" name="LoginFault"/>
        </operation>
        
        <operation name="describeSObject">
            <documentation>Describe the Global state</documentation>
            <input message="tns:describeSObjectRequest" />
            <output message="tns:describeSObjectResponse" />
            <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
        </operation>

        
        <operation name="describeGlobal">
            <documentation>Describe an sObject</documentation>
            <input message="tns:describeGlobalRequest" />
            <output message="tns:describeGlobalResponse" />
        </operation>

        <operation name="create">
            <documentation>Create a set of new sObjects</documentation>
            <input  message="tns:createRequest" />
            <output message="tns:createResponse" />
            <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
        </operation>

        <operation name="update">
            <documentation>Update a set of sObjects</documentation>
            <input  message="tns:updateRequest" />
            <output message="tns:updateResponse" />
            <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
        </operation>
        
        <operation name="delete">
            <documentation>Delete a set of sObjects</documentation>
            <input  message="tns:deleteRequest" />
            <output message="tns:deleteResponse" />
        </operation>
        
        <operation name="retrieve">
            <documentation>Get a set of sObjects</documentation>
            <input  message="tns:retrieveRequest" />
            <output message="tns:retrieveResponse" />
            <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
            <fault  message="tns:InvalidFieldFault" name="InvalidFieldFault" />
        </operation>

        <operation name="query">
            <documentation>Create a Query Cursor</documentation>
            <input  message="tns:queryRequest" />
            <output message="tns:queryResponse" />
            <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
            <fault  message="tns:InvalidFieldFault" name="InvalidFieldFault" />
            <fault  message="tns:MalformedQueryFault" name="MalformedQueryFault" />
        </operation>
        
        <operation name="queryMore">
            <documentation>Gets the next batch of sObjects from a query</documentation>
            <input  message="tns:queryMoreRequest" />
            <output message="tns:queryMoreResponse" />
            <fault  message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault" />
        </operation>

        <operation name="search">
            <documentation>Search for sObjects</documentation>
            <input  message="tns:searchRequest" />
            <output message="tns:searchResponse" />
            <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
            <fault  message="tns:InvalidFieldFault" name="InvalidFieldFault" />
            <fault  message="tns:MalformedSearchFault" name="MalformedSearchFault" />
        </operation>

        <operation name="getServerTimestamp">
            <documentation>Gets server timestamp</documentation>
            <input  message="tns:getServerTimestampRequest" />
            <output message="tns:getServerTimestampResponse" />
        </operation>

        <operation name="setPassword">
            <documentation>Set a user's password</documentation>
            <input  message="tns:setPasswordRequest" />
            <output message="tns:setPasswordResponse" />
            <fault  message="tns:InvalidIdFault" name="InvalidIdFault" />
        </operation>

        <operation name="resetPassword">
            <documentation>Reset a user's password</documentation>
            <input  message="tns:resetPasswordRequest" />
            <output message="tns:resetPasswordResponse" />
            <fault  message="tns:InvalidIdFault" name="InvalidIdFault" />
        </operation>

        <operation name="getUserInfo">
            <documentation>Returns standard information relevant to the current user</documentation>
            <input  message="tns:getUserInfoRequest" />
            <output message="tns:getUserInfoResponse" />
        </operation>

    </portType>
    
    <!-- Soap Binding -->
    <binding name="SoapBinding" type="tns:Soap">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        
        <operation name="login">
            <soap:operation soapAction=""/>
            <input>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
           <fault name="LoginFault">
               <soap:fault use="literal"/> 
           </fault>
        </operation>
        
        <operation name="describeSObject">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidSObjectFault">
                <soap:fault use="literal"/> 
            </fault>
        </operation>
        
        <operation name="describeGlobal">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>

        <operation name="create">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:header use="literal" message="tns:Header" part="SaveOptions"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidSObjectFault">
                <soap:fault use="literal"/> 
            </fault>
        </operation>
        
        <operation name="update">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:header use="literal" message="tns:Header" part="SaveOptions"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidSObjectFault">
                <soap:fault use="literal"/> 
            </fault>
        </operation>
        
        <operation name="delete">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>

        <operation name="retrieve">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidSObjectFault">
               <soap:fault use="literal"/>
            </fault>
            <fault name="InvalidFieldFault">
               <soap:fault use="literal"/>
            </fault>
        </operation>

        <operation name="query">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidSObjectFault">
               <soap:fault use="literal"/>
            </fault>
            <fault name="InvalidFieldFault">
               <soap:fault use="literal"/>
            </fault>
            <fault name="MalformedQueryFault">
               <soap:fault use="literal"/>
            </fault>
        </operation>

        <operation name="queryMore">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidQueryLocatorFault">
               <soap:fault use="literal"/>
            </fault>
        </operation>

        <operation name="search">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidSObjectFault">
               <soap:fault use="literal"/>
            </fault>
            <fault name="InvalidFieldFault">
               <soap:fault use="literal"/>
            </fault>
            <fault name="MalformedSearchFault">
               <soap:fault use="literal"/>
            </fault>
        </operation>

        <operation name="getServerTimestamp">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>

        <operation name="setPassword">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidIdFault">
                <soap:fault use="literal"/> 
            </fault>
        </operation>

        <operation name="resetPassword">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidIdFault">
                <soap:fault use="literal"/> 
            </fault>
        </operation>

        <operation name="getUserInfo">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>

    </binding>
    
    <!-- Soap Service Endpoint -->
    <service name="SforceService">
        <documentation>Sforce SOAP API</documentation>
        <port binding="tns:SoapBinding" name="Soap">
            <soap:address location="http://aspen.salesforce.com:7925/services/Soap/u/2.0"/>
        </port>
    </service>
</definitions>


