服务堆栈(REST)SOAP和WSDL无法正常工作

Ali*_*zza 3 c# rest servicestack

我实现了ServiceStack Hello World,除了一件重要的事情外,每件事都没问题.它的SOAP11和SOAP12以及WSDL也无法正常工作.当访问URL http:// localhost:8082/SOAP11 / for SOAP11或SOAP12时,它说:

{
"ResponseStatus":{
 "ErrorCode":"NotImplementedException",
 "Message":"The method or operation is not implemented.",
 "StackTrace":"   at ServiceStack.WebHost.Endpoints.Support.EndpointHandlerBase.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\\src\\ServiceStack\\src\\ServiceStack\\WebHost.EndPoints\\Support\\EndpointHandlerBase.cs:line 52\n   at ServiceStack.WebHost.Endpoints.AppHostHttpListenerBase.ProcessRequest(HttpListenerContext context) in C:\\src\\ServiceStack\\src\\ServiceStack\\WebHost.EndPoints\\AppHostHttpListenerBase.cs:line 57\n   at ServiceStack.WebHost.Endpoints.Support.HttpListenerBase.ListenerCallback(IAsyncResult asyncResult) in C:\\src\\ServiceStack\\src\\ServiceStack\\WebHost.EndPoints\\Support\\HttpListenerBase.cs:line 197"
}
}
Run Code Online (Sandbox Code Playgroud)

我是通过控制台主机实现的.我的控制台主机类:

 public class AppHost
    : AppHostHttpListenerBase
{
    public AppHost() //Tell ServiceStack the name and where to find your web services
        : base("ServiceStack Examples", typeof(InventoryREST.Hello).Assembly) { }

    public override void Configure(Funq.Container container)
    {
    }
}
Run Code Online (Sandbox Code Playgroud)

当我想通过WSDL访问它时,它什么都没显示,只是空白页面和cpu工作...

Ali*_*zza 6

托管在HttpListener主机上时(即在独立控制台中),SOAP端点不可用.

您需要在ASP.NET主机中托管它以查看XSD和WSDL.