外部应用程序调用.asmx Web服务时,StoredProcedure没有结果(Deltek愿景)

亲爱的开发人员,

我将从一开始就提供尽可能多的上下文和信息。

几天前,我们收到了一位客户的要求。他们想更改我们为其维护的Web服务正在使用的存储过程。

网络服务功能将执行以下操作:

  • 接受1个参数,输入字符串。
  • 使用指定的参数在配置的数据库上执行SP。
  • 将结果映射到从EF自动生成的模型中。 (在更新模型时生成)
  • 将结果序列化为JSON字符串。
  • 将此JSON字符串添加到Azure队列

存储过程没有什么特别的。一些联接并在某些表上选择,仅此而已。

存储过程的更改导致模型(.edmx)的更新,因为添加了新列,并删除了一些旧列。

在将新的存储过程添加到我的本地开发环境中并更新了模型之后,我进行了测试运行。 它立即起作用。我从存储过程中获得了预期的输出,并且结果成功地序列化了。此后,该字符串已成功添加到Azure队列。

应客户要求,我将Web服务直接发布到生产服务器。

我通过导航到url并手动调用该函数并传递正确的参数,对生产服务器进行了快速测试。好的,结果是预期的。日志记录还显示一切正常,我们得到了预期的结果。

现在出现了奇怪的部分;

正在通过外部应用程序(Deltek Vision)使用Web服务。 通过单击一个按钮来调用它,然后通过配置的参数调用webservice函数。 单击按钮后,我们继续检查Azure队列,我们​​收到一条空消息。什么?

我检查日志文件并看到以下内容:

注意:我删除了所有敏感信息。

20200310 13:52:34 Information Function called..
20200310 13:52:34 Information Project param: Parameter
20200310 13:52:34 Information Fired SP and got result!
20200310 13:52:34 Information Raw object: System.Data.Objects.ObjectResult`1[ComplexReturnType]
20200310 13:52:34 Information Database info [Name]: CatalogName
20200310 13:52:34 Information Database info [ConnectionString]: data source=ServerInstance;initial catalog=Catalog;persist security info=True;user id=user;password=password;MultipleactiveResultSets=True;App=EntityFramework
20200310 13:52:34 Information Database info [TimeOut]: 15
20200310 13:52:34 Information Database info [DataSource]: ServerInstance
20200310 13:52:34 Information Database info [ServerVersion]: 11.00.6537
20200310 13:52:34 Information Database info [State]: Open
20200310 13:52:34 Information Element type: <Correct Type here>
20200310 13:52:34 Information New list has Items: False
20200310 13:52:34 Information Serialized response: []             <--- This is where i expect result
20200310 13:52:34 Information Succesfully added message!

与我通过直接导航到消耗的URL进行的呼叫相比:

20200310 13:48:41 Information Function called..
20200310 13:48:41 Information Project param: Parameter
20200310 13:48:41 Information Fired SP and got result!
20200310 13:48:41 Information Raw object: System.Data.Objects.ObjectResult`1[CorrectComplexType]
20200310 13:48:41 Information Database info [Name]: CatalogName
20200310 13:48:41 Information Database info [ConnectionString]: data source=ServerInstance;initial catalog=catalog;persist security info=True;user id=user;password=password;MultipleactiveResultSets=True;App=EntityFramework
20200310 13:48:41 Information Database info [TimeOut]: 15
20200310 13:48:41 Information Database info [DataSource]: ServerInstance
20200310 13:48:41 Information Database info [ServerVersion]: 11.00.6537
20200310 13:48:41 Information Database info [State]: Open
20200310 13:48:41 Information Element type: <CorrectComplexType>
20200310 13:48:41 Information New list has Items: True
20200310 13:48:42 Information Serialized response: [Correct JSON string here]   <--- Proper JSON string here
20200310 13:48:42 Information Succesfully added message!

所以现在我陷入了一个我似乎无法克服的问题; 通过Deltek调用该函数时,存储过程不提供任何输出,但是在本地调用该函数时,它将提供输出。

我尝试过/考虑过的事情:

  • 权限和权利=>我们通过Deltek或浏览器调用该函数是相同的。执行相同代码>,并且使用相同帐户访问数据源。
  • 在SSMS中执行SP =>就像一个超级按钮。
  • Sql Server事件探查器=>我比较了成功方案和失败方案。它们在事件探查器中是相同的。 (我似乎无法在Server Profiler中找到SP生成的实际输出,可以吗?)
  • 连接到生产数据库时,在本地运行Web服务。附加调试器并调用该函数;结果符合预期,没什么奇怪的,我们得到了输出。

这已经过去6个月了。 (更改之前)

任何有关如何进一步诊断的提示都将受到赞赏。

liping0207 回答:外部应用程序调用.asmx Web服务时,StoredProcedure没有结果(Deltek愿景)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2670877.html

大家都在问