By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,812 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,812 IT Pros & Developers. It's quick & easy.

different way of writing a web service?

P: n/a
cj
<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?

Jan 15 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/subscripti...ult.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/subscripti...t/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
it can't be used like that?
Jan 16 '08 #2

P: n/a
cj
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")>
Steven Cheng[MSFT] wrote:
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/subscripti...ult.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/subscripti...t/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
it can't be used like that?

Jan 16 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.