Web服务无法在Mono4中工作所以我提高了我在这个话题上的技能。我在使用VS2013的Window中运行web服务没有问题,但在单声道中有问题。这是我运行代码时遇到的错误System.ArgumentNullExceptionValuecannotbenull。参数名称:path1说明:HTTP500。错误处理请求。详细信息:非Web异常。异常来源(应用程序或对象的名称):mscorlib。异常堆栈跟踪:在System.IO.Path.Combine(System.Stringpath1,System.Stringpath2)[0x00006]in:0atSystem.Web.Services.Configuration.WsdlHelpGeneratorElement.get_HelpGeneratorPath()[0x0000c]in:0atSystem.Web.Services.Protocols.DocumentationServerProtocol.Initialize()[0x001f1]in:0atSystem.Web.Services.Protocols.ServerProtocol.SetContext(System.Type类型,System.Web.HttpContext上下文,System.Web.HttpRequest请求,System.Web.HttpResponse响应)[0x00022]in:0atSystem.Web.Services.Protocols.ServerProtocolFactory.Create(System.Type类型,System.Web.HttpContext上下文,System.Web.HttpRequest请求,System.Web.HttpResponseresponse,System.Boolean&abortProcessing)[0x00014]in:0这是代码WebService1.asmxWebService1.asmx.cs使用系统;使用System.Collections.Generic;使用System.Linq;使用System.Web;使用System.Web.Services;使用System.Xml;namespaceDemoService{//////WebService1的摘要说明///[WebService(Namespace="http://tempuri.org/")][WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)][System.ComponentModel.ToolboxItem(false)]//要允许使用ASP.NETAJAX从脚本调用此Web服务,请取消注释以下行。//[System.Web.Script.Services.ScriptService]publicclassWebService1:System.Web.Services.WebService{[WebMethod]publicstringHelloWorld(){return"HelloWorld";}[WebMethod]publicXmlElementAddMe(inta,intb){XmlDocumentdoc=newXmlDocument();for(inti=0;i<5;i++){XmlNoden=doc.CreateNode(XmlNodeType.Element,i.ToString(),"me.com.aisee");for(intj=0;j<5;j++){//n.AppendChild(doc.CreateElement(j.ToString()));}}返回doc.DocumentElement;我不是我所缺少的据我所知它应该可以正常工作。这是我的Mono版本~$mono--versionMonoJIT编译器版本4.3.0(tarballFriJun1211:43:58UTC2015)版权所有(C)2002-2014Novell,Inc、XamarinInc和Contributors。万维网。mono-project.comTLS:__threadSIGSEGV:altstack通知:epoll架构:amd64已禁用:无杂项:softdebugLLVM:支持,未启用。GC:sgen这是一个单声道错误。您可以在这里查看:https://bugzilla.xamarin.com/show_bug.cgi?id=1id=37137和https://bugzilla.xamarin.com/show_bug.cgi?id=39772它看起来像文档Web服务的页面尚未实现。但是,尽管出现此错误,Web服务应该可以正常工作。您可以通过在URL末尾添加?WSDL来查看它,即http://localhost/WebService1.asmx?WSDL?WSDL以上就是C#学习教程:WebservicedoesnotworkinMono4分享的所有内容,如果对大家有用还需要详细了解C#学习教程,希望大家多加关注——本文来自来自网络采集,不代表立场,如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
