Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Where can I find some good examples on how to use pocket soap and VBA

42 views
Skip to first unread message

BobAlston

unread,
Apr 18, 2011, 9:59:22 AM4/18/11
to
I am a vba programmer. I used Office xml toolkit with success until I
came across a web service that required authentication in the soap
header. Since the microsoft soap toolkit was deprecated, I finally
cobbled together a solution. I used the published soap sample and then
used code to modify the date range and document type I wanted and sent
it. My soap code is:

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<CMBHSAuthenticationHeader xmlns="http://www.???xomething???.com/cmbhs/">
<CMBHSPassword>mypassword</CMBHSPassword>
<CMBHSUserName>myid</CMBHSUserName>
</CMBHSAuthenticationHeader>
</soap12:Header>
<soap12:Body>
<DownloadDocument xmlns="http://www.???xomething???.com/cmbhs/">
<parameter>
<ParentOrganizationNbr>1736</ParentOrganizationNbr>
<OrganizationNbr>1736</OrganizationNbr>
<FromDate>##########</FromDate>
<ToDate>$$$$$$$$$$</ToDate>
<DownloadType>##</DownloadType>
<DownloadDateType>2</DownloadDateType>
</parameter>
</DownloadDocument>
</soap12:Body>
</soap12:Envelope>

My VBA code:
...... insert record number and dates in above soap text ....

' load XML/Soap document from string
xmldoc.loadxml (XMLConnectString)

'Create the xmlhttp object
Dim xmlhttp
'''''Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.setTimeouts 5000, 5000, 180000, 3600000
'Open a connection and send a request to the server

Call xmlhttp.Open("POST",
"https://cmbhs.dshs.state.tx.us/cmbhswebservice/Service/DownloadService.asmx",
False)

' Send XML/SOAP document
Call xmlhttp.Send(xmldoc)

'Create an xml document object, and load the server's response
Set xmlresponse = CreateObject("Microsoft.XMLDOM")
xmldoc.async = False
' Set response string with XML/Soap response
ResponseText = xmlhttp.ResponseText

Where can I find some good examples on how to use pocket soap and VBA to
create the XML message and send it??

Thanks

Bob

0 new messages