pavan
Feb 4th, 2010, 07:49 AM
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
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.
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
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.