LOCAL loXml
LOCAL lcSoapRequestBody
LOCAL lcEndpoint
LOCAL lcSoapAction
LOCAL lcContentType
LOCAL loHttp
LOCAL loResp
LOCAL loResponseXml
LOCAL lnStatusCode
LOCAL lcBinaryoutput
LOCAL lcDescription
LOCAL lcDstPath
LOCAL lcReturn_code
LOCAL lcStatus
LOCAL lcStream
loXml = CreateObject('Chilkat_9_5_0.Xml')
loXml.Tag = "soapenv:Envelope"
loXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loXml.AddAttribute("xmlns:aru","http://arubasignservice.arubapec.it/")
loXml.UpdateChildContent("soapenv:Header","")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:binaryinput","BqozVXeZZg==")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:certID","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:dstName","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:delegated_domain","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:delegated_password","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:delegated_user","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:ext_auth_blobvalue","BqozVXeZZg==")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:ext_auth_value","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:ext_authtype","SMS")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:otpPwd","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:typeHSM","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:typeOtpAuth","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:user","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:identity|aru:userPWD","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:notify_id","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:notifymail","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:profile","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:requiredmark","true")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:session_id","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:signingTime","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:srcName","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:stream","BqozVXeZZg==")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:transport","BYNARYNET")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:tsa_identity|aru:password","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:tsa_identity|aru:user","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:tsa_identity|aru:tsaurl","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:SignRequestV2|aru:signatureLevel","string")
loXml.UpdateChildContent("soapenv:Body|aru:addpkcs7sign|aru:detached","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.
loXml.EmitXmlDecl = 0
lcSoapRequestBody = loXml.GetXml()
lcEndpoint = "https://arss.demo.firma-automatica.it/ArubaSignService/ArubaSignService"
lcSoapAction = ""* For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
lcContentType = "text/xml"
loHttp = CreateObject('Chilkat_9_5_0.Http')
loHttp.ClearHeaders()
loHttp.SetRequestHeader("Content-Type",lcContentType)
loHttp.SetRequestHeader("SOAPAction",lcSoapAction)
loResp = loHttp.PostXml(lcEndpoint,lcSoapRequestBody,"utf-8")
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
? "Failed to send SOAP request."RELEASE loXml
RELEASE loHttp
CANCELENDIF* Get the XML response body.
loResponseXml = CreateObject('Chilkat_9_5_0.Xml')
loResp.GetBodyXml(loResponseXml)
lnStatusCode = loResp.StatusCode
? "response status code: " + STR(lnStatusCode)
RELEASE loResp
* If the status code does not indicate succcess, then show the response XML,
* which probably contains error information.IF (lnStatusCode <> 200) THEN
? loResponseXml.GetXml()
RELEASE loXml
RELEASE loHttp
RELEASE loResponseXml
CANCELENDIF
? loResponseXml.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).
lcBinaryoutput = loResponseXml.GetChildContent("*:Body|*:addpkcs7signResponse|*:return|*:binaryoutput")
lcDescription = loResponseXml.GetChildContent("*:Body|*:addpkcs7signResponse|*:return|*:description")
lcDstPath = loResponseXml.GetChildContent("*:Body|*:addpkcs7signResponse|*:return|*:dstPath")
lcReturn_code = loResponseXml.GetChildContent("*:Body|*:addpkcs7signResponse|*:return|*:return_code")
lcStatus = loResponseXml.GetChildContent("*:Body|*:addpkcs7signResponse|*:return|*:status")
lcStream = loResponseXml.GetChildContent("*:Body|*:addpkcs7signResponse|*:return|*:stream")
RELEASE loXml
RELEASE loHttp
RELEASE loResponseXml