The namespace, , is a duplicate - Web Service error

C

Chris

Hi,

I'm writing an N-Tier application in C# which includes an ASP.NET web
service returning Typed Datasets. I have an Assembly with the
namespace 'CallLogger.Datasets' that contains the Typed Datasets.
When I have one method in my web service returning a typed dataset
everything is fine. When I add another method (see code below) that
returns a different Typed Dataset I receive the error "The namespace,
, is a duplicate" (full error at bottom of message). I have tried
creating a new namespace for each typed dataset
(CallLogger.DataSets.Calls and CallLogger.DataSet.Staff), and also
changed the namespace names in case of conflicts - no success! How do
I get around this without creating a new web service page for each
Typed Dataset?!

Thanks in advance.


Web Service Code

[WebMethod]
public CallsDS GetCalls(string strUsername, CallListTypes
cltCallTypes, string strSortBy)
{
CallsDA objCallsDA = new CallsDA();

CallsDS objDataSet;

objDataSet = objCallsDA.GetCalls(strUsername, cltCallTypes,
strSortBy);

objCallsDA.Close();

return objDataSet;
}

// Phonebook Staff Object

[WebMethod]
public PhonebookStaffDS GetPhonebookStaff()
{
PhonebookStaffDA objPhonebookStaffDA = new PhonebookStaffDA();

PhonebookStaffDS objDataSet;

objDataSet = objPhonebookStaffDA.GetStaff();

objPhonebookStaffDA.Close();

return objDataSet;
}

Full Error:

Server Error in '/CallLoggerService' Application.
--------------------------------------------------------------------------------

The namespace, , is a duplicate.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The namespace, ,
is a duplicate.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: The namespace, , is a duplicate.]
System.Xml.Serialization.XmlSchemaExporter.ExportSpecialMapping(SpecialMapping
mapping, String ns, Boolean isAny) +909
System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(XmlSchemaElement
element, Mapping mapping, String ns, Boolean isAny) +274
System.Xml.Serialization.XmlSchemaExporter.ExportElementAccessor(XmlSchemaGroupBase
group, ElementAccessor accessor, Boolean repeats, Boolean
valueTypeOptional, String ns) +921
System.Xml.Serialization.XmlSchemaExporter.ExportElementAccessors(XmlSchemaGroupBase
group, ElementAccessor[] accessors, Boolean repeats, Boolean
valueTypeOptional, String ns) +100
System.Xml.Serialization.XmlSchemaExporter.ExportTypeMembers(XmlSchemaComplexType
type, MemberMapping[] members, String name, String ns, Boolean
hasSimpleContent) +252
System.Xml.Serialization.XmlSchemaExporter.ExportMembersMapping(MembersMapping
mapping, String ns) +47
System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(XmlSchemaElement
element, Mapping mapping, String ns, Boolean isAny) +219
System.Xml.Serialization.XmlSchemaExporter.ExportElement(ElementAccessor
accessor) +224
System.Xml.Serialization.XmlSchemaExporter.ExportMembersMapping(XmlMembersMapping
xmlMembersMapping) +68
System.Web.Services.Description.SoapProtocolReflector.CreateLiteralMessage(Message
message, MessageBinding messageBinding, XmlMembersMapping members,
Boolean wrapped) +395
System.Web.Services.Description.SoapProtocolReflector.CreateMessage(Boolean
rpc, SoapBindingUse use, SoapParameterStyle paramStyle, Message
message, MessageBinding messageBinding, XmlMembersMapping members) +78
System.Web.Services.Description.SoapProtocolReflector.ReflectMethod()
+449
System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding
reflectedBinding) +1818
System.Web.Services.Description.ProtocolReflector.Reflect() +506
System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[]
reflectors) +495
System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type
type, String url) +112
System.Web.Services.Protocols.DocumentationServerType..ctor(Type
type, String uri) +158
System.Web.Services.Protocols.DocumentationServerProtocol.Initialize()
+269
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing) +106

[InvalidOperationException: Unable to handle request.]
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing) +205
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
+82

[InvalidOperationException: Failed to handle request.]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
+154
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext
context, String verb, String url, String filePath) +94
System.Web.HttpApplication.MapHttpHandler(HttpContext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+95
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +173
 
E

Erymuzuan Mustapa

It's quite hard to do it without creating a new .asmx( i.e.) give the
webserviceAttribute a different namespcae) because WebMethod attribute does
not support different namespace for the same endpoint. BTW , if you take a
look at the SoapDocumentAttribute you can probably try the ResponeNameSpace
property.


