all groups > dotnet web services > january 2008 >
You're in the

dotnet web services

group:

different way of writing a web service?


different way of writing a web service? cj
1/15/2008 3:45:34 PM
dotnet web services: <System.Web.Services.WebService(Name:="CJ's Service",
Description:="Testing 123", Namespace:="http://myco.com/cj/one")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)>
_
<ToolboxItem(False)> _
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
End Class

The above code is basically what the project stated with. I noticed
that typing <System.Web.Services.WebService( into the ide it told me it
took description as string, name as string and namespace as string as
parameters. I assumed it was another one of those things that could be
done a million different ways so I tried writing the web service like
this instead but it doesn't work. It says "Too many arguments to public
new".

<System.Web.Services.WebService("Testing 123","CJ's
Service","http://myco.com/cj/one")>
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)>
_
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
End Class

Why would VB report <System.Web.Services.WebService( has parameters when
it can't be used like that?
RE: different way of writing a web service? stcheng@online.microsoft.com
1/16/2008 3:36:14 AM
Hi Cj,

As for the "WebServiceAttribute", if you want to add more initialize value
for its properties, I suggest you adopt the following syntax:

#explicitly provide the property name before the initialize value:
================
<WebService(Namespace:="http://tempuri.org/", Name:="fdsafds",
Description:="fsdfdfsdfdf")> _
Public Class simpleservice
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"

................
==================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Date: Tue, 15 Jan 2008 15:45:34 -0500
From: cj <cj@nospam.nospam>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Subject: different way of writing a web service?

_
<ToolboxItem(False)> _
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
End Class

The above code is basically what the project stated with. I noticed
that typing <System.Web.Services.WebService( into the ide it told me it
took description as string, name as string and namespace as string as
parameters. I assumed it was another one of those things that could be
done a million different ways so I tried writing the web service like
this instead but it doesn't work. It says "Too many arguments to public
new".

<System.Web.Services.WebService("Testing 123","CJ's
Service","http://myco.com/cj/one")>
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1
_1)>
_
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
End Class

Why would VB report <System.Web.Services.WebService( has parameters when
Re: different way of writing a web service? cj
1/16/2008 10:47:17 AM
Ok, then I'll try to forget I ever saw this format.

<System.Web.Services.WebService("Testing 123","CJ's
Service","http://myco.com/cj/one")>


[quoted text, click to view]
AddThis Social Bookmark Button