func chilkatTest() {
let xml = CkoXml()
xml.Tag = "soap:Envelope"
xml.AddAttribute("xmlns:soap", value: "http://www.w3.org/2003/05/soap-envelope")
xml.AddAttribute("xmlns:spr", value: "http://www.springcm.com/atlas/webservices/v201308/scm/")
xml.UpdateChildContent("soap:Header", value: "")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:token", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Id", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Name", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:ObjectType", value: "Document")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:ParentFolderId", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CreatedBy", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CreatedDate", value: "dateTime")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:UpdatedBy", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:UpdatedDate", value: "dateTime")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Security", value: "list of enumerated string values")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Description", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:GroupName", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:FieldName", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:Value", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:HighValue", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:ExcludeFromSearch", value: "true")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:SetName", value: "string")
xml.UpdateChildContentInt("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:SetNumber", value: 1042)
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Metadata|spr:SCMMetadata|spr:DataType", value: "String")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CheckedOutUserId", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CheckedOutUserName", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:ExpirationDate", value: "dateTime")
xml.UpdateChildContentInt("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:FileSize", value: 123456)
xml.UpdateChildContentInt("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:PDFFileSize", value: 123456)
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:PDFConversion", value: "true")
xml.UpdateChildContentInt("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:PDFPageCount", value: 1042)
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:IsFormDocument", value: "true")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CustomFormFields|spr:SCMFormField|spr:Key", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CustomFormFields|spr:SCMFormField|spr:Value", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CustomFormFields|spr:SCMFormField|spr:SetName", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:CustomFormFields|spr:SCMFormField|spr:SetNumber", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:MIMEType", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:document|spr:Version", value: "string")
xml.UpdateChildContent("soap:Body|spr:DocumentCreateBeginWithFolder|spr:md5Hash", value: "BqozVXeZZg==")
// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
xml.EmitXmlDecl = falsevar soapRequestBody: String? = xml.GetXml()
var endpoint: String? = "https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx"var soapAction: String? = "http://www.springcm.com/atlas/webservices/v201308/scm/DocumentCreateBeginWithFolder"// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"var contentType: String? = "text/xml"let http = CkoHttp()
http.ClearHeaders()
http.SetRequestHeader("Content-Type", value: contentType)
http.SetRequestHeader("SOAPAction", value: soapAction)
var resp: CkoHttpResponse? = http.PostXml(endpoint, xmlDoc: soapRequestBody, charset: "utf-8")
if http.LastMethodSuccess == false {
print("\(http.LastErrorText)")
print("Failed to send SOAP request.")
return
}
// Get the XML response body.let responseXml = CkoXml()
resp!.GetBodyXml(responseXml)
var statusCode: Int = resp!.StatusCode.intValue
print("response status code: \(statusCode)")
resp = nil// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.if statusCode != 200 {
print("\(responseXml.GetXml())")
return
}
print("\(responseXml.GetXml())")
// 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).var FileIdentifier: String? = responseXml.GetChildContent("*:Body|*:DocumentCreateBeginWithFolderResponse|*:DocumentCreateBeginWithFolderResult|*:FileIdentifier")
var PDFFileIdentifier: String? = responseXml.GetChildContent("*:Body|*:DocumentCreateBeginWithFolderResponse|*:DocumentCreateBeginWithFolderResult|*:PDFFileIdentifier")
var ContentFileIdentifier: String? = responseXml.GetChildContent("*:Body|*:DocumentCreateBeginWithFolderResponse|*:DocumentCreateBeginWithFolderResult|*:ContentFileIdentifier")
var ChunkSize: Int = responseXml.GetChildIntValue("*:Body|*:DocumentCreateBeginWithFolderResponse|*:DocumentCreateBeginWithFolderResult|*:ChunkSize").intValue
}