【问题标题】:Service Stack (REST) SOAP and WSDL not working服务堆栈 (REST) SOAP 和 WSDL 不起作用
【发布时间】:2011-11-16 19:35:34
【问题描述】:

我实现了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 正在工作......

【问题讨论】:

  • 感谢您回来提供答案 - 但是,请不要编辑您的问题以将其标记为“[已解决]”或包含答案。相反,回答自己问题的礼仪是将答案作为答案发布,而不是编辑问题。

标签: c# rest servicestack


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    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 消息POST 到上述端点。

    如果您不希望它们托管在自定义路径中,则需要将 Web.config 更改为 setup servicestack listening on the root / path

    【讨论】:

    • 我的元数据在 localhost:8082/metadata 上工作,我的自定义路径是 root,但仍然没有 SOAP。
    • 我刚刚尝试过,localhost:{port}/soap11 localhost:{port}/soap12 在 WebDevServer 和 localhost/ServiceStack.Hello/soap11 localhost/ServiceStack.Hello/soap12 在 IIS 上为我工作。您可以发布您正在使用的 Web.config 吗?
    • 我没有使用 IIS,我使用的是控制台 APP 和 microsoft HTTP API,(APPHTTPListenerBase)
    • 我在它的 google 群组中询问过,他们说控制台主机不支持 WSDL,它只支持 ASP.NET 主机。感谢您的回复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-15
    相关资源
    最近更新 更多