使用 JavaScript 从其他应用程序调用我的网络服务?

发布于 2024-09-02 09:18:25 字数 246 浏览 1 评论 0原文

我的应用程序上有 .asmx 网络服务。我需要从其他应用程序调用方法来从我的应用程序获取统计信息。我需要它来返回 XML。对 webmethod 的调用是通过 javascript Soap 完成的。

编辑 我让网络服务正常工作了。我可以执行代码并返回一个字符串,但它停在那里。当我尝试将参数传递到方法中时,它不会工作,当我尝试返回 string[] 或任何其他类型时,它也不会工作。有什么想法吗?我需要做些什么来传递参数吗?

I got .asmx a web service on my app. I need to call a method from an other app to get statistics from my app. I need it to return XML. the call to the webmethod is done with javascript soap.

EDIT
I got the web service working. I can execute code and return a string but it stops there. When I try to pass parameters into the method it wont work and when I try to return a string[] or any other type it wont work either. any ideas? Is there something I need to do passing in parameters?

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

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

发布评论

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

评论(1

迷你仙 2024-09-09 09:18:25

我认为你可以做两件事。

一:在 Web 方法上启用 [ScriptService] 属性。这允许您调用网络服务
使用 JavaScript。
示例< /a>

二:启用http-post/http-get webservice调用
如何启用

I think you could do two things.

One: enable [ScriptService] attribute on web method. This allows you to call the webservice
with javascript.
Example

Two: enable http-post/http-get webservice calls
How to enable

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