Java EE和Java ME应用程序集成(Java EE and Java ME application integration)

系统教程 行业动态 更新时间:2024-06-14 16:58:30
Java EE和Java ME应用程序集成(Java EE and Java ME application integration)

我是最后一年的学生,并为我的最后一年项目工作。 我需要帮助,因为我遇到了问题。 实际上,我使用Java EE和Oracle数据库建立了一个网站。

现在,在我的项目中,使用移动应用程序还有一个模块检查状态,我使用Java ME制作并安装在移动设备上。 现在,我想使用此移动应用程序将数据插入Oracle数据库。 我将使用移动设备输入的任何值都需要输入到在localhost上运行的数据库中。

但是,我不知道如何集成这两种技术(Java EE + Java ME)并在localhost上进行交互。 我正在使用NetBeans 6.8 IDE来开发项目。 任何工具包或任何教程来实现这一目标?

I am a final year student, and working for my final year project. I need help, because I'm stuck with a problem. Actually, I made a website using Java EE with an Oracle database.

Now, in my project, there is one more module checking status using a mobile application, which I have made using Java ME and that is installed on a mobile. Now, I want to insert data into the Oracle database by using this mobile application. Whatever value I'll enter using the mobile needs to be entered into the database, which is running on localhost.

But, I don't have any idea how to integrate these two technology (Java EE + Java ME) and interact on localhost. I am using NetBeans 6.8 IDE for developing the project. Any toolkit or any tutorial to achieve this?

最满意答案

如果您使用Netbeans,您可以使用SOAP Web服务轻松完成。 创建无状态EJB并将其方法标记为Web服务方法,然后在您的计算机上运行它。 运行Web服务后,可以使用Netbeans向导轻松地在Java ME应用程序上创建Web服务存根,只需在创建ejb Web服务端点时为其生成正确的wsdl文件。 要从移动设备访问Web服务,您必须将其实际暴露给外部世界。 如果您找到外部IP地址并在家中正确配置路由器,则可以执行此操作。 一旦您可以使用外部IP访问Web服务,您可以尝试重新生成移动应用程序上的存根,将其部署到真实设备并检查其是否正常工作。

如果您不想打扰从外部访问Web服务,您可以随时在模拟器上测试Java ME应用程序,在这种情况下,您的模拟器将识别您已部署应用程序的“localhost”地址。

它应该足以表明您的项目正在模拟器上工作,但同时证明您知道发生了什么以及为什么这样做而不是使用指定的外部IP。

If you are using Netbeans you can do it very easy with SOAP web services. Create an stateless EJB and mark its methods as web service methods, then run it on your machine. Once you have a web service running you can easily create web service stubs on your Java ME application by using Netbeans wizard, just point it the right wsdl file generated for you when you were creating ejb web service endpoint. To access the web service from your mobile you would have to actually expose it to the outside world. You can do that if you'll find out your external IP address and properly configure your router at home. Once you can access your web service using your external IP you can try to regenerate the stubs on your mobile app, deploy it to the real device and check if its working.

If you don't want to bother with accessing your web service from outside world you can always test your Java ME application on your emulator, in that case your emulator will recognize 'localhost' address where you've deployed your app.

It should be enough to show that your project is working on the emulator but at the same time prove that you know whats happening and why you did it this way and not with the specifed external IP.

更多推荐

本文发布于:2023-04-15 03:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/e7286d3692fe319998d45f1f84e8b80d.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   EE   Java   application   integration

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!