473,791 Members | 3,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

namespace?

cj
What does the line
<System.Web.Ser vices.WebServic e(Namespace:="h ttp://tempuri.org/")_
do in the example below?

Imports System.Web.Serv ices
Imports System.Web.Serv ices.Protocols
Imports System.Componen tModel

' To allow this Web Service to be called from script, using ASP.NET
AJAX, uncomment the following line.
' <System.Web.Scr ipt.Services.Sc riptService()_
<System.Web.Ser vices.WebServic e(Namespace:="h ttp://tempuri.org/")_
<System.Web.Ser vices.WebServic eBinding(Confor msTo:=WsiProfil es.BasicProfile 1_1)>
_
<ToolboxItem(Fa lse)_
Public Class Service1
Inherits System.Web.Serv ices.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 1656
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.nosp amwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
What does the line
<System.Web.Ser vices.WebServic e(Namespace:="h ttp://tempuri.org/")_
do in the example below?

Imports System.Web.Serv ices
Imports System.Web.Serv ices.Protocols
Imports System.Componen tModel

' To allow this Web Service to be called from script, using ASP.NET AJAX,
uncomment the following line.
' <System.Web.Scr ipt.Services.Sc riptService()_
<System.Web.Ser vices.WebServic e(Namespace:="h ttp://tempuri.org/")_
<System.Web.Ser vices.WebServic eBinding(Confor msTo:=WsiProfil es.BasicProfile 1_1)>
_
<ToolboxItem(Fa lse)_
Public Class Service1
Inherits System.Web.Serv ices.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.nosp am>
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
2725
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 namespace prefix, what is its namespace, if default namespaces do not apply? Are (either of) prefixed or non-prefixed attributes correct? For example, are the following equivalent: <html:br class="foo"...
3
10043
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" xmlns:ns1="abc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" media-type="text/xml" standalone="yes" version="1.0"/> <xsl:template match="/">
8
4917
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 namespace std;' unless the std namespace was declared first. This triggered my curiosity, and I tried to find out what the ANSI C++ standard had to say about this. I'm unable to find a conclusion, and hope someone here have a clue to spare. ...
7
7440
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 = {}; com.unFocus.Namespaces = new function() { this.register = function(namespace) { namespace = namespace.split('.');
14
3334
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
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9997
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5435
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
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 we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.