Results 1 to 9 of 9

Thread: WCF : Invoking Methods from VBA through LAN

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    134

    Question WCF : Invoking Methods from VBA through LAN

    Hi All,

    I have created a WCF Service, with net.tcp binding. Now I made a call to this service from MS Word Macro Through VBA. For this After creating the WCF service using VS 2008, running of which started the default WCF hosting client.

    Then in the VBA macro, I have used the following code to connect to the service

    Code:
    Dim addr As String
    addr = "service:mexAddress=""net.tcp://192.168.1.53:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/Mex"","
    addr = addr + "address=""net.tcp://192.168.1.53:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/"","
    addr = addr + "contract=""IService1"", contractNamespace=""http://tempuri.org/"","
    addr = addr + "binding=""NetTcpBinding_IService1"", bindingNamespace=""http://tempuri.org/"""
    
    
    Dim service1 As Object
    Dim dataSrc As String
    Set service1 = GetObject(addr)
    dataSrc = service1.GetData()

    This was connecting to the service and invoking the mehtod GetData() and the dataSrc variable is holding the expected value.

    All this was done on my local machine but Now I want to deploy the WCF service on the LAN environment on a server so that all the MS Word Clients (for which I'll update the VBA macro) will be able to connect to the service. Also the MS Word clients in the network are varying not all are on MS Word 2003, some are on MS Word 2007 but I think there will be no issue with VBA macro execution

    I am not sure on how to acheive this. Any help would be appreciated.

    Thanks in Advance.
    Last edited by pavan; Feb 4th, 2010 at 08:54 AM.
    Pavan Kumar

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    134

    Question Re: WCF : Invoking Methods from VBA through LAN

    ^^^^^^^^^

    Any One?????
    Pavan Kumar

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: WCF : Invoking Methods from VBA through LAN

    I'm not sure what your question is - are you asking how to host your net.tcp service? If you have IIS 7, you can host it there, or if you don't, you can host it as a windows service on your production box. How is it hosted currently?

  4. #4
    New Member
    Join Date
    Feb 2010
    Posts
    3

    Re: WCF : Invoking Methods from VBA through LAN

    hey could any one please tell me how to debug a client server application, rather a wpf - wcf application on the same system?? meanin debuggin the participant code n the host code on the same system.... thnx in adv.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: WCF : Invoking Methods from VBA through LAN

    This should ideally be in its own thread so as to not hijack the original question.

    To debug - assuming you have the code open - set a breakpoint on your line of choice (F9) and press F5 to run.

  6. #6
    New Member
    Join Date
    Feb 2010
    Posts
    3

    Re: WCF : Invoking Methods from VBA through LAN

    sori for posting in the question in the wrong thread bt i dint have the time to find a proper one for my question.. well yeah debugin is done thru f9 n f5 bt then i wanted to know if thers a way of testing a client server application on the same system..

    tho thank u for ya help. ..
    God bless

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: WCF : Invoking Methods from VBA through LAN

    Yeah, it's commonly done too.

    You have Visual Studio open with your client application. You have another Visual Studio open with the service in it. Run the service solution first. It opens up in a browser and you can see its URL.

    You take that URL, put it in your client code (so when you declare the proxy class, you point it at this localhost:2394234 URL) and then run the client app. Now you've got both running locally and the client app points at the service, so you can set breakpoints and debug.

  8. #8
    New Member
    Join Date
    Feb 2010
    Posts
    3

    Smile Re: WCF : Invoking Methods from VBA through LAN

    thank u.. il try that out pretty soon.. thank u for the help once again..

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    134

    Question Re: WCF : Invoking Methods from VBA through LAN

    Apologies for the delayed response.


    It is currently hosted as a windows service, but then I dont know what to use in VBA code to call a Windows Service on the network server from a client machine.



    Quote Originally Posted by mendhak View Post
    I'm not sure what your question is - are you asking how to host your net.tcp service? If you have IIS 7, you can host it there, or if you don't, you can host it as a windows service on your production box. How is it hosted currently?
    Pavan Kumar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width