load ./chilkat.dll
set xml [new_CkXml]
CkXml_put_Tag $xml "soap:Envelope"CkXml_AddAttribute $xml "xmlns:soap""http://www.w3.org/2003/05/soap-envelope"CkXml_AddAttribute $xml "xmlns:spr""http://www.springcm.com/atlas/webservices/v201308/scm/"CkXml_UpdateChildContent $xml "soap:Header"""CkXml_UpdateChildContent $xml "soap:Body|spr:SystemFolderGetContents|spr:token""string"CkXml_UpdateChildContent $xml "soap:Body|spr:SystemFolderGetContents|spr:systemFolder""Inbox"CkXml_UpdateChildContent $xml "soap:Body|spr:SystemFolderGetContents|spr:loadExtendedMetadata""true"CkXml_UpdateChildContentInt $xml "soap:Body|spr:SystemFolderGetContents|spr:pager|spr:StartIndex"1042CkXml_UpdateChildContentInt $xml "soap:Body|spr:SystemFolderGetContents|spr:pager|spr:PageSize"1042CkXml_UpdateChildContent $xml "soap:Body|spr:SystemFolderGetContents|spr:pager|spr:SortColumn""Name"CkXml_UpdateChildContent $xml "soap:Body|spr:SystemFolderGetContents|spr:pager|spr:SortAscending""true"# In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required. CkXml_put_EmitXmlDecl $xml 0set soapRequestBody [CkXml_getXml $xml]
set endpoint "https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx"set soapAction "http://www.springcm.com/atlas/webservices/v201308/scm/SystemFolderGetContents"# For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"set contentType "text/xml"
set http [new_CkHttp]
CkHttp_ClearHeaders $http
CkHttp_SetRequestHeader $http "Content-Type" $contentType
CkHttp_SetRequestHeader $http "SOAPAction" $soapAction
# resp is a CkHttpResponseset resp [CkHttp_PostXml $http $endpoint $soapRequestBody "utf-8"]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
puts [CkHttp_lastErrorText $http]
puts "Failed to send SOAP request."
delete_CkXml $xml
delete_CkHttp $http
exit
}
# Get the XML response body.
set responseXml [new_CkXml]
CkHttpResponse_GetBodyXml $resp $responseXml
set statusCode [CkHttpResponse_get_StatusCode $resp]
puts "response status code: $statusCode"
delete_CkHttpResponse $resp
# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.if {$statusCode != 200} then {
puts [CkXml_getXml $responseXml]
delete_CkXml $xml
delete_CkHttp $http
delete_CkXml $responseXml
exit
}
puts [CkXml_getXml $responseXml]
# Parse the successful SOAP response XML.# This is a sample of the response XML, but the namespace prefixes will be different.
# We can parse the result using "*" for the namespace prefixes (see below).set Id [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Id"]
set Name [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Name"]
set ObjectType [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:ObjectType"]
set ParentFolderId [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:ParentFolderId"]
set CreatedBy [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CreatedBy"]
set CreatedDate [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CreatedDate"]
set UpdatedBy [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:UpdatedBy"]
set UpdatedDate [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:UpdatedDate"]
set Security [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Security"]
set Description [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Description"]
set GroupName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:GroupName"]
set FieldName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:FieldName"]
set Value [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:Value"]
set HighValue [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:HighValue"]
set ExcludeFromSearch [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:ExcludeFromSearch"]
set SetName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:SetName"]
set SetNumber [CkXml_GetChildIntValue $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:SetNumber"]
set DataType [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Metadata|*:SCMMetadata|*:DataType"]
set CheckedOutUserId [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CheckedOutUserId"]
set CheckedOutUserName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CheckedOutUserName"]
set ExpirationDate [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:ExpirationDate"]
set FileSize [CkXml_GetChildIntValue $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:FileSize"]
set PDFFileSize [CkXml_GetChildIntValue $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:PDFFileSize"]
set PDFConversion [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:PDFConversion"]
set PDFPageCount [CkXml_GetChildIntValue $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:PDFPageCount"]
set IsFormDocument [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:IsFormDocument"]
set Key [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CustomFormFields|*:SCMFormField|*:Key"]
set Value [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CustomFormFields|*:SCMFormField|*:Value"]
set SetName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CustomFormFields|*:SCMFormField|*:SetName"]
set strSetNumber [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:CustomFormFields|*:SCMFormField|*:SetNumber"]
set MIMEType [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:MIMEType"]
set Version [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMDocuments|*:SCMDocument|*:Version"]
set Id [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Id"]
set Name [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Name"]
set ObjectType [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:ObjectType"]
set ParentFolderId [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:ParentFolderId"]
set CreatedBy [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:CreatedBy"]
set CreatedDate [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:CreatedDate"]
set UpdatedBy [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:UpdatedBy"]
set UpdatedDate [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:UpdatedDate"]
set Security [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Security"]
set Description [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Description"]
set GroupName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:GroupName"]
set FieldName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:FieldName"]
set Value [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:Value"]
set HighValue [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:HighValue"]
set ExcludeFromSearch [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:ExcludeFromSearch"]
set SetName [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:SetName"]
set SetNumber [CkXml_GetChildIntValue $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:SetNumber"]
set DataType [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:Metadata|*:SCMMetadata|*:DataType"]
set v_string [CkXml_getChildContent $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:SCMFolders|*:SCMFolder|*:LimitAttributeGroups|*:string"]
set TotalRowCount [CkXml_GetChildIntValue $responseXml "*:Body|*:SystemFolderGetContentsResponse|*:SystemFolderGetContentsResult|*:TotalRowCount"]
delete_CkXml $xml
delete_CkHttp $http
delete_CkXml $responseXml