--
Erymuzuan Mustapa
Inter Virtual Sdn. Bhd.
See MIND at http://www.MIND.com.my

Chris said:
Hi,

I'm writing an N-Tier application in C# which includes an ASP.NET web
service returning Typed Datasets. I have an Assembly with the
namespace 'CallLogger.Datasets' that contains the Typed Datasets.
When I have one method in my web service returning a typed dataset
everything is fine. When I add another method (see code below) that
returns a different Typed Dataset I receive the error "The namespace,
, is a duplicate" (full error at bottom of message). I have tried
creating a new namespace for each typed dataset
(CallLogger.DataSets.Calls and CallLogger.DataSet.Staff), and also
changed the namespace names in case of conflicts - no success! How do
I get around this without creating a new web service page for each
Typed Dataset?!

Thanks in advance.


Web Service Code

[WebMethod]
public CallsDS GetCalls(string strUsername, CallListTypes
cltCallTypes, string strSortBy)
{
CallsDA objCallsDA = new CallsDA();

CallsDS objDataSet;

objDataSet = objCallsDA.GetCalls(strUsername, cltCallTypes,
strSortBy);

objCallsDA.Close();

return objDataSet;
}

// Phonebook Staff Object

[WebMethod]
public PhonebookStaffDS GetPhonebookStaff()
{
PhonebookStaffDA objPhonebookStaffDA = new PhonebookStaffDA();

PhonebookStaffDS objDataSet;

objDataSet = objPhonebookStaffDA.GetStaff();

objPhonebookStaffDA.Close();

return objDataSet;
}

Full Error:

Server Error in '/CallLoggerService' Application.
-------------------------------------------------------------------------- ------

The namespace, , is a duplicate.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The namespace, ,
is a duplicate.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: The namespace, , is a duplicate.]
System.Xml.Serialization.XmlSchemaExporter.ExportSpecialMapping(SpecialMappi
ng
mapping, String ns, Boolean isAny) +909
System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(XmlSchemaEle
ment
element, Mapping mapping, String ns, Boolean isAny) +274
System.Xml.Serialization.XmlSchemaExporter.ExportElementAccessor(XmlSchemaGr
oupBase
group, ElementAccessor accessor, Boolean repeats, Boolean
valueTypeOptional, String ns) +921
System.Xml.Serialization.XmlSchemaExporter.ExportElementAccessors(XmlSchemaG
roupBase
group, ElementAccessor[] accessors, Boolean repeats, Boolean
valueTypeOptional, String ns) +100
System.Xml.Serialization.XmlSchemaExporter.ExportTypeMembers(XmlSchemaComple
xType
type, MemberMapping[] members, String name, String ns, Boolean
hasSimpleContent) +252
System.Xml.Serialization.XmlSchemaExporter.ExportMembersMapping(MembersMappi
ng
mapping, String ns) +47
System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(XmlSchemaEle
ment
element, Mapping mapping, String ns, Boolean isAny) +219
System.Xml.Serialization.XmlSchemaExporter.ExportElement(ElementAccessor
accessor) +224
System.Xml.Serialization.XmlSchemaExporter.ExportMembersMapping(XmlMembersMa
pping
xmlMembersMapping) +68
System.Web.Services.Description.SoapProtocolReflector.CreateLiteralMessage(M
essage
message, MessageBinding messageBinding, XmlMembersMapping members,
Boolean wrapped) +395
System.Web.Services.Description.SoapProtocolReflector.CreateMessage(Boolean
rpc, SoapBindingUse use, SoapParameterStyle paramStyle, Message
message, MessageBinding messageBinding, XmlMembersMapping members) +78
System.Web.Services.Description.SoapProtocolReflector.ReflectMethod()
+449
System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBi
nding
reflectedBinding) +1818
System.Web.Services.Description.ProtocolReflector.Reflect() +506
System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(
ProtocolReflector[]
reflectors) +495
System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type
type, String url) +112
System.Web.Services.Protocols.DocumentationServerType..ctor(Type
type, String uri) +158
System.Web.Services.Protocols.DocumentationServerProtocol.Initialize()
+269
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing) +106

[InvalidOperationException: Unable to handle request.]
System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing) +205
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
+82

[InvalidOperationException: Failed to handle request.]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
+154
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContex
t
context, String verb, String url, String filePath) +94
System.Web.HttpApplication.MapHttpHandler(HttpContext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep
..Execute()
+95
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +173




-------------------------------------------------------------------------- ------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
 

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,769
Messages
2,569,582
Members
45,061
Latest member
KetonaraKeto

Latest Threads

Top