通过 Nusoap 向 WCF 发送 GUID

发布于 2024-11-09 18:12:24 字数 130 浏览 3 评论 0原文

我正在使用 Nusoap 调用 WCF 服务。以前所有的函数都有“string”或“int”,但这次我们有Guid。它会起作用吗?我需要在两边做一些特别的事情吗?当然,可以重新映射调用,以便它采用字符串而不是 Guid,但如果我不能这样做怎么办?

I am using Nusoap to call a WCF service. Previously all the functions had "string" or "int", but this time we have Guid. Will it work? Do I need to do something special on either side? Certainly it is possible to have the call remapped so that it takes a string instead of a Guid, but what if I cannot do that?

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

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

发布评论

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

评论(1

枕花眠 2024-11-16 18:12:24

在 NuSoap 方面,只要字符串的格式是合法的 Guid 格式(例如 12345678-1234-1234-1234-1234567890AB123456781234123412341234567890AB 等)。在WCF端,它将被解析为强类型的Guid,否则该消息将被拒绝。

这样想,作为 WCF 服务,您并不关心谁在调用您,只要他们根据您的描述传递有效的 XML 文档即可。他们可以使用字符串连接或通过加载文件并替换其中的值来构建整个事物,您不知道也不应该关心。只要他们传递给您的 XML 和值与您同意的架构相匹配,一切都会“正常工作”。

On the NuSoap side it shouldn't matter if you use a string as long as the format of the string is a legal Guid format (e.g. 12345678-1234-1234-1234-1234567890AB, 123456781234123412341234567890AB, etc). On the WCF side it will be parsed into a strongly typed Guid, otherwise the message will be rejected.

Think about it this way, as the WCF service you don't care who's calling you as long as they are passing valid XML documents per your description. They could build the entire thing up using string concatenation or by loading files and replacing values in them, you don't know and shouldn't care. As long as the XML and values they pass you match the schema you've agreed on everything will "just work".

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