k heitz
asked on
Including hashed signature in HTTP header VB6
Hi Experts -
I have VB6 code that I use to send an XML string to customer URL.
Recently, the customer asked us to include a digital signature in the header.
I've created the signature successfully and it is returned below as sDigSig.
I am not confident of the way I include the signature in HTTP header.
I've been all over the internet and have failed to find how this should be coded.
Please see the line below:
objXmlHttp.setRequestHeade r sDigSig, objDom.xml
below.
I think i need it to say something like:
objXmlHttp.setRequestHeade r "Content-Type", "hash", sDigSig
but as i mentioned - i am coming up empty w/ the way I'm searching.
Also - we prefer to send this transmission asynchronously (timing is a premium).
Is this still possible to do when using .setRequestHeader ?
Thank you
klheitz
Set objDom = CreateObject("MSXML2.DOMDo cument")
Set objXmlHttp = CreateObject("MSXML2.XMLHT TP")
objDom.async = True '07.26.13 change back to true
'02.20.14 - digital sig to embed in http header...
Dim sDigSig As String
Dim objSig As New DigitalSignature.ComClass1
sDigSig = objSig.GetSignature(strXML )
Set objSig = Nothing
objDom.loadXML
strPost = CUSTOMER_URL
objXmlHttp.Open "POST", strPost, False
'***** // commented out
' XMLHTTP.Open "POST", pstrURL, False ' False - syncronous mode
'
' XMLHTTP.setRequestHeader "Content-Type", "text/xml"
'
' XMLHTTP.setRequestHeader "X-Username", strUserName
'
'**** end comments
objXmlHttp.setRequestHeade r sDigSig, objDom.xml
objXmlHttp.Send objDom.xml
strRet = objXmlHttp.responseText
I have VB6 code that I use to send an XML string to customer URL.
Recently, the customer asked us to include a digital signature in the header.
I've created the signature successfully and it is returned below as sDigSig.
I am not confident of the way I include the signature in HTTP header.
I've been all over the internet and have failed to find how this should be coded.
Please see the line below:
objXmlHttp.setRequestHeade
below.
I think i need it to say something like:
objXmlHttp.setRequestHeade
but as i mentioned - i am coming up empty w/ the way I'm searching.
Also - we prefer to send this transmission asynchronously (timing is a premium).
Is this still possible to do when using .setRequestHeader ?
Thank you
klheitz
Set objDom = CreateObject("MSXML2.DOMDo
Set objXmlHttp = CreateObject("MSXML2.XMLHT
objDom.async = True '07.26.13 change back to true
'02.20.14 - digital sig to embed in http header...
Dim sDigSig As String
Dim objSig As New DigitalSignature.ComClass1
sDigSig = objSig.GetSignature(strXML
Set objSig = Nothing
objDom.loadXML
strPost = CUSTOMER_URL
objXmlHttp.Open "POST", strPost, False
'***** // commented out
' XMLHTTP.Open "POST", pstrURL, False ' False - syncronous mode
'
' XMLHTTP.setRequestHeader "Content-Type", "text/xml"
'
' XMLHTTP.setRequestHeader "X-Username", strUserName
'
'**** end comments
objXmlHttp.setRequestHeade
objXmlHttp.Send objDom.xml
strRet = objXmlHttp.responseText
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome.
ASKER