473,503 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

namespace?

cj
What does the line
<System.Web.Services.WebService(Namespace:="http ://tempuri.org/")_
do in the example below?

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET
AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()_
<System.Web.Services.WebService(Namespace:="http ://tempuri.org/")_
<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

And why don't I see a similar line in the C# example at
http://dotnetjunkies.com/Tutorial/4D...7B5757564.dcik
?
Jan 11 '08 #1
2 1639
What you are referring to is a compiler attribute. These attributes appear
in angle brackets (<>) and precede a code definition, such as a class. They
inform the compiler about details of the item they precede. In this case,
it informs the compiler that this class is no ordinary class and that the
XML that should be sent back from the service should exist within the
http://temuri.org (temporary uri - you are supposed to change it) namespace.
You are supposed to replace this with a namespace of your own.

In addition, notice that your HelloWorld function is also marked with a
compiler attribute. This one tells the compiler that this method is no
ordinary method, but a WebMethod and therefore should be callable remotely
over http and soap via xml.

-Scott
"cj" <cj@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
What does the line
<System.Web.Services.WebService(Namespace:="http ://tempuri.org/")_
do in the example below?

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX,
uncomment the following line.
' <System.Web.Script.Services.ScriptService()_
<System.Web.Services.WebService(Namespace:="http ://tempuri.org/")_
<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

And why don't I see a similar line in the C# example at
http://dotnetjunkies.com/Tutorial/4D...7B5757564.dcik
?

Jan 11 '08 #2
Hi Cj,

Actually, for WCF, it support both binary and XML format of message
transfering, just depend on your context. If you use WCF to communicate
with another XML webservice side, you certain will need to use XML format
underlying.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Date: Wed, 16 Jan 2008 11:35:07 -0500
From: cj <cj@nospam.nospam>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Subject: Re: namespace?

To be honest I don't care for XML. It's too verbose. I'd have stuck
with comma delimited or fixed width files but it all depends on the
application. I think it's a bit funny that the new MS stuff, I forget
the name maybe it was WCF?, was almost back to comma delimited and they
talked about cutting down on the data being sent across the net in
comparison to XML.
Scott M. wrote:
No problem CT - - You are not alone when it comes to getting over the
confusion of using URL's as namespace names. My company is an IT
training
company and whenever I am teaching XML, this issue winds up being the
single
biggest source of confusion. But, once you get your head around the
idea,
other things become much clearer.

Good luck!

-Scott
Jan 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2700
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
3
10014
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
8
4894
by: Petter Reinholdtsen | last post by:
I ran into a problem on HP-UX 11.00 the other day, where it refused to compile a program using 'using namespace std;' at the top. The reason seem to be that the compiler refuses to accept 'using...
7
7420
by: Kevin Newman | last post by:
I've been toying with a namespace manager, and wanted to get some input. So what do you think? if (typeof com == 'undefined') var com = {}; if (!com.unFocus) com.unFocus = {}; ...
14
3299
by: Tiraman | last post by:
Hi , I would like to use nested namespace . I have 3 namespace as dll's : Namespace A Namespace B Namespace C And i want to have some namespace that contain them all , some thing like
0
7199
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
7074
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
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4667
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
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
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 ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.