-2

What should come in the place of ??? (first parameter)

serviceHost = new ServiceHost(typeof(MyService));    
serviceHost.SetEndpointAddress(???, "http://cvxcvxcvcx");

I have specified Endpoint in config file, what should I do to recall him? Can I recall him in this function?

1 Answers1

1

It is taken from MSDN

ServiceHostBase.SetEndpointAddress Method Sets the endpoint address of the specified endpoint to the specified address.

public void SetEndpointAddress(ServiceEndpoint endpoint, string relativeAddress)

Parameters

endpoint
Type: System.ServiceModel.Description.ServiceEndpoint
The service endpoint.

relativeAddress
Type: System.String
The endpoint address.

For better understanding you should read it WSDL-first approach: How to specify different names for wsdl:port and wsdl:binding?

Community
  • 1
  • 1
Amit
  • 21,570
  • 27
  • 74
  • 94
  • The signature of the SetEndpointAddress method looks slightly different at MSDN: [public void SetEndpointAddress(ServiceEndpoint endpoint, string relativeAddress)](http://msdn.microsoft.com/en-us/library/system.servicemodel.servicehostbase.setendpointaddress.aspx) – dtb May 20 '12 at 20:55
  • @dtb: Thanks for improvement. I have changed it. – Amit May 20 '12 at 21:05