3

我实现了ServiceStack Hello World,一切都很好,除了一件重要的事情。它的 SOAP11 和 SOAP12 以及 WSDL 也不起作用。当访问 SOAP11 或 SOAP12 的 url http://localhost:8082/SOAP11/时,它说:

{
"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"
}
}

我通过控制台主机实现了它。我的控制台主机类:

 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)
    {
    }
}

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

4

2 回答 2

6

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

您需要将它托管在 ASP.NET 主机中才能查看 XSD 和 WSDL。

于 2011-11-16T11:35:34.037 回答
3

Hello World 示例项目实际上托管在,/servicestack/因此正确的 url 应该是:

元数据页面: http://localhost:8082/servicestack/metadata

SOAP 1.1 WSDL: http://localhost:8082/servicestack/soap11

SOAP 1.2 WSDL: http://localhost:8082/servicestack/soap12

注意:上面的 WSDL 端点也是您的 SOAP Web 服务的端点,即您的 SOAP 客户端会将SOAP消息发布到上面的端点。

如果您不希望它们托管在自定义路径中,则需要更改 Web.config 以设置在 root / path 上侦听的服务堆栈。

于 2011-11-14T18:16:11.033 回答