jhale
jhale

Reputation: 1830

How to connect to a WCF Service with IronPython

Has anyone done this? I've tried generating a c# proxy class and connecting through it, but I cannot figure out how to get IronPython to use the generated app.config file that defines the endpoint. It tries to connect, but I just get an error about no default endpoint. I would ideally like to make the connection using only IronPython code and not use the proxy class, if possible. The binding for the service I am trying to connect to is a NetTcpBinding if that makes any difference.

Upvotes: 2

Views: 2303

Answers (2)

Lukas Cenovsky
Lukas Cenovsky

Reputation: 5670

See my blog post. There are IronPython WCF service and client examples.

To use app.config, you probably must copy it to ipy.exe and rename it to ipy.exe.config but I have not tried it so I don't know whether it works or not.

Upvotes: 3

Jeremy Wiebe
Jeremy Wiebe

Reputation: 3963

Is your WCF service interface available in a shared assembly? If so, you could look at using the ChannelFactory to create your client proxy dynamically (instead of using the generated C# proxy). With that method you can supply all the details of the endpoint when you create the ChannelFactory and you won't require any configuration in your .config file.

Upvotes: 0

Related Questions