namespace "http://tempuri.org/" in WebService

2

When creating a Web Service with Asp.net C # I get the following

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

Then when I'm using it, it shows me the message:

This web service is using http://tempuri.org/ as its default namespace

Recommendation: Change the default namespace before the XML Web service is made public.

What is the function of namespace because I do not see that it varies in any way with the web service, is it necessary to change it ?, what should I put

    
asked by Alejandro Ricotti 01.09.2016 в 19:40
source

1 answer

2

When you create a WS, the default namespace is:

link

if you get the message:

  

This web service is using link as its default   namespace.

     

Recommendation: Change the default namespace before the XML Web   service is made public.

It suggests you change the namespace to differentiate your WebService from others.

The same page that generates the message should suggest this for C #:

C#

[WebService(Namespace="http://microsoft.com/webservices/")]
public class MyWebService {
    // implementation
}

When you deploy your Web Service, in the property Namespace you define your own domain, for example:

[WebService(Namespace="http://ricotti.com/webservices/")]
    public class MyWebService {
...
...

in this way you will change the Namespace default and when you review the WSDL of your WebService you can see:

...
targetNamespace="http://ricotti.com/webservices/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://ricotti.com/webservices/">
...
...
    
answered by 01.09.2016 / 20:51
source