1

I am trying to implement a demo to communicate between two applications on a same machine. So I choose Net​Named​Pipe​Binding. And the doc of it shows that we need to assign the base address like 'http://localhost:8000/uesamples/service'

in

https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.netnamedpipebinding?view=netframework-4.7.

But I prefer not to use the port.

So is it possible that we can define the base address in another way?

Abdul
  • 2,002
  • 7
  • 31
  • 65
kunyang
  • 61
  • 5
  • 2
    NamedPipe bindings have no port. You have copied the wrong URL from the link you've shown (that's a HTTP binding, hence the `http://` scheme). A valid URI for the named pipe binding starts with "net.pipe"; incidentally the very next line in the sample from the linked page (`string address = "net.pipe://localhost/uesamples/calc";`).. – Christian.K Jun 12 '17 at 11:42
  • Yes, but I'm still confused that the url of base address is 'http://' in the sample from the linked page. If NamedPipe bindings do not need port, why do they use the base address like that? – kunyang Jun 13 '17 at 03:17
  • The base address will only be applied to those (endpoint) addresses that are _relative_. Additionally, a service can have multiple end points with different protocols. Typically, you use a http base address because that makes some framework provided endpoints that usually use the http protocol (like mex) easier to configure. Other than that it is mostly a matter of choice. – Christian.K Jun 13 '17 at 03:47
  • Agree, if I use the http base address, I can easily generate a code file and a config file by using command 'svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service?wsdl'. It is different from the doc because it has '?wsdl' at the end of the base address. And I have no idea what the command will be if I use base address like 'net.pipe://localhost/uesamples/calc' or actually I don't need the base address? – kunyang Jun 13 '17 at 03:56
  • You should resource stackoverflow for that information, or ask a new question. The comments are no good fit anymore. – Christian.K Jun 13 '17 at 06:23

0 Answers0