1
votes

I need a connection from a VISIO document to a WCF service.

I found the following very helpful tutorials:

How do I call WCF client from Excel 2003 VBA?

http://www.codeproject.com/Articles/662009/Streaming-realtime-data-to-Excel

I’ve a lot experience in creating WCF services and clients in C# - but none in VBA/VISIO-Programming. The first link helps to connect a VBA client to a WCF service and call some methods. This works perfect. We’ve a VISIO shape that acts as a button and calls a method of the WCF service and displays the result. We know how to call methods and display values. It is possible to click a button, perform a request to the server and get some results.

The problem is: how to collect results without a user that clicks the button?

VBA doesn’t support a background operation to periodically collect data from the server.

The second article describes how to push data to EXCEL using EXCEL-DNA. I couldn’t find any information whether this will also work with VISIO. EXCEL-DNA will create a *.XLL file that’s a plugin for EXCEL and I think it will not work with VISIO.

Are there any solutions to connect a VISIO client to a WCF/C# service using a ServiceCallback?

1
no there isn't any way to do this - T McKeown
I sincerely hope that you're wrong. - Sebastian Schumann
What version and edition of Visio are your using? As there are ways to connect Visio to external data sources, but are only available for Professional / Premium. - ywm
Good idea. We're using VISIO 2010 Standard :-( And we prefer to use only the viewer. - Sebastian Schumann
In that case it may be possible to wrap the viewer inside an application and use the COM api to manipulate shapes with the data. - ywm

1 Answers

1
votes

I'm pretty certain that the WCF duplex bindings are for use in WCF-only scenarios (ie, where both service and client are WCF).

The reason for this is that the way that WCF callbacks work is it causes the client also to host a temporary service endpoint for the service to call back to.

The reason the Excel solution above works is that Excel DNA is a .net wrapper which I bet uses System.ServiceModel to consume the service.

So I agree with T McKeown above when he says that there isn't any way to do this. Sorry this is not the answer you wanted.