473,473 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

different way of writing a web service?

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
2 2099
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Glenn Venzke | last post by:
I'd like to write a windows service. Unfortunately, my company would only spring for the standard edition of VB.NET which doesn't support the creation of windows services. Is it possible to write one...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
3
by: Chris Dunaway | last post by:
I am writing a Windows Service that reads and processes files on a set schedule. I want to create a second app that can monitor the Windows service. The Windows service will write trace messages...
8
by: songstre | last post by:
I would like to write a service that handles certain tasks fro a third party back end. There is an API for the back end that I can use to accomplish this, but there are certain calls I have to make...
5
by: gnanapoongothai | last post by:
hi, i am doing socket programming , and once socket is connected getting data from client and wrting into the file. the file is created but nothing is in it? whats up ? code: WORD...
0
by: Sid Price | last post by:
I am writing a service using VB.NET 2005 and having some trouble getting started. I sued the wizard to create the service and I have added some code to the "OnStart" method. Using the technique...
3
by: Chet | last post by:
I am writing an application that utilizes a reference to Microsoft Outlook. (Added a reference to the MS Outlook COM interface to my project). I then write code such as: dim olApp as new...
2
by: Solomon_Man | last post by:
All, I have a Windows Service application that has database connectivity and needs the capability to let a user know that there has been a db failure. What is the proper way to notify a user that...
3
by: Levi Campbell | last post by:
Hi, I'm trying to write a program for a friend of mine who uses windows but I use GNU/Linux. I know you can use mingw and link to the python dll, but is there a way to create a win32 service under...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.