Web服务并不单声道4工作 [英] Web Services does not work in mono 4
问题描述
我有一个使用Web服务与ASP.Net和我应该维护一个应用程序。所以我磨的话题我的技能。我有VS 2013运行在web服务窗口没有问题,但有单的问题。
下面是我得到的错误,当我运行code
System.ArgumentNullException
值不能为空。
参数名:PATH1说明:HTTP 500.Error处理请求。联系方式:非网上例外。异常原点(应用程序或对象的名称):mscorlib程序。
异常堆栈跟踪:
在System.IO.Path.Combine(System.String PATH1,System.String PATH2)[0x00006]上述<文件名未知>:0
在System.Web.Services.Configuration.WsdlHelpGeneratorElement.get_HelpGeneratorPath()[0x0000c]上述<文件名未知>:0
在System.Web.Services.Protocols.DocumentationServerProtocol.Initialize()[0x001f1]上述<文件名未知>:0
在System.Web.Services.Protocols.ServerProtocol.SetContext(System.Type的类型,System.Web.HttpContext背景下,System.Web.Htt prequest要求,System.Web.Htt presponse响应)[0x00022]上述<文件名未知>:0
在System.Web.Services.Protocols.ServerProtocolFactory.Create(System.Type的类型,System.Web.HttpContext背景下,System.Web.Htt prequest要求,System.Web.Htt presponse响应,System.Boolean和放大器; abortProcessing)[0x00014]上述<文件名未知>:0
和这里的codeS
WebService1.asmx
<%@ WebService的语言=C#codeBehind =WebService1.asmx.cs级=DemoService.WebService1%GT;
WebService1.asmx.cs
使用系统;
使用System.Collections.Generic;
使用System.Linq的;
使用的System.Web;
使用System.Web.Services;
使用的System.Xml;命名空间DemoService
{
///<总结>
///为WebService1摘要说明
///< /总结>
[WebService的空间(namespace =http://tempuri.org/)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)
[System.ComponentModel.ToolboxItem(假)]
//要允许此Web服务从脚本调用,使用ASP.NET AJAX,取消注释以下行。
// [System.Web.Script.Services.ScriptService]
公共类WebService1:System.Web.Services.WebService
{ [的WebMethod]
公共字符串的HelloWorld()
{
返回的Hello World;
} [的WebMethod]
公众的XmlElement ADDME(int类型的,INT B)
{
XmlDocument的DOC =新的XmlDocument();
的for(int i = 0;我小于5;我++)
{
XmlNode的N = doc.CreateNode(XmlNodeType.Element,i.ToString(),me.com.aisee);
为(中间体J = 0; J&小于5; J ++)
{
//n.AppendChild(doc.CreateElement(j.ToString()));
}
} 返回doc.DocumentElement; }
}
}
我不知道我错过这里。以我所知,它应该只是正常工作。这里是我的单声道版本
〜$单--version
单JIT编译器版本4.3.0(压缩包周五6月12日11时43分58秒UTC 2015年)
版权所有(C)2002至2014年Novell公司,公司,Xamarin公司和贡献者。 www.mono-project.com
TLS:__thread
SIGSEGV:altstack
声明:epoll的
硬件架构:
禁用:无
其他:softdebug
LLVM:支持未启用。
GC:SGEN
这是单声道的错误。你可以看看这里:
https://bugzilla.xamarin.com/show_bug.cgi?id=37137
和 https://bugzilla.xamarin.com/show_bug.cgi?id=39772
I have an app that uses Webservices with ASP.Net and am supposed to maintain. So I was sharpening my skills on the topic. I have no problem running Webservice in Window with VS 2013 but have issues with mono.
Here is the error I get when I run the code
System.ArgumentNullException
Value cannot be null.
Parameter name: path1
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
at System.IO.Path.Combine (System.String path1, System.String path2) [0x00006] in <filename unknown>:0
at System.Web.Services.Configuration.WsdlHelpGeneratorElement.get_HelpGeneratorPath () [0x0000c] in <filename unknown>:0
at System.Web.Services.Protocols.DocumentationServerProtocol.Initialize () [0x001f1] in <filename unknown>:0
at System.Web.Services.Protocols.ServerProtocol.SetContext (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response) [0x00022] in <filename unknown>:0
at System.Web.Services.Protocols.ServerProtocolFactory.Create (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response, System.Boolean& abortProcessing) [0x00014] in <filename unknown>:0
and here are the codes
WebService1.asmx
<%@ WebService Language="C#" CodeBehind="WebService1.asmx.cs" Class="DemoService.WebService1" %>
WebService1.asmx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Xml;
namespace DemoService
{
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public XmlElement AddMe(int a, int b)
{
XmlDocument doc = new XmlDocument();
for(int i=0; i<5; i++)
{
XmlNode n = doc.CreateNode( XmlNodeType.Element, i.ToString(), "me.com.aisee");
for(int j=0; j<5; j++)
{
//n.AppendChild(doc.CreateElement(j.ToString()));
}
}
return doc.DocumentElement;
}
}
}
I don't what I miss here. to the best of my knowledge, it should just work fine. Here is my Mono version
~$ mono --version
Mono JIT compiler version 4.3.0 (tarball Fri Jun 12 11:43:58 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
That's a bug in mono. You may look at here: https://bugzilla.xamarin.com/show_bug.cgi?id=37137
and https://bugzilla.xamarin.com/show_bug.cgi?id=39772
这篇关于Web服务并不单声道4工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!