简体   繁体   English

JAR / WAR / EAR中的MessageHandler

[英]MessageHandler in JAR/WAR/EAR

I am making a PEP Server which intercepts the SOAP messages, and checks them against WS-Policies defined in a separate database. 我正在制作一个PEP服务器,该服务器将拦截SOAP消息,并对照在单独的数据库中定义的WS-Policies检查它们。 It is divided in 3 compontents: 它分为三个部分:

1) PEP (Policy enforcemenet point) intercepts the messages with a message handler 1)PEP(策略执行点)使用消息处理程序拦截消息

2) sends it to the -> PDP (Policy decision point) decides which message gets through 2)将其发送到-> PDP(策略决策点)决定哪个消息通过

3) this by using the PIP (Policy information point) which has a database with the policies. 3)通过使用具有策略数据库的PIP(策略信息点)来实现。

If the policies are correct, the message gets send further to the web service. 如果策略正确,则消息将进一步发送到Web服务。 Now I was wondering how it would be possible to package this PEP in a JAR file (or WAR/EAR? I am new to this so I am not sure in which kind of package it should come). 现在,我想知道如何将这个PEP打包到一个JAR文件中(或WAR / EAR?我是新手,所以不确定该使用哪种打包方式)。 The PEP is a messagehandler, so the Web service will have to specify a @HandlerChain(file = "handler.xml") PEP是消息处理程序,因此Web服务将必须指定@HandlerChain(file =“ handler.xml”)

Would it now be possible to include this PEP in the xml file, if its in contained in a jar file? 如果将这个PEP包含在jar文件中,现在可以将其包含在xml文件中吗?

I recommend using JAX-WS for creating and invoking Java Web Services. 我建议使用JAX-WS创建和调用Java Web Services。

There's a nice tutorial about creating both a service and a client to invoke the service. 有一个很好的教程,介绍了如何同时创建服务和客户端以调用服务。 In your case, you'd want to zero in on the "A Simple JAX-WS Client" section. 对于您的情况,您希望在“一个简单的JAX-WS Client”部分中置零。 They outline how to do this with NetBeans but you can get the general idea and then revamp for your particular situation. 他们概述了如何使用NetBeans进行此操作,但是您可以了解总体思路,然后针对您的特定情况进行改进。

Here's the link for the tutorial: Creating a Simple Web Service and Client with JAX-WS 这是教程的链接: 使用JAX-WS创建简单的Web服务和客户端

I'm thinking in your situation that you can just create a Java client that gets packaged as a JAR. 我想在您的情况下,您可以创建一个打包为JAR的Java客户端。

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

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