集成 SOAP 和 VXML

发布于 2024-08-09 19:41:15 字数 1394 浏览 5 评论 0原文

我正在为 VXML 应用程序编写一个接口,该接口将允许访问 SOAP 服务。
由于尝试使用 javascript 进行 SOAP 调用固有的困难以及 VXML 的限制,因为进行外部资源调用几乎仅限于 HTTP< /code> 请求、GETPOST

我设计了一个 java servlet,它将充当 VXML 应用程序的服务提供者。它可以使用指示 Web 服务类型、要调用的方法名称以及要传递给它的参数的参数来调用此 servlet。然后,servlet 进行适当的 Web 服务调用并以标准化 VXML 文档响应的形式返回响应。

问题是我严重低估了 SOAP 的真正难度。我以为我可以简单地构建soap调用并在java中执行它,但是在我看来,这有点复杂,需要诸如Apache Axis2之类的东西。

我在某处读到,Axis 的侦听器可能是 HTTP servlet,这听起来很像我已经在做的事情。
我在这里重新发明轮子吗?
对于如何做得更好,有什么建议吗?
我对现在的做法非常投入,因此非常愿意采用一种简单的方法来完成 SOAP 调用并处理来自 jsp servlet 的响应。

编辑 - 在听取了这里的建议后,我进一步深入研究了Axis
事实证明,Axis2 是 Apache 第三代 Apache SOAP。不幸的是,经过大量搜索后,我找不到可以下载原始 Apache SOAP 实现的唯一位置。
我可能不在乎:

A)Axis 是否允许我集成一些 jarsjsps 滚动 进入一个独立的 WAR 应用程序

B) 一切..我的意思是到目前为止的一切都是使用 来自 ApacheSOAP 的示例(我正在使用的书,我使用的代码 到目前为止所写的..一切)。

所以我在谷歌上进行了更多的思考..嘿,必须有某种独立的Java库,它只允许我进行一次简单的SOAP调用并解析结果。
但不,没有这样的运气!
显然,如果您想使用 Java 和 SOAP,您要么拥有巨大且难以理解的厚重和复杂的轴,要么……您从头开始滚动自己的肥皂实现。我对此很恼火。我不明白为什么肥皂如此美妙,因为过去 7 天 13 小时我一直试图从 JSP 获取一个简单的 hello world 请求。

I am writing an interface for our VXML application that will allow access to a SOAP service.
Because of the difficulties inherent in trying to use javascript to make SOAP calls and the limitations of VXML, as in making external resource calls are pretty much limited to HTTP requests, GET and POST.

I designed a java servlet that would act as a service provider to the VXML application. It can call this servlet with arguments indicating the web service type, the method name to invoke and the arguments to pass to it. The servlet then makes the appropriate web service call and returns the response in a standardized VXML document response.

The issue is I severely underestimated how difficult SOAP really is. I thought I could just simply construct the soap call and do it in java, however its looking to me like this is something a little more involved, requiring things like Apache Axis2.

I read somewhere that listeners for Axis could be HTTP servlets, which sounds a lot like what I am doing already.
Am I re-inventing the wheel here?
Is there any suggestion out there for me as to how to do this better?
I am pretty invested in the way I'm doing it now and so would be very receptive to an easy way to accomplish the SOAP call and process the response from a jsp servlet.

EDIT - After taking the advice here I've delved a little further into Axis.
As it turns out, Axis2 is Apache's third generation of Apache SOAP. Whats unfortunate about this is that after extensive searching I cannot find a single solitary place where the original Apache SOAP implementation can be downloaded.
I might not care if:

A) Axis would allow me to integrate a few jars and jsps rolled
into a standalone WAR app

B) everything .. i mean everything up to this point has been done using
examples from ApacheSOAP (the book i was using, the code I've
written thus far .. everything).

So I google some more thinking .. hey, there has to be some kind of stand alone library for Java that would just simply allow me to make a single solitary simple SOAP call and parse the results.
But no, no such luck!
Apparently if you want to use Java and SOAP you have either the gigantic incomprehensibly thick and complicated axis or .. you roll your own soap implementation from the ground up. I am so burned on this. I don't get why soap is so wonderful given the last 7 13 hour days I've spent just trying to get a simple hello world request to work from JSP.

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

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

发布评论

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

评论(1

注定孤独终老 2024-08-16 19:41:15

像 Axis 这样的库绝对是解决方案,您不想尝试自己构建/解析 SOAP 消息。

查看使用 wsdl2java ( 另一个链接,以及 另一个)来创建可以调用Web 服务的客户端代理。这将生成一堆 Java 代码,您可以从代码中调用它们,然后 Axis 会将您的参数打包到 XML 消息中,通过线路将其发送到服务器,反序列化响应等。

A library like Axis is definitely the solution, you do not want to attempt to build/parse SOAP messages on your own.

Look at using wsdl2java (another link, and another) to create client proxies for which you can invoke the web services. This will generate a bunch of Java code which you can call into from your code, and then Axis will handle packaging your arguments into XML messages, sending it across the wire to the server, de-serializing the response, etc.

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