Can I add a Service Reference with netTcpBinding in WCF?
Asked Answered
M

3

7

Is it possible to add a service reference in visual studio, which generates the local proxy class to call the WCF service when using the netTcpBinding?

As I understood it, the service reference method requires a WSDL to be exposed by the service, which is only supported by the http bindings no?

Perhaps, could I add the service reference locally in development, but then switch the configuration to use nettcp at runtime in production?

The reason I am asking is because I am hosting in a windows service (server 2003, so no WAS, and can't use IIS). And we are unable to change the permissions to do the HTTP namespace reservation ... so we can't use the HTTP bindings. NetTcp works, but in this specific case the object graph we're passing back and forth involves objects generated in the service by an EDMX model ... so we can't share it in a contract assembly.

Thanks in advance!

Marijo answered 25/2, 2010 at 15:50 Comment(0)
A
3

Simply add a binding using mexTcpBinding.

Antipole answered 26/2, 2010 at 2:56 Comment(0)
M
1

Is it possible to add a service reference in visual studio, which generates the local proxy class to call the WCF service when using the netTcpBinding?

Yes, most definitely!

As I understood it, the service reference method requires a WSDL to be exposed by the service, which is only supported by the http bindings no?

No, definitely not - WCF metadata (either its own specific format, or exposed as WSDL / XSD files) is definitely available for all SOAP-based calls - regardless of their transport.

Can you show us what you have, in terms of server-side config? Most likely, you're just missing a little config setting or something - if we see what you have, we might be able to pinpoint that and help you more!

Mcmath answered 27/2, 2010 at 9:30 Comment(0)
T
0

All bindings are exposed though WSDL. If you add the NETTCP bindings svcutil will atuo generate the client correctly. I haven't used it in the ADD reference in VS as i have always preferred to generate the class with svcutil.

Tweeddale answered 26/2, 2010 at 2:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.