SOAP WSDL Generate Code

SpringCMServiceSoap12 / DocumentDownloadPreviewImage

ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

set xml = CreateObject("Chilkat_9_5_0.Xml")
xml.Tag = "soap:Envelope"
success = xml.AddAttribute("xmlns:soap","http://www.w3.org/2003/05/soap-envelope")
success = xml.AddAttribute("xmlns:spr","http://www.springcm.com/atlas/webservices/v201308/scm/")
xml.UpdateChildContent "soap:Header",""
xml.UpdateChildContent "soap:Body|spr:DocumentDownloadPreviewImage|spr:token","string"
xml.UpdateChildContent "soap:Body|spr:DocumentDownloadPreviewImage|spr:documentId","string"
xml.UpdateChildContentInt "soap:Body|spr:DocumentDownloadPreviewImage|spr:start",1042
xml.UpdateChildContentInt "soap:Body|spr:DocumentDownloadPreviewImage|spr:length",1042
xml.UpdateChildContentInt "soap:Body|spr:DocumentDownloadPreviewImage|spr:pageNumber",1042
xml.UpdateChildContent "soap:Body|spr:DocumentDownloadPreviewImage|spr:imageZoom","Thumbnail"

' 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 = 0
soapRequestBody = xml.GetXml()

endpoint = "https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx"
soapAction = "http://www.springcm.com/atlas/webservices/v201308/scm/DocumentDownloadPreviewImage"
'  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType = "text/xml"

set http = CreateObject("Chilkat_9_5_0.Http")

http.ClearHeaders 
http.SetRequestHeader "Content-Type",contentType
http.SetRequestHeader "SOAPAction",soapAction

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
If (http.LastMethodSuccess = 0) Then
    outFile.WriteLine(http.LastErrorText)
    outFile.WriteLine("Failed to send SOAP request.")
    WScript.Quit
End If

' Get the XML response body.
set responseXml = CreateObject("Chilkat_9_5_0.Xml")
success = resp.GetBodyXml(responseXml)

statusCode = resp.StatusCode
outFile.WriteLine("response status code: " & statusCode)

' If the status code does not indicate succcess, then show the response XML,
' which probably contains error information.
If (statusCode <> 200) Then
    outFile.WriteLine(responseXml.GetXml())
    WScript.Quit
End If

outFile.WriteLine(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).

DocumentDownloadPreviewImageResult = responseXml.GetChildContent("*:Body|*:DocumentDownloadPreviewImageResponse|*:DocumentDownloadPreviewImageResult")

outFile.Close
Request XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
    <soap:Header/>
    <soap:Body>
        <spr:DocumentDownloadPreviewImage>
            <spr:token>string</spr:token>
            <spr:documentId>string</spr:documentId>
            <spr:start>1042</spr:start>
            <spr:length>1042</spr:length>
            <spr:pageNumber>1042</spr:pageNumber>
            <spr:imageZoom>Thumbnail</spr:imageZoom>
        </spr:DocumentDownloadPreviewImage>
    </soap:Body>
</soap:Envelope>
Response XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
    <soap:Header/>
    <soap:Body>
        <spr:DocumentDownloadPreviewImageResponse>
            <spr:DocumentDownloadPreviewImageResult>BqozVXeZZg==</spr:DocumentDownloadPreviewImageResult>
        </spr:DocumentDownloadPreviewImageResponse>
    </soap:Body>
</soap:Envelope>