none
Consume Web Service via Word 2010 template RRS feed

  • Question

  • In process of migrating from Word 2003 to Word 2010 which includes updating a template.
    The template uses "Microsoft Office Soap Type Library v3.0" to consume a web service.

    The only references I can find regarding consuming web services via "Word 2010" is by
    using VSTO.

    In Word 2003, I was able to include all the needed functionality in the template which
    is placed in a network folder specified by "Workgroup templates" which made it ideal in regards
    to providing this functionality to all users of our network.

    What options are available in Word 2010?

    Thanks in advance for your assistance.
    Tim


    Tim
    Thursday, March 24, 2011 8:01 PM

Answers

  • Hi Tim,

    We fully understand your hesitation to using the Soap toolkit that was deprecated 6 years ago. And, as we advised at the top of this thread using .Net is the supported alternative. You could create a smaill .Net component (wrapper) and then call the functions within it from your VBA project.

     

    One thing we noted in your code is that you are referencing MSOSOAP and it should be MSSOAP.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Suppor
    Monday, April 4, 2011 4:28 PM
    Moderator

All replies

  • Hi Tim,

    Thank you for posting.

    As for your problem, please take a look at these threads:

    http://social.msdn.microsoft.com/Forums/en/worddev/thread/011dddcc-9c39-4154-9a47-1f61456703b5

    http://social.msdn.microsoft.com/Forums/en/vsto/thread/a43a2547-5d56-4936-b53f-facd9f3e3e7b

    They all introduce consuming web serice via VSTO. I hope you can get some useful information from them and just feel free to follow up after you have tried the steps.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 25, 2011 2:20 AM
  • Bruce,

    Thanks for the info, but both of these utilize VSTO which requires an add-in.

    I am looking for a way to consume web services from within a template like I have in Word 2003.

    Thanks


    Tim
    Friday, March 25, 2011 2:34 PM
  • Can web services be consumed directly from a Word 2010 template or is a VSTO add-in required?


    Tim
    Wednesday, March 30, 2011 4:15 PM
  • Hi Tim,

    I have involved someone who may be more familiar with your problem. Perhaps there might be some delay. Appreciate your patience.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 31, 2011 6:52 AM
  • Hi Bruce,

    We have verified that you can access a Web Service directly from Word 2010 using only VBA. We used the same Soap Type Library that you mentioned above.

    Are you getting errors running your code?

    Is there any other information that you can add?

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Support
    Thursday, March 31, 2011 9:21 PM
    Moderator
  • Hi Bruce & Harold,

    It has been a while since I installed "Microsoft Office Soap Type Library v3.0" on my XP/Office 2003 machine so I am not sure but I think I used the link below.

    I am working with Word 2010 on a Windows 7 machine. When I download\run the link on my Windows 7 machine, I get the following:\

    Installer Information
    You must install Microsoft Office 2003 and Visual Basic for Applications before you can install Office 2003 Web Service Toolkit.

    I have Office 2010 with VBA installed.

    Looking forward to your response.

    Microsoft Office 2003 Web Services Toolkit 2.01
    http://www.microsoft.com/downloads/en/confirmation.aspx?familyid=fa36018a-e1cf-48a3-9b35-169d819ecf18&displaylang=en

     


    Tim
    Thursday, March 31, 2011 10:13 PM
  • Hi Tim,

    You don't need the toolkit. All that is required is the Soap Type Library 3.0.

    The toolkit can be downloaded from here

    http://www.microsoft.com/downloads/en/details.aspx?familyid=fa36018a-e1cf-48a3-9b35-169d819ecf18&displaylang=en

    After it installs you can set a reference to Microsoft Soap Type Library v3.0 in your VBA project.

     

     

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Support
    Thursday, March 31, 2011 10:35 PM
    Moderator
  • Harold,

    Tried your link and got the same result.

    Installer Information
    You must install Microsoft Office 2003 and Visual Basic for Applications before you can install Office 2003 Web Service Toolkit.

    I understand that I only need the Soap Type Library.


    Tim
    Thursday, March 31, 2011 10:48 PM
  • Hi Tim

    my bad :(

    Try this link

    http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C943C0DD-CEEC-4088-9753-86F052EC8450&displaylang=en

    It's not supported but it is still available for download.

    I went there on a different Win7 machine with Office 2010 and it downloaded and installed.

    In Word's VBE I was able to add a reference to the MS Soap Type Library v3.0.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Support
    Friday, April 1, 2011 1:16 AM
    Moderator
  • Harold,

    I downloaded and installed the SOAP Toolkit 3.0.

    ************************************************
    Question 1
    The link for 'SOAP Toolkit 3.0' states that it is deprecated by .NET Framework and will be retired in April 2005. The template/application that I am migrating from Word 2003 to Word 2010 is used by several hundred users.

    Shouldn't I be hesitant to use references that have been deprecated for over 5 years?

    ************************************************
    Question 2
    The following details the error that I am getting when I try to use the 'Microsoft Soap Type Library v3.0'. In Word 2003, a 'Web Service References...' is available under Tools that allows specifying a wsdl and generates class modules for connecting to the web service. In Word 2010, this is not available.

    What is the supported method for consuming web services from a Word 2010 template?

    Current: XP/Word 2003, Using 'Microsoft Office Soap Type Library v3.0'
    New: Windows 7/Word 2010, Using 'Microsoft Soap Type Library v3.0

    Error:
    Program Line throwing error:
    sc_ProcSvcs.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT, c_SERVICE_NAMESPACE
    where sc_ProcSvcs is SoapClient30

    Err.Description:
    WSDLService:The PROGID MSOSOAP.GenericCustomTypeMapper30 is invalid HRESULT=0x800401F3: Invalid class string
     - WSDLReader:Analyzing the WSML file failed HRESULT=0x800401F3: Invalid class string
     - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800401F3: Invalid class string

    I am using the same code as in XP/Word 2003 which utilizes several types:
      Dim str_WSML As String
      str_WSML = "<servicemapping>"
      str_WSML = str_WSML & "<service name='ProcSvcs'>"
      str_WSML = str_WSML & "<using PROGID='MSOSOAP.GenericCustomTypeMapper30' cachable='0' ID='GCTM'/>"
      str_WSML = str_WSML & "<types>"
      str_WSML = str_WSML & "<type name='CopyholderType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_CopyholderType'/>"
      str_WSML = str_WSML & "<type name='EDMSFrmType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_EDMSFrmType'/>"
      str_WSML = str_WSML & "<type name='EDMSInfoType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_EDMSInfoType'/>"
      str_WSML = str_WSML & "<type name='EDMSVersionType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_EDMSVersionType'/>"
      str_WSML = str_WSML & "<type name='FileFrmType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_FileFrmType'/>"
      str_WSML = str_WSML & "<type name='NewRev_Type' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_NewRevType'/>"
      str_WSML = str_WSML & "<type name='OTSCType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_OTSCType'/>"
      str_WSML = str_WSML & "<type name='OraOTSC_Type' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_OraOTSCType'/>"
      str_WSML = str_WSML & "<type name='PCR_Type' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_PCRType'/>"
      str_WSML = str_WSML & "<type name='PCR_TypeDateStrings' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_PCRTypeDateStrings'/>"
      str_WSML = str_WSML & "<type name='ProcNavPrinterType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_ProcNavPrinterType'/>"
      str_WSML = str_WSML & "<type name='ProcNavPropertyType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_ProcNavPropertyType'/>"
      str_WSML = str_WSML & "<type name='ScanSheetType' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_ScanSheetType'/>"
      str_WSML = str_WSML & "<type name='TOC_Type' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_TOCType'/>"
      str_WSML = str_WSML & "<type name='WordDocInfo' targetNamespace='http://DCPP.Procedures.org/' uses='GCTM' targetClassName='struct_WordDocInfo'/>"
      str_WSML = str_WSML & "</types>"
      str_WSML = str_WSML & "</service>"
      str_WSML = str_WSML & "</servicemapping>"


    Tim
    Monday, April 4, 2011 1:57 PM
  • Hi Tim,

    We fully understand your hesitation to using the Soap toolkit that was deprecated 6 years ago. And, as we advised at the top of this thread using .Net is the supported alternative. You could create a smaill .Net component (wrapper) and then call the functions within it from your VBA project.

     

    One thing we noted in your code is that you are referencing MSOSOAP and it should be MSSOAP.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Harold Kless Microsoft Online Community Suppor
    Monday, April 4, 2011 4:28 PM
    Moderator
  • Harold,

    The MSOSOAP reference was inserted by the wizard that created the classes
    in Word 2003. I tried changing it to MSSOAP and it did resolve the error on that line,
    but throws a 'Connector:The property EnableAutoProxy cannot be read....Access is denied'
    when a web service call is made.

    Rather than using this deprecated type library, I will try building a .NET Add-in
    to make the calls to the web service. Just seems like a step backward from 2003.

    Truly appreciate all of your help & patience.
    Thanks,
    Tim

     


    Tim
    Monday, April 4, 2011 5:02 PM