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 / March 2005

Tip: Looking for answers? Try searching our database.

Converting C# Attribute to VB.net for WSE demo (ServiceStation)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam Stephensen - 31 Jan 2005 06:17 GMT
http://msdn.microsoft.com/msdnmag/issues/04/10/ServiceStation/

In the downloadable code (not the article itself) for this great article
about WSE Security, Aaron Skonnard has the following C# method ...

[WebMethod]
[return:XmlElement("WeblogEntry")]
public ConfirmedWeblogEntry AddEntry( NewWeblogEntry newEntry )
{
}

I am trying to convert this demo to VB.Net and having no luck at all with
the attribute
[return:XmlElement("WeblogEntry")]

Any ideas anyone ?
Mona - 31 Jan 2005 10:06 GMT
Hi Adam,

This is the VB.NET version of that C# code

<WebMethod()> _
<return: XmlElement("WeblogEntry")> _
Public Function AddEntry(ByVal newEntry As NewWeblogEntry) As ConfirmedWeblogEntry
End Function

HTH

Mona

> http://msdn.microsoft.com/msdnmag/issues/04/10/ServiceStation/
>
[quoted text clipped - 12 lines]
>
> Any ideas anyone ?
Adam Stephensen - 31 Jan 2005 23:19 GMT
Thanks Mona,

I had tried your suggestion of

<WebMethod()> _
<return: XmlElement("WeblogEntry")> _
Public Function AddEntry(ByVal newEntry As NewWeblogEntry) As
ConfirmedWeblogEntry
End Function

but the '<' sign before "return" then gives the following intellisense error

"Attribute specifier is not a complete statement. Use a line continuation to
apply the attribute to the following statement."

I have also tried..

<WebMethod(),return: XmlElement("WeblogEntry")> _
   Public Function AddEntry(ByVal newEntry As NewWeblogEntry) As
ConfirmedWeblogEntry
   End Function

but then 'return' has an intelisense error of "Keyword is not valid as an
identifier"

I have googled like a madman, but cannot find any documentation on using
"return" as a method attribute...
though it obviously works... because the c# project is excellent

thanks heaps for your help.

Any other suggestions ? Anyone ?

> Hi Adam,
>
[quoted text clipped - 25 lines]
> >
> > Any ideas anyone ?
netnews.microsoft.com - 01 Mar 2005 05:20 GMT
This might work:

<WebMethod, return: XmlElement("WeblogEntry")> _

> Thanks Mona,
>
[quoted text clipped - 58 lines]
> > >
> > > Any ideas anyone ?

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.