DevForce Help Reference
ServerPort Property (ObjectServerElement)


Gets or sets the server port that is listening for client requests - Applicable to both client and server.
Syntax
'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
'Usage
 
Dim instance As ObjectServerElement
Dim value As Integer
 
instance.ServerPort = value
 
value = instance.ServerPort
[Description("The server port that is listening for client requests - Applicable to both client and server.")]
[XmlAttribute("serverPort")]
[DefaultValue()]
public int ServerPort {get; set;}
Remarks
This value must be the same for both Client and Server configurations.

The final endpoint address is formed is formed from the 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, 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.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ObjectServerElement Class
ObjectServerElement Members

Send Feedback