Default Namespace Issue

I have now migrated to VS 2003.  When I deploy the WebService to a non-localhost server I get an error requiring the Namespace to be defined as something other than Tempuri.org.  This didnt happen until I stated using tthe 1.1 Framework.  I not sure how to properly fix this.  I tried making the new host name the Namspace however no luck. Any ideas



Answer this question

Default Namespace Issue

  • blueinc

    YEs I saw that too.  Didn't actually fix anything.  The Namespace error still presents itself if you put in the Actual host name and the Data Class.  I tried 

    <WebService(Namespace:="http://myhostname/TMSwebsrvc/")>

    and it still gives that same error message.  Has anyone run into the same issue

  • _Nik_

    This post I took directly from the "http://localhost/TaskVisionWS/AuthService.asmx" page.
    It shows how to change the default namespace using the WebService attribute's Namespace property. See example below.


    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.
    Each XML Web service needs a unique namespace in order for client applications to distinguish it from other services on the Web. http://tempuri.org/ is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.

    Your XML Web service should be identified by a namespace that you control. For example, you can use your company's Internet domain name as part of the namespace. Although many XML Web service namespaces look like URLs, they need not point to actual resources on the Web. (XML Web service namespaces are URIs.)

    For XML Web services creating using ASP.NET, the default namespace can be changed using the WebService attribute's Namespace property. The WebService attribute is an attribute applied to the class that contains the XML Web service methods. Below is a code example that sets the namespace to "http://microsoft.com/webservices/":

    C#

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

    <WebService(Namespace:="http://microsoft.com/webservices/")> Public Class MyWebService
        ' implementation
    End Class

    For more details on XML namespaces, see the W3C recommendation on Namespaces in XML.

    For more details on WSDL, see the WSDL Specification.

    For more details on URIs, see RFC 2396.

  • Default Namespace Issue