|
-
Feb 4th, 2010, 08:49 AM
#1
Thread Starter
Addicted Member
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
-
Feb 8th, 2010, 12:09 PM
#2
Thread Starter
Addicted Member
Re: WCF : Invoking Methods from VBA through LAN
-
Feb 17th, 2010, 06:17 PM
#3
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?
-
Feb 18th, 2010, 12:36 PM
#4
New Member
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.
-
Feb 24th, 2010, 01:07 AM
#5
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.
-
Feb 24th, 2010, 04:13 AM
#6
New Member
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
-
Feb 25th, 2010, 03:06 AM
#7
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.
-
Feb 25th, 2010, 07:02 PM
#8
New Member
Re: WCF : Invoking Methods from VBA through LAN
thank u.. il try that out pretty soon.. thank u for the help once again..
-
Mar 8th, 2010, 03:11 AM
#9
Thread Starter
Addicted Member
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.
 Originally Posted by mendhak
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|