Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2007

Tip: Looking for answers? Try searching our database.

How to Webservice returning String() in VB.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adh - 24 Sep 2007 16:33 GMT
Possible in C# but not in VB.NET 2005   ????

<WebMethod()> _
Public Function GetCompletionNames(ByVal prefixText As String, ByVal count
As Integer) As String()
Dim st as String()
.....
return st

Doesn't work !!???

Thanks
John Saunders [MVP] - 24 Sep 2007 19:10 GMT
> Possible in C# but not in VB.NET 2005   ????
>
[quoted text clipped - 4 lines]
> .....
> return st

In what way does it not work?
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

adh - 24 Sep 2007 21:21 GMT
VB.NET does not return the string array like C# does.
Testing the webservice goes to the Not Found Page, while in C# you get
the Array-XML

Thanks, adh
John Saunders [MVP] - 24 Sep 2007 21:35 GMT
> VB.NET does not return the string array like C# does.
> Testing the webservice goes to the Not Found Page, while in C# you get
> the Array-XML

VB.NET and C# have identical capabilities here. You must have done something
wrong in the VB code that you did correctly in C#.

Does the VB code return nothing? Does it throw an exception?
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

adh - 24 Sep 2007 21:43 GMT
Nothing Wrong (!) and it doesn't throw an exeption, just does not get
the result and goes to the web not found.

I have seen more posts about it. Like using the line:
<System.Web.Script.Services.ScriptService()> _
which (at least in VB2005) is not recognized (ScriptService
is in System.Web.Script.Services)
Thanks, adh
John Saunders [MVP] - 24 Sep 2007 22:08 GMT
> Nothing Wrong (!) and it doesn't throw an exeption, just does not get
> the result and goes to the web not found.
[quoted text clipped - 3 lines]
> which (at least in VB2005) is not recognized (ScriptService
> is in System.Web.Script.Services)

There is no issue of "recognition". Import the namespace and try it again.
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

adh - 24 Sep 2007 22:24 GMT
You Tried?
ScriptService is not included in definition of
System.Web.Script.Services
Not in VB.NET2005
Thanks, adh
John Saunders [MVP] - 24 Sep 2007 23:06 GMT
> You Tried?
> ScriptService is not included in definition of
> System.Web.Script.Services
> Not in VB.NET2005

Namespaces have nothing to do with languages. If the namespace is absent in
VB.NET 2005, then it's absent in .NET.

More likely, you aren't aware of how, in VB, to add a reference to the
assembly containing the System.Web.Script.Services namespace. Look in your
C# project and find out what reference you had to add, then add that
reference to the VB project.
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

adh - 25 Sep 2007 06:28 GMT
Done all the same (I still know to copy....;-)
Please try a WebService yourself and see.

Thanks, adh
John Saunders [MVP] - 25 Sep 2007 17:14 GMT
> Done all the same (I still know to copy....;-)
> Please try a WebService yourself and see.

Believe what you like. VB.NET doesn't cause namespaces to be inaccessible,
and that namespace is not part of VB.NET.
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

adh - 24 Sep 2007 21:26 GMT
See MS Controls Toolkit: AutoCoplete which ask for a string() result.
Works fine in C# but not with a VB <webmethod>
I prefer it in VB because I need to Cash the (big) answer base.
Thanks, adh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.