Re: namespace?
- From: cj <cj@xxxxxxxxxxxxx>
- Date: Tue, 15 Jan 2008 11:37:39 -0500
I'm still not getting this. Namespace:="http://tempuri.org/" looks like a web address and I've opend it but don't understand what it's saying. Can you try again to explain what a namespace does and why my web service needs to refer to one?
Also I think this has something to do with the WebMethodAttribute that we are discussing in my other post. Am I correct?
Steven Cheng[MSFT] wrote:
Hi Cj,.
As for the following attribute:
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")>
It is used to describe and decorate your webservice service class(applied on class level). Certainly, you can use the same one for C# code, they're the same. Also you can find more properites(that you can set on this attribute for your service class):
#WebServiceAttribute Class
http://msdn2.microsoft.com/en-us/library/system.web.services.webserviceattri
bute.aspx
In addition, to better understand its usage, you can visit the service's WSDL document (view through yourservice.asmx?WSDL url). Change the attribute setting and refresh the WSDL document to see the changes.
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: Fri, 11 Jan 2008 15:07:05 -0500
From: cj <cj@xxxxxxxxxxxxx>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
Subject: namespace?
Newsgroups: microsoft.public.dotnet.framework.webservices
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/4D13CEFA-D0FD-44BE-8749-8D17B5757564.dcik
?
- Follow-Ups:
- Re: namespace?
- From: Scott M.
- Re: namespace?
- References:
- namespace?
- From: cj
- RE: namespace?
- From: Steven Cheng[MSFT]
- namespace?
- Prev by Date: Re: publishing Hello World to local IIS
- Next by Date: Re: namespace?
- Previous by thread: RE: namespace?
- Next by thread: Re: namespace?
- Index(es):
Relevant Pages
|