BizTalk Web 服务返回一个值而不是 void +参考

发布于 2024-11-19 01:14:10 字数 341 浏览 4 评论 0原文

无论如何,是否可以让 BizTalk Web 服务向导生成的 Web 服务让编排返回一个值,而不是使用 void return 并使用 return by ref ?

我正在尝试模拟一个非常简单的现有 Web 服务... Web 方法接受一个字符串并返回一个字符串... public string MyTestMethod(string MyVal)

Web 服务的代理从编排工作,但 BizTalk 向导生成... public void MyTestMethod (ref string MyVal)

我已经尝试了高级选项,强制请求响应,但这似乎没有做任何事情

Is there anyway to get the web service generated by the BizTalk Web Services Wizard for an orchestration to return a value, rather than it have a void return and it use return by ref ?

I'm trying to emulate an existing web service which is very simple ... the web method takes a string and returns a string ... public string MyTestMethod(string MyVal)

The proxy to the web service from the orchestration works, but the BizTalk wizard generates ... public void MyTestMethod (ref string MyVal)

I've tried the Advanced option, Force Request Response, but that doesn't seem to do anything

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

來不及說愛妳 2024-11-26 01:14:10

您是否正在尝试将 Orchestration 发布为 Web 服务或架构即服务?

使用 Web 服务向导时的注意事项:http://technet. microsoft.com/en-us/library/aa559660(BTS.20).aspx ... 适用于 2006 R2

Are you trying to publish an Orchestration as a web service or Schema as a service?

Considerations while using the web service wizard : http://technet.microsoft.com/en-us/library/aa559660(BTS.20).aspx ... for 2006 R2

独自唱情﹋歌 2024-11-26 01:14:10

我找到的唯一答案是手动编辑 BizTalk Web 服务发布向导生成的 ASMX.CS 文件...

  • 更改参数中方法的 ElementName ... ([XmlElement(Namespace = null, ElementName = "XML")] string 部分)

  • 完全删除... [return: System.Xml.Serialization.XmlElementAttribute ...] 属性

  • Plus 调整 WebService(Name="", Namespace="",...) 值以适应

这当然意味着您不能仅使用向导重新生成:-(

The only answer I found was to manually edit the ASMX.CS file that the BizTalk Web Service Publishing Wizard generates ...

  • Change the ElementName on the methods in parameter ... ([XmlElement(Namespace = null, ElementName = "XML")] string part)

  • Completely remove the ... [return: System.Xml.Serialization.XmlElementAttribute ...] attribute

  • Plus adjust the WebService(Name="", Namespace="",...) values to suit

This of course means that you can't just re-generate with the Wizard :-(

纸短情长 2024-11-26 01:14:10

我知道这是一篇相当老的帖子,但以防万一其他人看到它:我设法按照上面 Tom Redfern 的建议做到了。如果您的入站编排端口是双向的,它会完美地工作。

就我而言,我必须将编排公开为 WCF 服务,其中我的编排接收域(例如“gmail.com”)作为输入参数,进行一些处理,最后执行一个存储过程来获取所属的电子邮件列表到该域。所以我有一个“Domain”作为输入,“ListOfUsers”作为输出。将入站编排端口设置为“TWO-WAY”允许我接收“Domain”类型的消息并输出“ListOfUsers”类型的消息。

之后我可以使用“BizTalk WCF 服务发布向导”,它完美地生成了它。只需调整命名空间、端口名称、应用程序池等,一切都很好!尝试使用 SoapUI,效果非常好!

I know it's a quite old post, but just in case some else comes to it: I managed to do it as suggested by Tom Redfern above. It works perfectly if your inbound orchestration port is two-way.

In my case I had to expose an orchestration as WCF service where my orchestration receives a domain (e.g. "gmail.com") as input parameter, does some processing and at the end executes a stored procedure that fetches a list of e-mails belonging to that domain. So I had a "Domain" as input and "ListOfUsers" as output. Having my inbound orchestration port as "TWO-WAY" allowed me to receive a message of type "Domain" and output message of type "ListOfUsers".

Afterwards I could use "BizTalk WCF Service Publishing Wizard" and it generates it perfectly. Just had to adjust namespaces, port names, application pool and etc. and all good! Tried using SoapUI and works brilliant!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文