SOAP Call from VBA?

Can anyone point me to some good examples online of how to make a SOAP
call from VBA in access?  I am using Access 2003 and would like to be
able to submit an XML file via a SOAP call and get the result message
back.
0
ghetto_banjo
11/18/2009 9:06:57 PM
access 16762 articles. 2 followers. Follow

1 Replies
3915 Views

Similar Articles

[PageSpeed] 23

You can find the web services add-in for access 2003 here:

http://www.microsoft.com/downloads/details.aspx?familyid=FA36018A-E1CF-48A3-9B35-169D819ECF18&displaylang=en


In many cases, you find it better off to use the msXML library in place of
the soap add-in.

It a lot less code

try:

Public Sub GetQuote2()

     Dim objXML           As Object
     Dim strSymbol        As String
     Dim strURL           As String
     Dim strWFormat       As String

     Set objXML = CreateObject("MSXML2.XMLHTTP")

     strURL = "http://ca.finance.yahoo.com/d/quotes.csv?s="
     strWFormat = "&f=sl1d1t1c1ohgv&e=.csv"


     strSymbol = "MSFT"

     objXML.Open "GET", strURL & strSymbol & strWFormat, False
     objXML.Send

     Debug.Print "Symbol = " & Split(objXML.ResponseText, ",")(0)
     Debug.Print "Trade  = " & Split(objXML.ResponseText, ",")(1)
     Debug.Print "Date   = " & Split(objXML.ResponseText, ",")(2)

  End Sub

Output when above run:

Symbol = "MSFT"
Trade  = 24.62
Date   = "9/4/2009"

The above code example happens to "GET" a CSV file, but in most cases that
web service will give you a xml file or even document. Using the MSXML
library also means you have full xml parsing at your fingertips.

You can/could also write out the xml text string to a local file and use the
XML import features we have in ms-access.

In most cases I think the above is FAR LESS work then the soap web tool kit.
and the main problem with the soap kit is it generates class modules for
each property/method of the xml service. While having inti-sense during
development is nice, adding additional web features or removing them
if the web services side is under development makes things somewhat painful
on the ms-access side to maintain that code base. Often several additional
class modules need be to added for each new method of the web service.
And, changes in the web services can often break the access side of code.


-- 
Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com


0
Albert
11/19/2009 1:05:32 AM
Reply:

Similar Artilces:

Make Unlimited FREE Calls!
Make Unlimited FREE Calls! Join Green Win Network and when you are ready to make unlimited free calls simply register your number and that,s it. You can now make free calls to anyone in the Green Win Network who has also signed up for the GWN Telecoms Services and enjoy massively discounted calls to any other number.You can even invite all of the contacts on your telephone address book instantly?our system takes care of the rest for you. http://affiliates.greenwinnetwork.com/users/ref/ohmmani Here's how it works? * When your contacts sign for the GWN Telecoms Serives you...

VBA Comment question
Dear Friends, I need some help on this: 1) How can I change, via vba, the initials property of the author of the current doc. I am making different types of comments and want them under different initials. Going to options and changing manually is very tedious. 2) When viewing comments the text the comment is referring to is highlighted by the comment color. How can I get the highlighted text into a variable? Thank you Susan -- Change dead to live and you got my email address. To change the Author and initials of all of the comments, use Dim acomment As Comment ...

view excel vba code for built in functions
Anyone know how to view the code for the fuction Trim() or Trim$()? Specifically in Excel. It's not removing the &nbsp from html pages I copy forom, soI had to write my own code as a work around. So, I want to see the existing Trim() & Trim$() code to see if it is including the &nbsp in it's search for whitespace. ...

Macro Calling Visual Basic References
Can a Macro be created that will call Visual Basic up and set the references to a specific setting? Specifically, I want to be able to create a Macro that will add-in the Solver, then open visual basic and include the Solver in the references so that the user does not have to know how to do this. Thanks. -- phauenstein Here's a thread with a couple of options: http://groups.google.co.uk/group/microsoft.public.excel.programming/browse_frm/thread/6274fe6f1b0edf25/ca36160ca7665c10?lnk=st&q=%22SolverInstall%22+group:*excel*+author:delouis&rnum=3&hl=en#ca36160ca7665c10 or ht...

soap call
I am getting this very ambiguous error when I am making SOAP call. Open failed. Please check the connection information. HTTP Error (null) Unknown: This error code is not recognized. Has anyone seen this before? Thanks. ...

Remote Procedure Call
I have a new laptop for work with XP Professional and XP Outlook. However, I have continuous problems with outlook just closing down for no reason. Other times it will remain open but as soon as I click on send the error message 'Remote Procedure Call failed' and then outlook closes. Somebody else within our company has now upgraded to XP and also suffers exactly the same problem. It has completely stumbled our IT manager and a third party IT specialist. Could you shed any light? PLEEEEEEEEEEASE!!!! Once the problem has occurred Outlook will continue to fail. The only fix ...

Can a VBA UDF tell who called it?
Is there a way that a UDF can tell who called it? If it was called from a worksheet cell, I'd like to know the name of the workbook, name of the sheet, and the cell address. Function test() test = Application.Caller.Parent.Parent.Name & " " & Application.Caller.Parent.Name & " " & Application.Caller.Address End Function -- Kind regards, Niek Otten Microsoft MVP - Excel "Prof Wonmug" <wonmug@e.mcc> wrote in message news:tjhkk5hr1a0d8l485gitfume19lpthq325@4ax.com... > Is there a way that a UDF can tell who call...

Service Call Escalations
Hi, I am trying to get service call escalations to work so that an email is sent when an escalation is done. Please help with the steps required. I am using the vs10 fabrikam database. To date I have: 1. Setup a service call escalation - from status Entered to Dispatched assigned to technician NEIL. This technician has been setup to use service the items found under the equipment configuration for the equiment piece on the service call. The technician also has a schedule of 8am-5pm each day. An email address has been setup for this technician. 2. Created a service call and assigned it to...

NEED HELP:Soap error: operation requested in the Soap message with soapAction isn't defined in the WSDL file.
Hi all, I need some help. We have an application which is using SOAP to relay messages between two applications. We are having a problem, which started to only occur intermittently, but now happens all of the time. When communicating between the apps, we receive this message... Soap error: The operation requested in the Soap message with soapAction <http://tempuri.org/FormAPI/action/COutlookForm.isCateringAvailable> isn't defined in the WSDL file. This may be because it is in the wrong namespace or has incorrect case. The SOAP sender application is a VB6 COM dll hosted in a...

excel vba
I don't know what is wrong with this. I am trying to set it up so tha when i click the command button, it will save it to my documents and i will save the file name as the contents in cell K5. If it is being used for an invoicing program and the contents of K will be changing with each transaction, will this code be set up s that it will keep the original sheet as a sort of template, and onl save the file each time as the new number that will be generated? doe that make sense? Private Sub CommandButton1_Click() Sheet1.SaveAs("H:\MyDocs\", (Range("K5").Value) End Su ...

Excel 2007: Pivot tables "Invalid procedure call or argument"
Hi all I'm having problems with pivot tables and coding that worked fine in XL03 but is failing in XL07. My code fails when I attempt to set the CurrentPage. I can manually change the CurrentPage to the value that my code is attempting, and then the code works. I can manually change the CurrentPage back again to its original value and the code works again. It makes no sense why it's not working. The line of code failing is this: pt.PivotFields("Month").CurrentPage = CStr(12) Thanks in advance Paul Martin Melbourne, Australia ...

runtime error '5' invalid procedure call or argument
hi! We had successfully generated the frx report in drilldown viewer with no errors. However, when we export it to excel the error 'Run-time error '5' Invalid procedure call or argument' appeared. I have checked the formats and there's nothing wrong with it. It is FRx 6.5 with the latest service pack installed (sp7). Hope someone can help me. Thanks, Mel ...

Refresh calling form
My main form opens a form that makes changes to the data bound to a subform in my main form. Trying to keep everything as generic as possible, what I want to do is something like this: if strParentName <> "" Then if CurrentProject.AllForms(strParentName).Isloaded Then Forms(strParentName).Filter=Forms(strParentName).Filter (forces refresh) For each <subform> in <Parent form reference> <force a refresh of that subform> Next <subform> endif endif What's the syntax for the "for each..." structure? T...

VBA Question
I have written a VBA Panel with one of the buttons being a page upand page down button using the following code Private Sub CommandButton26_Click() On Error Resume Next With ActiveWindow.View Call .GotoSlide(.Slide.SlideIndex + 1) End With End Sub The code works in the slide view but not the slide master view. What am I missing? What would you expect it to do in Master view? (There are no slides to goto in this view) -- john ATSIGN PPTAlchemy.co.uk Free PPT Hints, Tips and Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_...

call workflow
How to make a call from workflow in c # or javascript. The workflow engine in CRM will only call .net assemblies, so you would have to write one in C#, using the .net 1.1 framework. You can download the CRM SDK, which includes sample code in C# and VB.Net to call assemblies from workflow. http://www.microsoft.com/downloads/details.aspx?familyid=9C178B68-3A06-4898-BC83-BD14B74308C5&displaylang=en -- Richard Riddle CRM Developer Autonomix "Rick" wrote: > > > How to make a call from workflow in c # or javascript. > ...

VBA Editor Menu Bar and Toolbar disappears
Sometimes when I am using the VBA Editor, the view changes, making the Toolbars and Menu Bar disappear. What can i do to prevent this from occurring, and how can I get back to a normal view, other than closing it out? Also, if i open the VBA Editor, and then close it, it will reopen on its own. Can this be prevented? Thanks... Tonso ...

04: HOLD-CALL (CC Error Message)
I have researched the Hold-Call issue on source, but can not find any info. I know this is all cc setup related, but if anyone has any info on what exactly the Hold-Call error is, this is usually helpful when working with the issuing company. -- Jocelyn This is a multi-part message in MIME format. ------=_NextPart_000_0147_01C86A61.63EFEFE0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0148_01C86A61.63EFEFE0" ------=_NextPart_001_0148_01C86A61.63EFEFE0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Jocely...

Soap client
Hello. How could I consume Web services created using c# with soap client written on c++6.0 ? I can't use .net on client app. Thanks in advance. Look for the COM-based SOAP Toolkit on the MSDN download web site [0]. Check out the MSDN Library [1] for some articles on interoperability issues. -- HTH Christoph Schittko [MVP] Software Architect, .NET Mentor [0] http://www.msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/948/msdncompositedoc.xml [1] http://msdn.microsoft.com/library "Ulan" <usametov@hotmail.com> wrote in messa...

What VBA function returns cell 2 from which cell 1 gets its value?
This is a simple and possibly embarrassing question. In Excel 2002 SP3, cell 1 is on ProfitSheet and depends on cell 2, on a different sheet. Cell 1 has a UDF, so it looks like: "=MassageData(SalesSheet!$A$1)" Given that I know cell 1 at runtime, what VBA function returns cell 2? I have tried: Set Cel2 = Cel1.Precedents(1) Set Cel2 = Cel1.Precedents.Cells(1, 1) etc. but that only seems to return Cel1 itself (at least that's what the Debug Window shows). 1) Is my syntax wrong? 2) Is Excel's lack of external dependent/precedent functionality in my...

Parse XML-SOAP
I´m looking about how to parse an XML-SOAP document to retrieve some data from this. I dont know about how can do this ¿with XMLDOM?, ¿with XMLReader?. Here is an example of the document that the webservice sends to me. The structure of the nodes is too strange for me, for example the 'row name='. Here is the document: <?xml version="1.0" encoding="UTF-8" ?> - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org...

Sumproduct formula works in spreadsheet, NOT VBA. Help please
Basically, I want to replace this formula with VBA Code I can get this one to work to sum =SUMPRODUCT(--(DataTime="First day of employment (Time 1)"),--(DataPosition=N6),(DataQuestion1) When I change this to Count rather than Sum, my Code Evaluates as an Error =SUMPRODUCT(--(DataTime="First day of employment (Time 1)"),--(DataPosition="Registered Nurse"),--(DataQuestion1<>"*")) The only line of code I switch out is the last mFormula row. The line of code that works I've commented out. I am really stumped... This is the cod...

VBA References Question
As I have never worked with Referenced Workbooks I have a questions before I get too deep into it. The referenced workbook automatically opens when the source workbook is opened. I wanted two workbooks so I could keep the source workbook's size small. When the source workbook is the focus and the user clicks on "file, send to": will it only send the source document and not the referenced document. If the referenced document is sent too, it will defeat my purpose???? SDC ...

XMLTextWriter and SOAP
Hi guys, I have a task to do where I need to write an XML file into SOAP format. I use XMLTextWriter in order to write my strings to the XML file, but I must convert somehow this xml into SOAP. How can I do that ? Is there a way to do it without hardcoding SOAP attributes and elements ? As exemple, a function that would receive a stream and convert the stream to SOAP...I don't really know where to look so this is why I post here :) Thanks guys, Guillaume Sorry, I forgot to mention that I'm using VB.Net and must not serialize by using SoapFormatter object. ...

SOAP Error 04-25-05
Hi everybody. I have an error when I try to open Workflow Manager (same error in Workflow Monitor) "An error ocurred when charge the configuration of Number Format, Datetime, etc..." When I go to "http://<MyServer>/mscrmservices/bizorganization.srf" i have the next error... <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP:Body> <SOAP:Fault> <faultcode>SOAP:Client</faultcode> <faultstring>SOAP Invalid Request</faultstring> <deta...

SOAP error
I am getting this error when I am making SOAP call to a webservice. I am using perl - SOAPLite HTTP/1.1 500 (Internal Server Error) Internal Server Error. Cache-Control: private Date: Tue, 07 Feb 2006 14:49:36 GMT Server: Microsoft-IIS/6.0 Content-Length: 476 Content-Type: text/xml; charset=utf-8 Client-Date: Tue, 07 Feb 2006 14:48:27 GMT Client-Peer: x.x.x.x Client-Response-Num: 1 X-AspNet-Version: 1.1.4322 X-Powered-By: ASP.NET <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi= "...