473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

which way to return struc from webservice?

cj2
Which function shows the proper way to return this structure
Validate, Validate2, or Validate3? And a short why would be nice.

Public Class Validate
Inherits System.Web.Services.WebService

Public Structure ValResult
Dim mResponse As String
Dim mReason As String
End Structure

<WebMethod()_
Public Function Validate(ByVal ibtn As String, ByVal irequestor As
String)
Dim thisResult As New ValResult
thisResult.mResponse = "ALLOW"
thisResult.mReason = "Good"
Return thisResult
End Function

<WebMethod()_
Public Function Validate2(ByVal ibtn As String, ByVal
irequestor As String) As ValResult
Validate2.mResponse = "ALLOW"
Validate2.mReason = "Good"
Return Validate2
End Function

<WebMethod()_
Public Function Validate3(ByVal ibtn As String, ByVal irequestor As
String) As ValResult
Dim thisResult As New ValResult
thisResult.mResponse = "ALLOW"
thisResult.mReason = "Good"
Return thisResult
End Function
End Class
Nov 21 '08 #1
1 1143
"cj2" <cj*@nospam.nospamwrote in message
news:eR*************@TK2MSFTNGP06.phx.gbl...
Which function shows the proper way to return this structure
Validate, Validate2, or Validate3? And a short why would be nice.

Public Class Validate
Inherits System.Web.Services.WebService

Public Structure ValResult
Dim mResponse As String
Dim mReason As String
End Structure

<WebMethod()_
Public Function Validate(ByVal ibtn As String, ByVal irequestor As
String)
Dim thisResult As New ValResult
thisResult.mResponse = "ALLOW"
thisResult.mReason = "Good"
Return thisResult
End Function

<WebMethod()_
Public Function Validate2(ByVal ibtn As String, ByVal irequestor
As String) As ValResult
Validate2.mResponse = "ALLOW"
Validate2.mReason = "Good"
Return Validate2
End Function

<WebMethod()_
Public Function Validate3(ByVal ibtn As String, ByVal irequestor As
String) As ValResult
Dim thisResult As New ValResult
thisResult.mResponse = "ALLOW"
thisResult.mReason = "Good"
Return thisResult
End Function
End Class

Validate3 is my choice, because I hate the other two.

Validate does not convey a return type. Validate2 does the work in a very
vb6 way in that the function name is treated as the return variable.

Nov 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Spike | last post by:
Hi I'm using GCC (and NASM) to send over a asm table... BootDrv db 0 BIOS_Mem_Map_Entries dd 0 APM_Status db 0 APM_Major_Version db 0 APM_Minor_Version db 0 APM_Code_Base dd 0 APM_Data_Base...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
1
by: Mike9900 | last post by:
I would like to return an object which inherits an interface. A web service instantiate a class that inherits that interface and returns that object. But I get error when referencing the web...
7
by: sameer | last post by:
Hi all, Application environment : VB.Net desktop application,.NET 1.1 Framework, VS 2003. communicates between the database and the application is done over webservices using ADO.NEt Datasets....
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
4
by: Military Smurf | last post by:
I'm interested in writing a web service that will return more than one value. What's the best way to accomplish this? I was wondering if an array would be best, but I'd like to know if there is a...
3
by: zion | last post by:
Hello, How can I return image link with webservice that I could see it in web page? The image is on my hard disk and <img src="c:\pictures\test.jpg" /does not work. If I use <img src=http://My...
4
by: Jonathan | last post by:
I have a SQL stored procedure for adding a new record in a transactions table. It also has two return values: CounterID and IDKey. I want to create a webservice that accepts the 10 input...
8
by: Sundhas | last post by:
I made a Webservice Operation whose return type is STRING Following is the code @WebMethod(operationName = "authorize") public String authorize(@WebParam(name = "Username") String Username) { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.