Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: VB6
Expertise: beginner
Jun 27, 2002



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Make read-only properties visible to Web Services clients

Read-only and write-only properties in a Web Service class aren't visible to the Web Service client. The reason is that XML serialization doesn't support these sort of properties, and read-only and write-only properties aren't included in the Web Services Description Language (WSDL) documentation.

To make these properties visible to clients, create a Function that returns the value of a read-only property, or a Sub that assigns a write-only property, and decorate them with the WebMethod attribute. For example:

Dim m_Count As Integer 

ReadOnly Property Count() As Integer
      Return m_Count 
   End Get
End Property 

' This is the method visible to the Web Service's clients
<WebMethod()> Function GetCount() As Integer
    Return Count
End Function
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date