简体   繁体   English

使用Play Framework 1.2.5访问Web服务

[英]Accessing Web Service using Play Framework 1.2.5

I am using Play framework 1.2.5 in my application in Eclipse IDE . 我在Eclipse IDE的应用程序中使用Play框架1.2.5 I need to access a web service built using IBM JAX-RPC . 我需要访问使用IBM JAX-RPC构建的Web服务。 I have got the wsdl file of the web service which I need to access in my applicatiom. 我已经有Web服务的wsdl文件,需要在我的应用程序中访问该文件。

For normal Java EE applications, I used to paste the WSDL in my workspace, generate the files by right clicking the WSDL file => Generate Client option ie generating files with the help of Eclipse IDE. 对于普通的Java EE应用程序,我曾经将WSDL粘贴到我的工作区中,通过右键单击WSDL file => Generate Client选项来生成文件,即在Eclipse IDE的帮助下生成文件。

I am not sure how to access the WSDL using Play framework. 我不确定如何使用Play框架访问WSDL。

I want to know: 我想知道:

1) Where to paste the WSDL file in my workspace? 1)哪里将WSDL文件粘贴到我的工作区中?

2) In Play framework how do generate the client (Not sure even if we need this or not in play framework) and access the service methods? 2)在Play框架中如何生成客户端(即使我们在游戏框架中是否需要此客户端也不知道)并访问服务方法?

3) Any additional settings needed for accessing the service methods? 3)访问服务方法还需要其他设置吗?

Please let me know about this. 请让我知道这一点。

Regards, 问候,

The easy way: 简单的方法:

Use Play!'s built-in play.libs.WS (Link #2 and #3 ). 使用Play!的内置play.libs.WS (链接#2#3 )。 You have to create the raw HTTP requests yourself, and parse the XML result from the server yourself. 您必须自己创建原始HTTP请求,然后自己解析服务器的XML结果。 Of course, this can become a complex task, if the web service interface is complex. 当然,如果Web服务接口很复杂,那么这可能会变得很复杂。

Preferably, you will create a JAX-RPC client based on your WSDL , and use it from your Play! 最好,您将基于WSDL创建一个JAX-RPC客户端 ,并在Play中使用它! application. 应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM