.NET Framework Bookmark and Share   
 index > ASMX Web Services and XML Serialization > SOAP from VBA. Many tries, many errors
 

SOAP from VBA. Many tries, many errors

Hi

I'm struggling to utilise Web Services from VBA. I have a number of starting points, the furthest of which gets to:
The security requirements are not satisfied because the security header is not present in the incoing message
This is acheived with the following extract:

'Define Services
   Dim PartService
   Set PartService = CreateObject("MSSOAP.SoapClient30")
   c_WSDL_URL = RegKeyRead("HKEY_CURRENT_USER\Software\WebServices\WSDL\PartService")
   PartService.MSSoapInit c_WSDL_URL

I've also tried MS SOAP Toolkit 3, though this causes a huge number of problems as detailed here . The function here seems to have the start of something too.

Nothing I have found seems to be capable of using complex types, or providing authentication credentials. In vb.net you can do the whole thing in a few lines, but I need this in VBA to plug into a CAD application.

All I really want is to be able to say:

WebServiceWSDL = x
WebServiceMethod = y
Input = z<br/>
Output = returnedXML
And Input will eventually need to be able to pass a complex type (a schema), though it'd eb nice to get anything working to start with.

I've uploaded the WSDL , incase I have missed anything.

Thanks
m4r5
The SOAP toolkit was retired in April of 2005. Have you considered using Visual Studio's Add Web Reference functionality to generate a managed web service client, and then exposing that client to VBA via .NET COM Interop? That might be the best way to go, especially if you need to support advanced security scenarios.

Hope that helps
-steve
Brain.Save() -- http://hyperthink.net/blog
Steve Maine
Hi Steve.

Thanks for the info.

That does sound like a good plan. However, I don't want to embark upon a mammoth sized mission to link .NET and COM objects only to find out that things still don't work. And I actually have no idea how I would begin something like that, but I shall try to find some guides.

Actually, no, I really have no idea how that would work. So I'd have a VBA program and a VB.Net program running at the same time passing variables between them? No, that's way beyond me at the moment. Can the VB.Net program be called as a function from the VBA program? It seems like an awful lot to implement to achieve a fairly simple task, and it still doesn't get me any further with passing in a complex type over SOAP.

Thanks

Dave
m4r5

You can use google to search for other answers

Custom Search

More Threads

• Order of webmethods
• Missing Controls In Design View(A strange question)
• Setter never called on serialized generic list?
• Xml Desrialization event
• Imporsnated user has limitted rights? or some thing wrong ?
• Construction Using in Web Services
• ASP.NET PDF Document Library Online
• Web Service display
• WSE 2.0 CustomXmlSecTokenCode Solution Issue
• XmlInclude / SoapInclude error when trying to use custom header