【问题标题】:My proxy webservice is missing one method from the real webservice?我的代理网络服务缺少真正网络服务的一种方法?
【发布时间】:2016-07-08 18:16:17
【问题描述】:

我可以浏览到我的代理 Web 服务和我的实际 Web 服务的 URL,但我在我的代理服务和我的实际帐户服务之间缺少一种方法? 我已经尝试了很多东西,但无法让我的代理显示相同的方法。我不知道如何生成映射方法的 wsdl 文件,我什至可以看到该文件缺少该方法,该文件是我从 TFS 下载的一个文件,我在开始在这里工作的第一天就下载了该文件以构建我的网站。

我正在尝试手动更改生成的文件,但它不起作用。当我在我的计算机上查找 svcutil 或 wsdl 时,它一无所获。我需要一台特殊的计算机来运行这些实用程序吗?

“/”应用程序中的服务器错误。 System.Web.Services.Protocols.SoapException:服务器无法识别 HTTP 标头 SOAPAction 的值:http://account.hse.org/GetUserNameByMembershipId。 在 System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() 在 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage 消息) 在 System.Web.Services.Protocols.SoapServerProtocol.Initialize() 在 System.Web.Services.Protocols.ServerProtocolFactory.Create(类型类型、HttpContext 上下文、HttpRequest 请求、HttpResponse 响应、Boolean& abortProcessing) 说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详细信息:System.Web.Services.Protocols.SoapException:System.Web.Services.Protocols.SoapException:服务器无法识别 HTTP 标头 SOAPAction 的值:http://account.hse.org/GetUserNameByMembershipId。 在 System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() 在 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage 消息) 在 System.Web.Services.Protocols.SoapServerProtocol.Initialize() 在 System.Web.Services.Protocols.ServerProtocolFactory.Create(类型类型、HttpContext 上下文、HttpRequest 请求、HttpResponse 响应、Boolean& abortProcessing)

来源错误:

第 197 行:公共字符串 GetUserNameByMembershipId(int membersID) 第 198 行:{ 第 199 行:object[] results = this.Invoke("GetUserNameByMembershipId", new object[] { 第 200 行:membershipID}); 第 201 行:返回 ((string)(results[0]));

源文件:c:\TFS\IT\Web\HseStore.org\HseStore\Hse.Sso.Client\Proxies\AuthServiceProxy.cs 行:199

堆栈跟踪:

[SoapException:System.Web.Services.Protocols.SoapException:服务器无法识别 HTTP 标头 SOAPAction 的值:http://account.hse.org/GetUserNameByMembershipId。 在 System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() 在 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage 消息) 在 System.Web.Services.Protocols.SoapServerProtocol.Initialize() 在 System.Web.Services.Protocols.ServerProtocolFactory.Create(类型类型,HttpContext 上下文,HttpRequest 请求,HttpResponse 响应,Boolean& abortProcessing)] System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage 消息,WebResponse 响应,流 responseStream,布尔 asyncCall)+503338 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] 参数) +215 C:\TFS\IT\Web\HseStore.org\HseStore\Hse.Sso.Client\Proxies\AuthServiceProxy.cs:199 中的 Vfw.Sso.Client.Proxies.AuthServiceProxy.GetUserNameByMembershipId(Int32 会员 ID) C:\TFS\IT\Web\HseStore.org\HseStore\Hse.Sso.Client\Helpers\AuthServiceHelper.cs:103 中的 Vfw.Sso.Client.Helpers.AuthServiceHelper.GetUserNameByMembershipId(Int32 会员 ID) C:\TFS\IT\Web\MAIN\OMSDomain\OMS\CreateAccount.aspx.cs:63 中的 OMS.CreateAccount.btnCreateAccount_Click(Object sender, EventArgs e) System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(字符串事件参数)+124 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(字符串 eventArgument)+10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

【问题讨论】:

    标签: web-services proxy wsdl


    【解决方案1】:

    您使用的是 Visual Studio 吗? 重新生成代理的一种简单方法是删除服务引用并重新添加它。

    如果您需要手动生成代理,则需要 svcutil,此链接将告诉您如何获取它:https://msdn.microsoft.com/en-us/library/aa347733%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    简而言之,您需要 Windows Sdk,然后您可以在以下路径找到 svcutil:C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin

    【讨论】:

    • ok,然后右键,添加服务引用,指向你的服务,一旦创建引用,它会为你生成代理,你应该可以在那里看到你的方法。跨度>
    • 我按照你的要求做了,但我仍然收到我刚刚附加到原始问题的 Soap 错误。
    • 我的电脑上不存在这个路径:C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin???有v6.0A但是没有bin文件夹?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多