从 Silverlight 调用 JSP
我们有一个用Java开发的网站,JSP运行在apache服务器上。
出于可用性原因,决定设计一个 Silverlight Web 应用程序并从 silverlight
http 请求调用 JSP URL,例如 http://mydomain.myapp.com/transaction/transactionlist.jsp 将以 JSON 格式返回响应。
我认为可以使用 System.web.httprequest 和关联的类从 Silverlight 调用这些 JSP URL,并使用 .net JSON 基类解析 JSON 响应。
但我只想知道这种做法是否正确。
我尝试调用 JSP url,当我收到协议违规异常时,提示通用“由于对象的当前状态,该操作无效。没有找到任何其他可以帮助我的信息。任何评论/指导都是真的赞赏。
We have a website developed in Java, JSP runs in a apache server.
For Usability reasons it was decided to design a Silverlight web application and invoke the JSP URLs from silverlight
http requests such as http://mydomain.myapp.com/transaction/transactionlist.jsp would return the response in JSON format.
I was thinking that its possible to invoke these JSP URLs from Silverlight using System.web.httprequest and associated classes and parse the JSON response using the .net JSON base classes.
But I just want to know if this approach is correct.
I tried invoking a JSP url and the moment I got an Protocol Violation exception saying a generic "The operation is not valid due to the current state of the object. Did not find any other information that can help me. Any comments/Guidance is really appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此问题。当然可以做你正在做的事情,但你需要正确配置 HttpWebRequest。具体来说:
See this question. It's certainly possible to do what you're doing, but you need to get the HttpWebRequest configured correctly. Specifically: