Webservices 101

A

Arjen

Hi,

I have some starters questions.

The blank webservice in the 'webservice template' in 'visual web developer'
start with some lines of code. I hope some one can tell me more about it.

[WebService(Namespace = "http://tempuri.org/")]
- Where is this namespace used for?
- Who use it?
- What happens when I change or remove it?
- Do I need to use this line?
- Do I need to use it when using UDDI?

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- What's this?

public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}

- What does this mean?

Thats it! Hope someone will help!

Thanks!
Arjen
 
M

Martin Kulov

Arjen said:
[WebService(Namespace = "http://tempuri.org/")]
- Where is this namespace used for?
- Who use it?
- What happens when I change or remove it?
- Do I need to use this line?
- Do I need to use it when using UDDI?

Hi Arjen,
you need to set a correct namespace, before you deploy your web service.
Think of it as a unique identificator for your service. Without it your
consumers mey experience problems accessing your service.
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- What's this?

From MSDN:
WebServiceBindingAttribute.ConformsTo Property
Note: This property is new in the .NET Framework version 2.0.

Gets or sets the Web Services Interoperability (WSI) specification to which
the binding claims to conform.
The WS-I organization publishes guidelines to ensure the interoperability of
Web services across platforms. This property indicates the WSI specification
to which the binding claims to conform.


public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}

- What does this mean?

It means that if you are going to use Visual Studio designer to drag and
drop components to your web service, you need to uncomment the line, so the
designer should work. I am not sure if you are gonna need it in production
code.

HTH,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 
S

Scott M.

[WebService(Namespace = "http://tempuri.org/")]

WebServices transmit their requests and responses as XML.

In XML, the tags are user-defined and that leaves the potential that 2
applications may wind up using the same tag name, but for different
meanings.

The Namespace here is not a reference to a .NET namespace, it is a
declaration of what XML namespace you wish to use for the XML tags requested
and responded in your WebServices (same concept as .NET namespaces, but used
for XML tags).

You should replace http://tempuri.org with your own organization's URL
followed by a slash "/" and something you make up to define your service.
The resulting URL need not actually exist as a browsable resource on a web
server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top