Visual Basic (Declaration) | |
---|---|
<DescriptionAttribute("The server port that is listening for client requests - Applicable to both client and server.")> <XmlAttributeAttribute("serverPort")> <DefaultValueAttribute()> Public Property ServerPort As Integer |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As ObjectServerElement Dim value As Integer instance.ServerPort = value value = instance.ServerPort |
C# | |
---|---|
[DescriptionAttribute("The server port that is listening for client requests - Applicable to both client and server.")] [XmlAttributeAttribute("serverPort")] [DefaultValueAttribute()] public int ServerPort {get; set;} |
C++/CLI | |
---|---|
[DescriptionAttribute("The server port that is listening for client requests - Applicable to both client and server.")] [XmlAttributeAttribute("serverPort")] [DefaultValueAttribute()] public: property int ServerPort { int get(); void set ( int value); } |
The final endpoint address is formed is formed from the ObjectServerElement.RemoteBaseUrl, ServerPort and ServiceName properties. For example, if the endpoint address is http://localhost:9009/myapp/EntityService.svc, then the ServerPort would be "9009". If the service is hosted under IIS with an address such as http://localhost/MyService/EntityService.svc, then the ServerPort will be 80.
If hosting the application server with either the ServerService or ServerConsole, you will probably need to manually open the port used by your service. If using Windows Firewall, use the "Add Port" button on the Exceptions tab. Be sure to choose a TCP port even if you’re using the HTTP protocol.
The ServerPort, ObjectServerElement.RemoteBaseUrl and ServiceName values are ignored by the application server when hosted by IIS. These values are also not requred when endpoint configuration information can be obtained from the system.serviceModel section of the client's configuration file.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family