关于命名空间(重复);关于WEB服务;关于数据集;

supnumb 2004-10-11 04:39:41
我写了一个WEB服务类。在IIS下用浏览器查看时,总是提示命名空间重复。
在这个服务中,我引用的有重写的Dataset的类。我找不出原因(看不懂堆栈信息)。
恳请大侠!高手相助!
命名空间 重复。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: 命名空间 重复。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[InvalidOperationException: 命名空间 重复。]
System.Xml.Serialization.XmlSchemaExporter.ExportSpecialMapping(SpecialMapping mapping, String ns, Boolean isAny)
System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(XmlSchemaElement element, Mapping mapping, String ns, Boolean isAny) +277
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) +48
System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(XmlSchemaElement element, Mapping mapping, String ns, Boolean isAny) +222
System.Xml.Serialization.XmlSchemaExporter.ExportElement(ElementAccessor accessor) +225
System.Xml.Serialization.XmlSchemaExporter.ExportMembersMapping(XmlMembersMapping xmlMembersMapping) +70
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: 无法处理请求。]
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: 未能处理请求。]
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) +696
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +95
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173


...全文
109 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lql9935 2004-10-14
  • 打赏
  • 举报
回复
up
supnumb 2004-10-12
  • 打赏
  • 举报
回复
<WebMethod()> _
Public Function GetSiteSettingOneByDS(ByVal lc_cacheds As LC_CacheDS, ByVal _name As String) As String
'Public Function GetSiteSettingOneByDS(ByVal lc_cacheds As LC_CacheDS, ByVal _name As String) As String
Try
If (Not ConfigurationSettings.AppSettings.Item("sys_" & _name) Is Nothing) Then
Return ConfigurationSettings.AppSettings.Item("sys_" & _name)
End If
If (lc_cacheds.DataSetName Is "LC_CacheDS") Then
Dim row1 As DataRow = lc_cacheds.SiteSetting.FindByname(_name)
If (Not row1 Is Nothing) Then
Return row1.Item("value").ToString
End If
End If
If (Not ConfigurationSettings.AppSettings.Item("default_" & _name) Is Nothing) Then
Return ConfigurationSettings.AppSettings.Item("default_" & _name) '返回值为1;
End If
Catch exception1 As Exception
debugClass.debug("GetSiteSettingOneByDS:" & _name & "," & exception1.ToString)
End Try
Return Nothing
End Function

supnumb 2004-10-12
  • 打赏
  • 举报
回复
Imports System.Web.Services
Imports System.ComponentModel
Imports ThankWS.DoData
Imports System.IO
Imports ThankWS.publi
Imports System.Configuration
Imports ThankWS.LC
Namespace LC
<System.Web.Services.WebService(Namespace:="http://192.168.1.102/")> _
Public Class LC_Account
Inherits System.Web.Services.WebService

#Region " Web 服务设计器生成的代码 "

Public Sub New()
MyBase.New()

'该调用是 Web 服务设计器所必需的。
InitializeComponent()

'在 InitializeComponent() 调用之后添加您自己的初始化代码

End Sub

'Web 服务设计器所必需的
Private components As System.ComponentModel.IContainer

'注意: 以下过程是 Web 服务设计器所必需的
'可以使用 Web 服务设计器修改此过程。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container
End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: 此过程是 Web 服务设计器所必需的
'不要使用代码编辑器修改它。
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

#End Region


<WebMethod()> _
Public Function GetSiteSettingOne(ByVal _siteid As String, ByVal _name As String) As String
Try
'sys_window_title
If (Not ConfigurationSettings.AppSettings.Item("sys_" & _name) Is Nothing) Then
Return ConfigurationSettings.AppSettings.Item("sys_" & _name)
End If
Dim eds1 As LC_CacheDS = docache.Load_LC_Cache(_siteid)
If (eds1.DataSetName Is "LC_CacheDS") Then
Dim row1 As DataRow = eds1.SiteSetting.FindByname(_name)
If (Not row1 Is Nothing) Then
Return row1.Item("value").ToString
End If
End If
If (Not ConfigurationSettings.AppSettings.Item(String.Concat("default_", _name)) Is Nothing) Then
Return ConfigurationSettings.AppSettings.Item(String.Concat("default_", _name))
End If
Catch exception1 As Exception
Dim textArray1() As String = {"GetSiteSettingOne:", _siteid, ",", _name, ",", exception1.ToString}
debugClass.debug(String.Concat(textArray1))
End Try
Return Nothing

End Function

Tomgus 2004-10-11
  • 打赏
  • 举报
回复
没代码
wangxt 2004-10-11
  • 打赏
  • 举报
回复
把代码贴出来看看啊
CMIC 2004-10-11
  • 打赏
  • 举报
回复
代码贴出来

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