savara SVN: r392 - in trunk: validators/jboss/common/src/main/configs/models and 4 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-06 12:53:49 -0400 (Mon, 06 Sep 2010)
New Revision: 392
Added:
trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm
trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/JBossESBInterceptor.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java
Removed:
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java
Modified:
trunk/samples/purchasing/PurchaseGoods.cdm
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/ServiceValidator.java
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceRecorder.java
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceValidator.java
trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/ValidatorFilter.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
Log:
Hooked jbossws-native interceptors into service validator. Producing some initial validation events, but currently flagging some messages as unexpected. PurchaseGoods.cdm has been added to models folder with the necessary annotations.
Modified: trunk/samples/purchasing/PurchaseGoods.cdm
===================================================================
--- trunk/samples/purchasing/PurchaseGoods.cdm 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/samples/purchasing/PurchaseGoods.cdm 2010-09-06 16:53:49 UTC (rev 392)
@@ -53,26 +53,38 @@
<variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/(a)channelTypes.1"/>
<variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/(a)informationTypes.2"/>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
- <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/(a)informationTypes.2"/>
+ <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/(a)informationTypes.2">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
- <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/(a)informationTypes.5"/>
+ <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/(a)informationTypes.5">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
<activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Valid">
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
- <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/(a)informationTypes.4" action="Respond"/>
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/(a)informationTypes.4" action="Respond">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
- <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/(a)informationTypes.0" action="Respond"/>
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/(a)informationTypes.0" action="Respond">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
</activities>
</activities>
<activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
<activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
- <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.3" action="Respond" faultName="CreditCheckFailed"/>
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.3" action="Respond" faultName="CreditCheckFailed">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
</activities>
<activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
- <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.1" action="Respond" faultName="BuyFailed"/>
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.1" action="Respond" faultName="BuyFailed">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
</activities>
</activities>
</activities>
Added: trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm
===================================================================
--- trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm (rev 0)
+++ trunk/validators/jboss/common/src/main/configs/models/PurchaseGoods.cdm 2010-09-06 16:53:49 UTC (rev 392)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for PurchaseGoods" name="PurchaseGoods" author="gary" version="0.1" targetNamespace="http://www.jboss.org/savara/examples">
+ <typeDefinitions>
+ <nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
+ <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+ <nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+ <nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
+ <informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="" elementName="sto:BuyConfirmed"/>
+ <informationTypes description="This is the information type BuyFailed" name="BuyFailed" typeName="" elementName="sto:BuyFailed"/>
+ <informationTypes description="This is the information type BuyRequest" name="BuyRequest" typeName="" elementName="sto:BuyRequest"/>
+ <informationTypes description="This is the information type CreditCheckInvalid" name="CreditCheckInvalid" typeName="" elementName="ca:CreditCheckInvalid"/>
+ <informationTypes description="This is the information type CreditCheckOk" name="CreditCheckOk" typeName="" elementName="ca:CreditCheckOk"/>
+ <informationTypes description="This is the information type CreditCheckRequest" name="CreditCheckRequest" typeName="" elementName="ca:CreditCheckRequest"/>
+ <informationTypes description="This is the information type IDType" name="IDType" typeName="xsd:string"/>
+ <informationTypes description="This is the information type URITokenType" name="URITokenType" typeName="xsd:anyURI"/>
+ <tokens description="This is the token ID" name="ID" informationType="//@typeDefinitions/(a)informationTypes.6"/>
+ <tokens description="This is the token URIToken" name="URIToken" informationType="//@typeDefinitions/(a)informationTypes.7"/>
+ <tokenLocators description="This is the token locator BuyFailedIDLocator" token="//@typeDefinitions/(a)tokens.0" informationType="//@typeDefinitions/(a)informationTypes.1" query="//@id" name="BuyFailedIDLocator"/>
+ <tokenLocators description="This is the token locator BuyRequestIDLocator" token="//@typeDefinitions/(a)tokens.0" informationType="//@typeDefinitions/(a)informationTypes.2" query="//@id" name="BuyRequestIDLocator"/>
+ <tokenLocators description="This is the token locator BuyResponseIDLocator" token="//@typeDefinitions/(a)tokens.0" informationType="//@typeDefinitions/(a)informationTypes.0" query="//@id" name="BuyResponseIDLocator"/>
+ <tokenLocators description="This is the token locator CreditCheckInvalidIDLocator" token="//@typeDefinitions/(a)tokens.0" informationType="//@typeDefinitions/(a)informationTypes.3" query="//@id" name="CreditCheckInvalidIDLocator"/>
+ <tokenLocators description="This is the token locator CreditCheckRequestIDLocator" token="//@typeDefinitions/(a)tokens.0" informationType="//@typeDefinitions/(a)informationTypes.5" query="//@id" name="CreditCheckRequestIDLocator"/>
+ <tokenLocators description="This is the token locator CreditCheckResponseIDLocator" token="//@typeDefinitions/(a)tokens.0" informationType="//@typeDefinitions/(a)informationTypes.4" query="//@id" name="CreditCheckResponseIDLocator"/>
+ <roleTypes description="This is the role type Buyer" name="Buyer">
+ <behaviors description="This is the behavior BuyerBehavior" name="BuyerBehavior"/>
+ </roleTypes>
+ <roleTypes description="This is the role type CreditAgency" name="CreditAgency">
+ <behaviors description="This is the behavior CreditAgencyBehavior" name="CreditAgencyBehavior" interface="ca:CreditAgencyInterface"/>
+ </roleTypes>
+ <roleTypes description="This is the role type Store" name="Store">
+ <behaviors description="This is the behavior StoreBehavior" name="StoreBehavior" interface="sto:StoreInterface"/>
+ </roleTypes>
+ <relationshipTypes description="Relationship between Buyer and Store" name="BuyerToStoreRel" firstRoleType="//@typeDefinitions/(a)roleTypes.0" secondRoleType="//@typeDefinitions/(a)roleTypes.2"/>
+ <relationshipTypes description="Relationship between Store and CreditAgency" name="StoreToCreditAgencyRel" firstRoleType="//@typeDefinitions/(a)roleTypes.2" secondRoleType="//@typeDefinitions/(a)roleTypes.1"/>
+ <participantTypes description="This is the participant type Buyer" name="Buyer" roleTypes="//@typeDefinitions/(a)roleTypes.0">
+ <semanticAnnotations annotation="savara.samples.Purchasing@Buyer" name="conversationType"/>
+ </participantTypes>
+ <participantTypes description="This is the participant type ca:CreditAgency" name="ca:CreditAgency" roleTypes="//@typeDefinitions/(a)roleTypes.1">
+ <semanticAnnotations annotation="savara.samples.Common@CreditAgency" name="conversationType"/>
+ </participantTypes>
+ <participantTypes description="This is the participant type sto:Store" name="sto:Store" roleTypes="//@typeDefinitions/(a)roleTypes.2">
+ <semanticAnnotations annotation="savara.samples.Purchasing@Store" name="conversationType"/>
+ </participantTypes>
+ <channelTypes description="This is the channel type CreditAgencyChannelType" name="CreditAgencyChannelType" referenceToken="//@typeDefinitions/(a)tokens.1" roleType="//@typeDefinitions/(a)roleTypes.1">
+ <identities description="ID" tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ <channelTypes description="This is the channel type StoreChannelType" name="StoreChannelType" referenceToken="//@typeDefinitions/(a)tokens.1" roleType="//@typeDefinitions/(a)roleTypes.2">
+ <identities description="ID" tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ </typeDefinitions>
+ <choreographies description="Choreography flow for the PurchaseGoods process" name="PurchaseGoodsProcess" root="true">
+ <variableDefinitions description="Channel to facilitate interaction to CreditAgency" name="CreditAgencyChannel" type="//@typeDefinitions/(a)channelTypes.0"/>
+ <variableDefinitions description="Channel to facilitate interaction to Supplier" name="SupplierChannel" type="//@typeDefinitions/(a)channelTypes.1"/>
+ <variableDefinitions description="This is the variable buy" name="buy" type="//@typeDefinitions/(a)informationTypes.2"/>
+ <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyRequest" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
+ <exchangeDetails description="This is the exchange details for the request exchange associated with interaction BuyRequest" name="BuyRequestRequestExchange" type="//@typeDefinitions/(a)informationTypes.2">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
+ <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequestExchange" type="//@typeDefinitions/(a)informationTypes.5">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Choice" description="Is credit ok?">
+ <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Valid">
+ <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckOk" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckOk" name="CreditCheckOkRespondExchange" type="//@typeDefinitions/(a)informationTypes.4" action="Respond">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyConfirmed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyConfirmed" name="BuyConfirmedRespondExchange" type="//@typeDefinitions/(a)informationTypes.0" action="Respond">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
+ </activities>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Sequence" description="Credit Invalid">
+ <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheckFailed" operation="checkCredit" channelVariable="//@choreographies.0/(a)variableDefinitions.0" relationship="//@typeDefinitions/(a)relationshipTypes.1">
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheckFailed" name="CreditCheckFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.3" action="Respond" faultName="CreditCheckFailed">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/creditAgency}CreditAge... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction" name="BuyFailed" operation="buy" channelVariable="//@choreographies.0/(a)variableDefinitions.1" relationship="//@typeDefinitions/(a)relationshipTypes.0">
+ <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction BuyFailed" name="BuyFailedRespondExchange" type="//@typeDefinitions/(a)informationTypes.1" action="Respond" faultName="BuyFailed">
+ <semanticAnnotations annotation="<validator>
	<destination name="{{Destination;The URI for the destination;string;;{http://www.jboss.org/examples/store}StoreService}}&q... ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}" />
</validator>
" name="validator"/>
+ </exchangeDetails>
+ </activities>
+ </activities>
+ </activities>
+ </choreographies>
+</org.pi4soa.cdl:Package>
Modified: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/ServiceValidator.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/ServiceValidator.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/ServiceValidator.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -34,19 +34,21 @@
* This method processes a sent message against a service
* behavioural description.
*
+ * @param mesgType The optional message type
* @param msg The message
* @throws Exception Failed to process sent message
*/
- public void messageSent(java.io.Serializable msg) throws Exception;
+ public void messageSent(String mesgType, java.io.Serializable msg) throws Exception;
/**
* This method processes a received message against a service
* behavioural description.
*
+ * @param mesgType The optional message type
* @param msg The message
* @throws Exception Failed to process received message
*/
- public void messageReceived(java.io.Serializable msg) throws Exception;
+ public void messageReceived(String mesgType, java.io.Serializable msg) throws Exception;
/**
* This method is called to update the model associated
Modified: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceRecorder.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceRecorder.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceRecorder.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -94,16 +94,19 @@
* This method processes a sent message against a service
* behavioural description.
*
+ * @param mesgType The optional message type
* @param msg The message
* @throws Exception Failed to process sent message
*/
- public void messageSent(java.io.Serializable msg) throws Exception {
+ public void messageSent(String mesgType, java.io.Serializable msg) throws Exception {
if (msg == null) {
throw new ServiceException("Failed to obtain value from message: "+msg);
}
- String mesgType=MessageUtil.getMessageType(msg);
+ if (mesgType == null) {
+ mesgType = MessageUtil.getMessageType(msg);
+ }
org.pi4soa.service.Message mesg=
m_monitor.createMessage(mesgType,
@@ -118,16 +121,19 @@
* This method processes a received message against a service
* behavioural description.
*
+ * @param mesgType The optional message type
* @param msg The message
* @throws Exception Failed to process received message
*/
- public void messageReceived(java.io.Serializable msg) throws Exception {
+ public void messageReceived(String mesgType, java.io.Serializable msg) throws Exception {
if (msg == null) {
throw new ServiceException("Failed to obtain value from message: "+msg);
}
- String mesgType=MessageUtil.getMessageType(msg);
+ if (mesgType == null) {
+ mesgType = MessageUtil.getMessageType(msg);
+ }
org.pi4soa.service.Message mesg=
m_monitor.createMessage(mesgType,
Modified: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceValidator.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceValidator.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/Pi4SOAServiceValidator.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -155,17 +155,20 @@
* This method processes a sent message against a service
* behavioural description.
*
+ * @param mesgType The optional message type
* @param msg The message
* @throws Exception Failed to process sent message
*/
- public void messageSent(java.io.Serializable msg) throws Exception {
+ public void messageSent(String mesgType, java.io.Serializable msg) throws Exception {
if (msg == null) {
throw new ServiceException("Failed to obtain value from message: "+msg);
}
- String mesgType=MessageUtil.getMessageType(msg);
-
+ if (mesgType == null) {
+ mesgType = MessageUtil.getMessageType(msg);
+ }
+
org.pi4soa.service.Message mesg=
m_monitor.createMessage(mesgType,
null, null, msg, null, null);
@@ -179,16 +182,19 @@
* This method processes a received message against a service
* behavioural description.
*
+ * @param mesgType The optional message type
* @param msg The message
* @throws Exception Failed to process received message
*/
- public void messageReceived(java.io.Serializable msg) throws Exception {
+ public void messageReceived(String mesgType, java.io.Serializable msg) throws Exception {
if (msg == null) {
throw new ServiceException("Failed to obtain value from message: "+msg);
}
- String mesgType=MessageUtil.getMessageType(msg);
+ if (mesgType == null) {
+ mesgType = MessageUtil.getMessageType(msg);
+ }
org.pi4soa.service.Message mesg=
m_monitor.createMessage(mesgType,
Copied: trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/JBossESBInterceptor.java (from rev 378, trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/ValidatorFilter.java)
===================================================================
--- trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/JBossESBInterceptor.java (rev 0)
+++ trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/JBossESBInterceptor.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -0,0 +1,285 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.validator.jbossesb;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.savara.validator.Endpoint;
+import org.jboss.savara.validator.ServiceValidator;
+import org.jboss.savara.validator.ServiceValidatorManager;
+import org.jboss.soa.esb.message.*;
+import org.jboss.soa.esb.couriers.*;
+
+/**
+ * This class represents the filter used to intercept ESB
+ * messages an apply them to relevant Service Validators.
+ */
+public class JBossESBInterceptor extends org.jboss.soa.esb.filter.InputOutputFilter {
+
+ private static final String TOPIC_PREFIX = "topic/";
+ private static final String QUEUE_PREFIX = "queue/";
+ private static final String JMS_PROTOCOL_PREFIX = "jms:";
+
+ private static final Logger logger = Logger.getLogger(JBossESBInterceptor.class);
+
+ private ServiceValidatorManager m_serviceValidatorManager=null;
+
+ /**
+ * The default constructor.
+ */
+ public JBossESBInterceptor() {
+ }
+
+ /**
+ * This method returns the service validator manager.
+ *
+ * @return The service validator manager
+ */
+ protected ServiceValidatorManager getServiceValidatorManager() {
+ if (m_serviceValidatorManager == null) {
+ try {
+ InitialContext ctx = new InitialContext();
+ m_serviceValidatorManager =
+ (ServiceValidatorManager)ctx.lookup("savara/ServiceValidatorManager");
+ } catch (NamingException e) {
+ throw new RuntimeException("Failed to locate Savara Service Validator Manager");
+ }
+ }
+
+ return(m_serviceValidatorManager);
+ }
+
+ /**
+ * This method is invoked when a message is sent by an
+ * ESB service.
+ *
+ * @param msg The ESB message
+ * @param params The parameters
+ * @throws CourierException Failed to validate message
+ */
+ public Message onOutput(Message msg, java.util.Map params)
+ throws CourierException {
+
+ Endpoint endpoint=getEndpoint(msg);
+
+ if (endpoint != null) {
+ java.util.List<ServiceValidator> validators=
+ getServiceValidatorManager().getOutputServiceValidators(endpoint);
+
+ if (validators != null && validators.size() > 0) {
+ boolean validated=false;
+ Exception ex=null;
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ try {
+ validators.get(i).messageSent(null, ESBUtil.getMessage(msg));
+ validated = true;
+ } catch(Exception t) {
+ // Ignore
+ ex = t;
+ }
+ }
+
+ // Only raise exception if none of the service
+ // validators were able to validate the message
+ if (validated == false) {
+ String vnames="";
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ if (vnames.length() > 0) {
+ vnames += ", ";
+ }
+ vnames += validators.get(i).getValidatorName();
+ }
+
+ logger.error("Failed to handle sent message on endpoint '"+
+ endpoint+"' validated against: "+vnames);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Invalid sent message", ex);
+ }
+
+ if (getServiceValidatorManager().isManagedMode()) {
+ throw new CourierException("Failed to handle sent message on endpoint '"+
+ endpoint+"' validated against: "+vnames, ex);
+ }
+ } else {
+
+ // Check whether a dynamic reply is expected
+ if (getServiceValidatorManager().isOutputDynamicReplyTo(endpoint)) {
+
+ // Register interest in the 'reply-to' endpoint
+ Endpoint replyTo=getReplyToEndpoint(msg);
+
+ if (replyTo != null) {
+ getServiceValidatorManager().registerInputReplyToValidators(replyTo,
+ validators);
+ } else {
+ logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
+ }
+ }
+ }
+ }
+ }
+
+ return(msg);
+ }
+
+ /**
+ * This method is invoked when a message is received by an
+ * ESB service.
+ *
+ * @param msg The ESB message
+ * @param params The parameters
+ * @throws CourierException Failed to validate message
+ */
+ public Message onInput(Message msg, java.util.Map params)
+ throws CourierException {
+
+ Endpoint endpoint=getEndpoint(msg);
+
+ if (endpoint != null) {
+ java.util.List<ServiceValidator> validators=
+ getServiceValidatorManager().getInputServiceValidators(endpoint);
+
+ if (validators != null && validators.size() > 0) {
+ boolean validated=false;
+ Exception ex=null;
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ try {
+ validators.get(i).messageReceived(null, ESBUtil.getMessage(msg));
+ validated = true;
+ } catch(Exception t) {
+ // Ignore
+ ex = t;
+ }
+ }
+
+ // Only raise exception if none of the service
+ // validators were able to validate the message
+ if (validated == false) {
+ String vnames="";
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ if (vnames.length() > 0) {
+ vnames += ", ";
+ }
+ vnames += validators.get(i).getValidatorName();
+ }
+
+ logger.error("Failed to handle received message on endpoint '"+
+ endpoint+"' validated against: "+vnames);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Invalid received message", ex);
+ }
+
+ if (getServiceValidatorManager().isManagedMode()) {
+ throw new CourierException("Failed to handle received message on endpoint '"+
+ endpoint+"' validated against: "+vnames, ex);
+ }
+ } else {
+
+ // Check whether a dynamic reply is expected
+ if (getServiceValidatorManager().isInputDynamicReplyTo(endpoint)) {
+
+ // Register interest in the 'reply-to' endpoint
+ Endpoint replyTo=getReplyToEndpoint(msg);
+
+ if (replyTo != null) {
+ getServiceValidatorManager().registerOutputReplyToValidators(replyTo,
+ validators);
+ } else {
+ logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
+ }
+ }
+ }
+ }
+ }
+
+ return(msg);
+ }
+
+ /**
+ * This method returns an endpoint associated with the 'to'
+ * destination of the supplied message.
+ *
+ * @param msg The message
+ * @return The endpoint, or null if not relevant
+ */
+ protected Endpoint getEndpoint(Message msg) {
+ Endpoint ret=null;
+
+ if (msg != null && msg.getHeader() != null &&
+ msg.getHeader().getCall() != null &&
+ msg.getHeader().getCall().getTo() != null &&
+ msg.getHeader().getCall().getTo().getAddr() != null) {
+
+ String key=msg.getHeader().getCall().getTo().getAddr().getAddress();
+ int ind=-1;
+
+ if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
+ ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
+ (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
+ ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
+ }
+ }
+
+ logger.debug("Destination for message '"+msg+"' is: "+ret);
+
+ return(ret);
+ }
+
+ /**
+ * This method returns an endpoint associated with the 'to'
+ * destination of the supplied message.
+ *
+ * @param msg The message
+ * @return The endpoint, or null if not relevant
+ */
+ protected Endpoint getReplyToEndpoint(Message msg) {
+ Endpoint ret=null;
+
+ if (msg != null && msg.getHeader() != null &&
+ msg.getHeader().getCall() != null &&
+ msg.getHeader().getCall().getReplyTo() != null &&
+ msg.getHeader().getCall().getReplyTo().getAddr() != null) {
+
+ String key=msg.getHeader().getCall().getReplyTo().getAddr().getAddress();
+ int ind=-1;
+
+ if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
+ ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
+ (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
+ ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
+ }
+ }
+
+ logger.debug("Reply-To Destination for message '"+msg+"' is: "+ret);
+
+ return(ret);
+ }
+}
Modified: trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/ValidatorFilter.java
===================================================================
--- trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/ValidatorFilter.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/esb/src/main/java/org/jboss/savara/validator/jbossesb/ValidatorFilter.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -1,285 +1,36 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.savara.validator.jbossesb;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-
-import org.jboss.savara.validator.Endpoint;
-import org.jboss.savara.validator.ServiceValidator;
-import org.jboss.savara.validator.ServiceValidatorManager;
-import org.jboss.soa.esb.message.*;
-import org.jboss.soa.esb.couriers.*;
-
-/**
- * This class represents the filter used to intercept ESB
- * messages an apply them to relevant Service Validators.
- */
-public class ValidatorFilter extends org.jboss.soa.esb.filter.InputOutputFilter {
-
- private static final String TOPIC_PREFIX = "topic/";
- private static final String QUEUE_PREFIX = "queue/";
- private static final String JMS_PROTOCOL_PREFIX = "jms:";
-
- private static final Logger logger = Logger.getLogger(ValidatorFilter.class);
-
- private ServiceValidatorManager m_serviceValidatorManager=null;
-
- /**
- * The default constructor.
- */
- public ValidatorFilter() {
- }
-
- /**
- * This method returns the service validator manager.
- *
- * @return The service validator manager
- */
- protected ServiceValidatorManager getServiceValidatorManager() {
- if (m_serviceValidatorManager == null) {
- try {
- InitialContext ctx = new InitialContext();
- m_serviceValidatorManager =
- (ServiceValidatorManager)ctx.lookup("savara/ServiceValidatorManager");
- } catch (NamingException e) {
- throw new RuntimeException("Failed to locate Savara Service Validator Manager");
- }
- }
-
- return(m_serviceValidatorManager);
- }
-
- /**
- * This method is invoked when a message is sent by an
- * ESB service.
- *
- * @param msg The ESB message
- * @param params The parameters
- * @throws CourierException Failed to validate message
- */
- public Message onOutput(Message msg, java.util.Map params)
- throws CourierException {
-
- Endpoint endpoint=getEndpoint(msg);
-
- if (endpoint != null) {
- java.util.List<ServiceValidator> validators=
- getServiceValidatorManager().getOutputServiceValidators(endpoint);
-
- if (validators != null && validators.size() > 0) {
- boolean validated=false;
- Exception ex=null;
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- try {
- validators.get(i).messageSent(ESBUtil.getMessage(msg));
- validated = true;
- } catch(Exception t) {
- // Ignore
- ex = t;
- }
- }
-
- // Only raise exception if none of the service
- // validators were able to validate the message
- if (validated == false) {
- String vnames="";
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- if (vnames.length() > 0) {
- vnames += ", ";
- }
- vnames += validators.get(i).getValidatorName();
- }
-
- logger.error("Failed to handle sent message on endpoint '"+
- endpoint+"' validated against: "+vnames);
-
- if (logger.isDebugEnabled()) {
- logger.debug("Invalid sent message", ex);
- }
-
- if (getServiceValidatorManager().isManagedMode()) {
- throw new CourierException("Failed to handle sent message on endpoint '"+
- endpoint+"' validated against: "+vnames, ex);
- }
- } else {
-
- // Check whether a dynamic reply is expected
- if (getServiceValidatorManager().isOutputDynamicReplyTo(endpoint)) {
-
- // Register interest in the 'reply-to' endpoint
- Endpoint replyTo=getReplyToEndpoint(msg);
-
- if (replyTo != null) {
- getServiceValidatorManager().registerInputReplyToValidators(replyTo,
- validators);
- } else {
- logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
- }
- }
- }
- }
- }
-
- return(msg);
- }
-
- /**
- * This method is invoked when a message is received by an
- * ESB service.
- *
- * @param msg The ESB message
- * @param params The parameters
- * @throws CourierException Failed to validate message
- */
- public Message onInput(Message msg, java.util.Map params)
- throws CourierException {
-
- Endpoint endpoint=getEndpoint(msg);
-
- if (endpoint != null) {
- java.util.List<ServiceValidator> validators=
- getServiceValidatorManager().getInputServiceValidators(endpoint);
-
- if (validators != null && validators.size() > 0) {
- boolean validated=false;
- Exception ex=null;
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- try {
- validators.get(i).messageReceived(ESBUtil.getMessage(msg));
- validated = true;
- } catch(Exception t) {
- // Ignore
- ex = t;
- }
- }
-
- // Only raise exception if none of the service
- // validators were able to validate the message
- if (validated == false) {
- String vnames="";
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- if (vnames.length() > 0) {
- vnames += ", ";
- }
- vnames += validators.get(i).getValidatorName();
- }
-
- logger.error("Failed to handle received message on endpoint '"+
- endpoint+"' validated against: "+vnames);
-
- if (logger.isDebugEnabled()) {
- logger.debug("Invalid received message", ex);
- }
-
- if (getServiceValidatorManager().isManagedMode()) {
- throw new CourierException("Failed to handle received message on endpoint '"+
- endpoint+"' validated against: "+vnames, ex);
- }
- } else {
-
- // Check whether a dynamic reply is expected
- if (getServiceValidatorManager().isInputDynamicReplyTo(endpoint)) {
-
- // Register interest in the 'reply-to' endpoint
- Endpoint replyTo=getReplyToEndpoint(msg);
-
- if (replyTo != null) {
- getServiceValidatorManager().registerOutputReplyToValidators(replyTo,
- validators);
- } else {
- logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
- }
- }
- }
- }
- }
-
- return(msg);
- }
-
- /**
- * This method returns an endpoint associated with the 'to'
- * destination of the supplied message.
- *
- * @param msg The message
- * @return The endpoint, or null if not relevant
- */
- protected Endpoint getEndpoint(Message msg) {
- Endpoint ret=null;
-
- if (msg != null && msg.getHeader() != null &&
- msg.getHeader().getCall() != null &&
- msg.getHeader().getCall().getTo() != null &&
- msg.getHeader().getCall().getTo().getAddr() != null) {
-
- String key=msg.getHeader().getCall().getTo().getAddr().getAddress();
- int ind=-1;
-
- if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
- ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
- (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
- ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
- }
- }
-
- logger.debug("Destination for message '"+msg+"' is: "+ret);
-
- return(ret);
- }
-
- /**
- * This method returns an endpoint associated with the 'to'
- * destination of the supplied message.
- *
- * @param msg The message
- * @return The endpoint, or null if not relevant
- */
- protected Endpoint getReplyToEndpoint(Message msg) {
- Endpoint ret=null;
-
- if (msg != null && msg.getHeader() != null &&
- msg.getHeader().getCall() != null &&
- msg.getHeader().getCall().getReplyTo() != null &&
- msg.getHeader().getCall().getReplyTo().getAddr() != null) {
-
- String key=msg.getHeader().getCall().getReplyTo().getAddr().getAddress();
- int ind=-1;
-
- if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
- ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
- (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
- ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
- }
- }
-
- logger.debug("Reply-To Destination for message '"+msg+"' is: "+ret);
-
- return(ret);
- }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.validator.jbossesb;
+
+/**
+ *
+ * @deprecated Use JBossESBInterceptor instead
+ */
+public class ValidatorFilter extends JBossESBInterceptor {
+
+ /**
+ * The default constructor.
+ */
+ public ValidatorFilter() {
+ }
+
+}
Added: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.validator.jbosswsnative;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.savara.validator.Endpoint;
+import org.jboss.savara.validator.ServiceValidatorManager;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * Common abstract base class for the client and server JBossWS
+ * native interceptors.
+ *
+ */
+public abstract class AbstractJBossWSNativeInterceptor extends GenericSOAPHandler {
+
+ private static Log logger = LogFactory.getLog(AbstractJBossWSNativeInterceptor.class);
+
+ private ServiceValidatorManager m_serviceValidatorManager=null;
+
+ /**
+ * This method returns the service validator manager.
+ *
+ * @return The service validator manager
+ */
+ protected ServiceValidatorManager getServiceValidatorManager() {
+ if (m_serviceValidatorManager == null) {
+ try {
+ InitialContext ctx = new InitialContext();
+ m_serviceValidatorManager =
+ (ServiceValidatorManager)ctx.lookup("savara/ServiceValidatorManager");
+ } catch (NamingException e) {
+ throw new RuntimeException("Failed to locate Savara Service Validator Manager");
+ }
+ }
+
+ return(m_serviceValidatorManager);
+ }
+
+ /**
+ * This method returns the message content.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The message content
+ * @throws Exception Failed to get the message content
+ */
+ public static java.io.Serializable getMessage(SOAPMessageContext soapCtx) throws Exception {
+ java.io.Serializable ret=null;
+
+ SOAPElement elem = getMessageBody(soapCtx);
+ if (elem != null) {
+ ret = DOMWriter.printNode(elem, true);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines the message type associated with the supplied SOAP
+ * message context.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The message type
+ * @throws SOAPException Failed to determine the message type
+ */
+ public static String getMessageType(SOAPMessageContext soapCtx) throws SOAPException {
+ String ret=null;
+
+ if (soapCtx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)soapCtx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata.getInputParameters().size() == 1) {
+ ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
+
+ // TODO: Find out why 'genericParam' is generated when the parameter
+ // is a complex type
+ if (pmd.getXmlName().getLocalPart().equals("genericParam")) {
+
+ // Extract message value
+ SOAPElement elem=getMessageBody(soapCtx);
+
+ ret = elem.getElementQName().toString();
+
+ } else {
+ ret = pmd.getXmlName().toString();
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ protected static SOAPElement getMessageBody(SOAPMessageContext soapCtx) throws SOAPException {
+ SOAPElement ret=null;
+
+ // Extract message value
+ SOAPBody soapBody = soapCtx.getMessage().getSOAPPart().getEnvelope().getBody();
+
+ ret = (SOAPElement)soapBody.getChildElements().next();
+
+ if (ret instanceof SOAPFault) {
+ SOAPFault fault=(SOAPFault)ret;
+
+ ret = (SOAPElement)fault.getDetail().getChildElements().next();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the endpoint associated with the supplied SOAP
+ * message context.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The endpoint
+ */
+ public static Endpoint getEndpoint(SOAPMessageContext soapCtx) {
+ QName service=(QName)soapCtx.get(MessageContext.WSDL_SERVICE);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Service for endpoint = "+service);
+ }
+
+ return(new Endpoint(service.toString()));
+ }
+}
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -17,19 +17,16 @@
*/
package org.jboss.savara.validator.jbosswsnative;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.jboss.savara.validator.Endpoint;
+import org.jboss.savara.validator.ServiceValidator;
-public class JBossWSNativeClientInterceptor extends GenericSOAPHandler {
+public class JBossWSNativeClientInterceptor extends AbstractJBossWSNativeInterceptor {
private static Log logger = LogFactory.getLog(JBossWSNativeClientInterceptor.class);
@@ -40,51 +37,113 @@
}
protected boolean handleInbound(MessageContext ctx) {
+ boolean ret=true;
SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- try {
- Object service=ctx.get(MessageContext.WSDL_SERVICE);
-
- logger.info("Client: Inbound message for service="+service);
+ Endpoint endpoint=getEndpoint(soapCtx);
+
+ if (endpoint != null) {
+ java.util.List<ServiceValidator> validators=
+ getServiceValidatorManager().getOutputServiceValidators(endpoint);
+
+ if (validators != null && validators.size() > 0) {
+ boolean validated=false;
+ Exception ex=null;
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null) {
- System.out.println(DOMWriter.printNode(soapEnv, true));
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ try {
+ validators.get(i).messageReceived(getMessageType(soapCtx), getMessage(soapCtx));
+ validated = true;
+ } catch(Exception t) {
+ // Ignore
+ ex = t;
+ }
+ }
+
+ // Only raise exception if none of the service
+ // validators were able to validate the message
+ if (validated == false) {
+ String vnames="";
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ if (vnames.length() > 0) {
+ vnames += ", ";
+ }
+ vnames += validators.get(i).getValidatorName();
+ }
+
+ logger.error("Failed to handle received message on endpoint '"+
+ endpoint+"' validated against: "+vnames);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Invalid received message", ex);
+ }
+
+ if (getServiceValidatorManager().isManagedMode()) {
+ ret = false;
+ }
+ }
}
-
- QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
-
- logger.info("Client: Inbound message type="+mesgType);
-
- } catch (SOAPException ex) {
- logger.error("Cannot trace SOAPMessage", ex);
}
- return true;
+ return(ret);
}
protected boolean handleOutbound(MessageContext ctx) {
+ boolean ret=true;
SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- try {
- Object service=ctx.get(MessageContext.WSDL_SERVICE);
-
- logger.info("Client: Outbound message for service="+service);
+ Endpoint endpoint=getEndpoint(soapCtx);
+
+ if (endpoint != null) {
+ java.util.List<ServiceValidator> validators=
+ getServiceValidatorManager().getOutputServiceValidators(endpoint);
+
+ if (validators != null && validators.size() > 0) {
+ boolean validated=false;
+ Exception ex=null;
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null) {
- System.out.println(DOMWriter.printNode(soapEnv, true));
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ try {
+ validators.get(i).messageSent(getMessageType(soapCtx), getMessage(soapCtx));
+ validated = true;
+ } catch(Exception t) {
+ // Ignore
+ ex = t;
+ }
+ }
+
+ // Only raise exception if none of the service
+ // validators were able to validate the message
+ if (validated == false) {
+ String vnames="";
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ if (vnames.length() > 0) {
+ vnames += ", ";
+ }
+ vnames += validators.get(i).getValidatorName();
+ }
+
+ logger.error("Failed to handle received message on endpoint '"+
+ endpoint+"' validated against: "+vnames);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Invalid received message", ex);
+ }
+
+ if (getServiceValidatorManager().isManagedMode()) {
+ ret = false;
+ }
+ }
}
-
- QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
-
- logger.info("Client: Outbound message type="+mesgType);
-
- } catch (SOAPException ex) {
- logger.error("Cannot trace SOAPMessage", ex);
}
- return true;
+ return(ret);
}
public boolean handleFault(MessageContext ctx) {
Deleted: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.savara.validator.jbosswsnative;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-/**
- * This class provides utility functions for the JBossWS native interceptors.
- *
- */
-public class JBossWSNativeInterceptorUtil {
-
- /**
- * This method determines the message type associated with the supplied SOAP
- * message context.
- *
- * @param soapCtx The SOAP message context
- * @return The message type
- * @throws SOAPException Failed to determine the message type
- */
- public static QName getMessageType(SOAPMessageContext soapCtx) throws SOAPException {
- QName ret=null;
-
- if (soapCtx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
- org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
- (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)soapCtx;
- org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
-
- if (opmetadata.getInputParameters().size() == 1) {
- ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
-
- // TODO: Find out why 'genericParam' is generated when the parameter
- // is a complex type
- if (pmd.getXmlName().getLocalPart().equals("genericParam")) {
-
- // Extract message value
- SOAPBody soapBody = soapCtx.getMessage().getSOAPPart().getEnvelope().getBody();
-
- SOAPElement elem=(SOAPElement)soapBody.getChildElements().next();
-
- if (elem instanceof SOAPFault) {
- SOAPFault fault=(SOAPFault)elem;
-
- SOAPElement detail=(SOAPElement)fault.getDetail().getChildElements().next();
-
- ret = detail.getElementQName();
-
- } else {
- ret = elem.getElementQName();
- }
- } else {
- ret = pmd.getXmlName();
- }
- }
- }
-
- return(ret);
- }
-
-}
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-06 14:37:42 UTC (rev 391)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-06 16:53:49 UTC (rev 392)
@@ -17,22 +17,16 @@
*/
package org.jboss.savara.validator.jbosswsnative;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.jboss.savara.validator.Endpoint;
+import org.jboss.savara.validator.ServiceValidator;
-public class JBossWSNativeServerInterceptor extends GenericSOAPHandler {
+public class JBossWSNativeServerInterceptor extends AbstractJBossWSNativeInterceptor {
private static Log logger = LogFactory.getLog(JBossWSNativeServerInterceptor.class);
@@ -43,56 +37,113 @@
}
protected boolean handleInbound(MessageContext ctx) {
+ boolean ret=true;
SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ Endpoint endpoint=getEndpoint(soapCtx);
- try {
- Object service=ctx.get(MessageContext.WSDL_SERVICE);
-
- logger.info("Server: Inbound message for service="+service);
+ if (endpoint != null) {
+ java.util.List<ServiceValidator> validators=
+ getServiceValidatorManager().getInputServiceValidators(endpoint);
+
+ if (validators != null && validators.size() > 0) {
+ boolean validated=false;
+ Exception ex=null;
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null) {
- System.out.println(DOMWriter.printNode(soapEnv, true));
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ try {
+ validators.get(i).messageReceived(getMessageType(soapCtx), getMessage(soapCtx));
+ validated = true;
+ } catch(Exception t) {
+ // Ignore
+ ex = t;
+ }
+ }
+
+ // Only raise exception if none of the service
+ // validators were able to validate the message
+ if (validated == false) {
+ String vnames="";
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ if (vnames.length() > 0) {
+ vnames += ", ";
+ }
+ vnames += validators.get(i).getValidatorName();
+ }
+
+ logger.error("Failed to handle received message on endpoint '"+
+ endpoint+"' validated against: "+vnames);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Invalid received message", ex);
+ }
+
+ if (getServiceValidatorManager().isManagedMode()) {
+ ret = false;
+ }
+ }
}
-
- //Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
- //logger.info("Server: Inbound message for operation="+operation);
-
- QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
-
- logger.info("Server: Inbound message type="+mesgType);
-
- } catch (SOAPException ex) {
- logger.error("Cannot trace SOAPMessage", ex);
}
- return true;
+ return(ret);
}
protected boolean handleOutbound(MessageContext ctx) {
+ boolean ret=true;
SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ Endpoint endpoint=getEndpoint(soapCtx);
- try {
- Object service=ctx.get(MessageContext.WSDL_SERVICE);
-
- logger.info("Server: Outbound message for service="+service);
-
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null) {
- System.out.println(DOMWriter.printNode(soapEnv, true));
- }
-
- //Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
- //logger.info("Server: Outbound message for operation="+operation);
+ if (endpoint != null) {
+ java.util.List<ServiceValidator> validators=
+ getServiceValidatorManager().getInputServiceValidators(endpoint);
+
+ if (validators != null && validators.size() > 0) {
+ boolean validated=false;
+ Exception ex=null;
- QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
-
- logger.info("Server: Outbound message type="+mesgType);
- } catch (SOAPException ex) {
- logger.error("Cannot trace SOAPMessage", ex);
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ try {
+ validators.get(i).messageSent(getMessageType(soapCtx), getMessage(soapCtx));
+ validated = true;
+ } catch(Exception t) {
+ // Ignore
+ ex = t;
+ }
+ }
+
+ // Only raise exception if none of the service
+ // validators were able to validate the message
+ if (validated == false) {
+ String vnames="";
+
+ for (int i=0; validators != null &&
+ i < validators.size(); i++) {
+ if (vnames.length() > 0) {
+ vnames += ", ";
+ }
+ vnames += validators.get(i).getValidatorName();
+ }
+
+ logger.error("Failed to handle received message on endpoint '"+
+ endpoint+"' validated against: "+vnames);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Invalid received message", ex);
+ }
+
+ if (getServiceValidatorManager().isManagedMode()) {
+ ret = false;
+ }
+ }
+ }
}
- return true;
+ return(ret);
}
public boolean handleFault(MessageContext ctx) {
13 years, 8 months
savara SVN: r391 - trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-06 10:37:42 -0400 (Mon, 06 Sep 2010)
New Revision: 391
Added:
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java
Modified:
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
Log:
Extract message type from message body when operation metadata only has 'genericParam'. Currently only deals with doclit style.
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-06 10:37:33 UTC (rev 390)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-06 14:37:42 UTC (rev 391)
@@ -17,6 +17,7 @@
*/
package org.jboss.savara.validator.jbosswsnative;
+import javax.xml.namespace.QName;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.ws.handler.MessageContext;
@@ -51,17 +52,10 @@
System.out.println(DOMWriter.printNode(soapEnv, true));
}
- if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
- org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
- (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
- org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
-
- if (opmetadata.getInputParameters().size() == 1) {
- ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
-
- logger.info("Client: Inbound message type="+pmd.getXmlName());
- }
- }
+ QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
+
+ logger.info("Client: Inbound message type="+mesgType);
+
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
@@ -82,17 +76,10 @@
System.out.println(DOMWriter.printNode(soapEnv, true));
}
- if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
- org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
- (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
- org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
-
- if (opmetadata.getInputParameters().size() == 1) {
- ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
-
- logger.info("Client: Outbound message type="+pmd.getXmlName());
- }
- }
+ QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
+
+ logger.info("Client: Outbound message type="+mesgType);
+
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
Added: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeInterceptorUtil.java 2010-09-06 14:37:42 UTC (rev 391)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.savara.validator.jbosswsnative;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+/**
+ * This class provides utility functions for the JBossWS native interceptors.
+ *
+ */
+public class JBossWSNativeInterceptorUtil {
+
+ /**
+ * This method determines the message type associated with the supplied SOAP
+ * message context.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The message type
+ * @throws SOAPException Failed to determine the message type
+ */
+ public static QName getMessageType(SOAPMessageContext soapCtx) throws SOAPException {
+ QName ret=null;
+
+ if (soapCtx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)soapCtx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata.getInputParameters().size() == 1) {
+ ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
+
+ // TODO: Find out why 'genericParam' is generated when the parameter
+ // is a complex type
+ if (pmd.getXmlName().getLocalPart().equals("genericParam")) {
+
+ // Extract message value
+ SOAPBody soapBody = soapCtx.getMessage().getSOAPPart().getEnvelope().getBody();
+
+ SOAPElement elem=(SOAPElement)soapBody.getChildElements().next();
+
+ if (elem instanceof SOAPFault) {
+ SOAPFault fault=(SOAPFault)elem;
+
+ SOAPElement detail=(SOAPElement)fault.getDetail().getChildElements().next();
+
+ ret = detail.getElementQName();
+
+ } else {
+ ret = elem.getElementQName();
+ }
+ } else {
+ ret = pmd.getXmlName();
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+}
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-06 10:37:33 UTC (rev 390)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-06 14:37:42 UTC (rev 391)
@@ -17,8 +17,12 @@
*/
package org.jboss.savara.validator.jbosswsnative;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
@@ -51,21 +55,12 @@
System.out.println(DOMWriter.printNode(soapEnv, true));
}
- Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
-
- logger.info("Server: Inbound message for operation="+operation);
+ //Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
+ //logger.info("Server: Inbound message for operation="+operation);
- if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
- org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
- (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
- org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
-
- if (opmetadata.getInputParameters().size() == 1) {
- ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
-
- logger.info("Server: Inbound message type="+pmd.getXmlName());
- }
- }
+ QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
+
+ logger.info("Server: Inbound message type="+mesgType);
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
@@ -87,22 +82,12 @@
System.out.println(DOMWriter.printNode(soapEnv, true));
}
- Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
-
- logger.info("Server: Outbound message for operation="+operation);
- if (operation != null) logger.info("operation class="+operation.getClass());
-
- if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
- org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
- (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
- org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
-
- if (opmetadata.getInputParameters().size() == 1) {
- ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
-
- logger.info("Server: Outbound message type="+pmd.getXmlName());
- }
- }
+ //Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
+ //logger.info("Server: Outbound message for operation="+operation);
+
+ QName mesgType=JBossWSNativeInterceptorUtil.getMessageType(soapCtx);
+
+ logger.info("Server: Outbound message type="+mesgType);
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
13 years, 8 months
savara SVN: r390 - in trunk/samples/purchasing: completed and 2 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-06 06:37:33 -0400 (Mon, 06 Sep 2010)
New Revision: 390
Added:
trunk/samples/purchasing/completed/
trunk/samples/purchasing/completed/creditAgency/
trunk/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel
trunk/samples/purchasing/completed/creditAgency/bpel-deploy.xml
trunk/samples/purchasing/completed/store/
trunk/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel
trunk/samples/purchasing/completed/store/bpel-deploy.xml
Modified:
trunk/samples/purchasing/PurchaseGoods.cdm
trunk/samples/purchasing/creditAgency.xsd
trunk/samples/purchasing/store.xsd
Log:
Updates to fix validation errors detected by the BPEL editor. Also include a completed version of the creditAgency and store services, as well as providing instructions in the getting started guide (which still needs to be updated).
Modified: trunk/samples/purchasing/PurchaseGoods.cdm
===================================================================
--- trunk/samples/purchasing/PurchaseGoods.cdm 2010-09-03 16:32:42 UTC (rev 389)
+++ trunk/samples/purchasing/PurchaseGoods.cdm 2010-09-06 10:37:33 UTC (rev 390)
@@ -3,7 +3,6 @@
<typeDefinitions>
<nameSpaces description="Target Namespace for PurchaseGoods" prefix="tns" uRI="http://www.jboss.org/savara/examples"/>
<nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
- <nameSpaces prefix="pur" uRI="http://www.jboss.org/examples/purchasing"/>
<nameSpaces prefix="sto" uRI="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
<nameSpaces prefix="ca" uRI="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
<informationTypes description="This is the information type BuyConfirmed" name="BuyConfirmed" typeName="" elementName="sto:BuyConfirmed"/>
Added: trunk/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel
===================================================================
--- trunk/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel (rev 0)
+++ trunk/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel 2010-09-06 10:37:33 UTC (rev 390)
@@ -0,0 +1,65 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Common@CreditAgency" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+ <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+ <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+ <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+ <partnerLinks>
+ <partnerLink myRole="CreditAgencyService" name="StoreToCreditAgency" partnerLinkType="ca:StoreToCreditAgencyServiceLT"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
+ <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
+ <variable messageType="ca:CreditCheckFailedFault" name="creditCheckInvalidVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckRequestVar"/>
+ <if>
+ <bpel:condition><![CDATA[
+ $creditCheckRequestVar.content/@amount <= 500
+ ]]></bpel:condition>
+ <sequence>
+ <assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:CreditCheckOk xmlns:tns="http://www.jboss.org/examples/creditAgency"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+ id="" amount="" >
+ </tns:CreditCheckOk>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="creditCheckOkVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckRequestVar.content/@id</from>
+ <to>$creditCheckOkVar.content/@id</to>
+ </copy>
+ </assign>
+ <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckOkVar"/>
+ </sequence>
+ <else>
+ <sequence>
+ <assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:CreditCheckInvalid xmlns:tns="http://www.jboss.org/examples/creditAgency"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+ id="" amount="" >
+ </tns:CreditCheckInvalid>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="creditCheckInvalidVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckRequestVar.content/@id</from>
+ <to>$creditCheckInvalidVar.content/@id</to>
+ </copy>
+ </assign>
+ <reply faultName="ca:CreditCheckFailed" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckInvalidVar"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added: trunk/samples/purchasing/completed/creditAgency/bpel-deploy.xml
===================================================================
--- trunk/samples/purchasing/completed/creditAgency/bpel-deploy.xml (rev 0)
+++ trunk/samples/purchasing/completed/creditAgency/bpel-deploy.xml 2010-09-06 10:37:33 UTC (rev 390)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:ns1="http://www.jboss.org/examples/creditAgency">
+ <process name="ns1:PurchaseGoodsProcess_CreditAgency">
+ <active>
+ true
+ </active>
+ <provide partnerLink="StoreToCreditAgency">
+ <service name="ns1:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+ </provide>
+ </process>
+</deploy>
Added: trunk/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel
===================================================================
--- trunk/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel (rev 0)
+++ trunk/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel 2010-09-06 10:37:33 UTC (rev 390)
@@ -0,0 +1,94 @@
+<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:pur="http://www.jboss.org/examples/purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing@Store" name="PurchaseGoodsProcess_Store" targetNamespace="http://www.jboss.org/examples/store" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+ <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+ <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+ <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
+ <partnerLinks>
+ <partnerLink myRole="StoreService" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
+ <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+ </partnerLinks>
+ <bpel:messageExchanges>
+ <bpel:messageExchange name="messageExchange"></bpel:messageExchange>
+ <bpel:messageExchange name="messageExchange1"></bpel:messageExchange>
+ </bpel:messageExchanges>
+ <variables>
+ <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+ <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
+ <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
+ <variable messageType="sto:buyResponse" name="buyConfirmedVar"/>
+ <variable messageType="sto:BuyFailedFault" name="buyFailedVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes" name="Receive_BuyRequest" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyRequestVar"/>
+ <scope>
+ <faultHandlers>
+ <catch faultMessageType="ca:CreditCheckFailedFault" faultName="ca:CreditCheckFailed" faultVariable="creditCheckInvalidVar">
+ <sequence>
+ <assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:BuyFailed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tns="http://www.jboss.org/examples/store"
+ xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd "
+ id="" />
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="buyFailedVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckInvalidVar.content/@id</from>
+ <to>$buyFailedVar.content/@id</to>
+ </copy>
+ </assign>
+ <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyFailedVar"/>
+ </sequence>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:CreditCheckRequest xmlns:tns="http://www.jboss.org/examples/creditAgency"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+ id="" amount="" >
+ </tns:CreditCheckRequest>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="creditCheckRequestVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$buyRequestVar.content/@id</from>
+ <to>$creditCheckRequestVar.content/@id</to>
+ </copy>
+ <copy>
+ <from>$buyRequestVar.content/@amount</from>
+ <to>$creditCheckRequestVar.content/@amount</to>
+ </copy>
+ </assign>
+
+ <invoke inputVariable="creditCheckRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="creditCheckOkVar" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"/>
+ portType="ca:CreditAgencyInterface"/>
+ <assign name="CopyPurchaseDetails">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal xml:space="preserve">
+ <tns:BuyConfirmed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tns="http://www.jboss.org/examples/store"
+ xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd "
+ id="" />
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to variable="buyConfirmedVar" part="content"></bpel:to>
+ </bpel:copy>
+ <copy>
+ <from>$creditCheckOkVar.content/@id</from>
+ <to>$buyConfirmedVar.content/@id</to>
+ </copy>
+ </assign>
+ <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyConfirmedVar"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added: trunk/samples/purchasing/completed/store/bpel-deploy.xml
===================================================================
--- trunk/samples/purchasing/completed/store/bpel-deploy.xml (rev 0)
+++ trunk/samples/purchasing/completed/store/bpel-deploy.xml 2010-09-06 10:37:33 UTC (rev 390)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:ns1="http://www.jboss.org/examples/store"
+ xmlns:ns2="http://www.jboss.org/examples/creditAgency">
+ <process name="ns1:PurchaseGoodsProcess_Store">
+ <active>
+ true
+ </active>
+ <provide partnerLink="BuyerToStore">
+ <service name="ns1:StoreService" port="StoreInterfacePort"/>
+ </provide>
+ <invoke partnerLink="StoreToCreditAgency">
+ <service name="ns2:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+ </invoke>
+ </process>
+</deploy>
Modified: trunk/samples/purchasing/creditAgency.xsd
===================================================================
--- trunk/samples/purchasing/creditAgency.xsd 2010-09-03 16:32:42 UTC (rev 389)
+++ trunk/samples/purchasing/creditAgency.xsd 2010-09-06 10:37:33 UTC (rev 390)
@@ -7,5 +7,6 @@
<complexType name="CreditCheckType">
<attribute name="id" type="string"></attribute>
+ <attribute name="amount" type="integer"></attribute>
</complexType>
</schema>
\ No newline at end of file
Modified: trunk/samples/purchasing/store.xsd
===================================================================
--- trunk/samples/purchasing/store.xsd 2010-09-03 16:32:42 UTC (rev 389)
+++ trunk/samples/purchasing/store.xsd 2010-09-06 10:37:33 UTC (rev 390)
@@ -7,5 +7,6 @@
<complexType name="StoreType">
<attribute name="id" type="string"></attribute>
+ <attribute name="amount" type="integer"></attribute>
</complexType>
</schema>
\ No newline at end of file
13 years, 8 months
savara SVN: r389 - in trunk/validators/jboss/wsnative: src/main/java/org/jboss/savara/validator/jbosswsnative and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-03 12:32:42 -0400 (Fri, 03 Sep 2010)
New Revision: 389
Modified:
trunk/validators/jboss/wsnative/pom.xml
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
Log:
Extracts message type from the JBossWS-native OperationMetaData. Works when a complex type is used, but seems to return misleading value (genericParam) when the message part is of type xsd:string, as in the BPEL service as part of the RiftSaw simple_invoke quickstart. Works fine for the JAX-WS service that is invoked.
Modified: trunk/validators/jboss/wsnative/pom.xml
===================================================================
--- trunk/validators/jboss/wsnative/pom.xml 2010-09-03 14:58:23 UTC (rev 388)
+++ trunk/validators/jboss/wsnative/pom.xml 2010-09-03 16:32:42 UTC (rev 389)
@@ -39,6 +39,12 @@
<version>${jbossws.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-core</artifactId>
+ <version>${jbossws.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-03 14:58:23 UTC (rev 388)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-03 16:32:42 UTC (rev 389)
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
@@ -33,7 +34,7 @@
public JBossWSNativeClientInterceptor() {
if (logger.isDebugEnabled()) {
- logger.debug("JBossWSClientListener created");
+ logger.debug("JBossWSNativeClientInterceptor created");
}
}
@@ -49,6 +50,18 @@
if (soapEnv != null) {
System.out.println(DOMWriter.printNode(soapEnv, true));
}
+
+ if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata.getInputParameters().size() == 1) {
+ ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
+
+ logger.info("Client: Inbound message type="+pmd.getXmlName());
+ }
+ }
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
@@ -68,6 +81,18 @@
if (soapEnv != null) {
System.out.println(DOMWriter.printNode(soapEnv, true));
}
+
+ if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata.getInputParameters().size() == 1) {
+ ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
+
+ logger.info("Client: Outbound message type="+pmd.getXmlName());
+ }
+ }
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-03 14:58:23 UTC (rev 388)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-03 16:32:42 UTC (rev 389)
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
@@ -49,7 +50,23 @@
if (soapEnv != null) {
System.out.println(DOMWriter.printNode(soapEnv, true));
}
-
+
+ Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
+
+ logger.info("Server: Inbound message for operation="+operation);
+
+ if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata.getInputParameters().size() == 1) {
+ ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
+
+ logger.info("Server: Inbound message type="+pmd.getXmlName());
+ }
+ }
+
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
@@ -69,6 +86,23 @@
if (soapEnv != null) {
System.out.println(DOMWriter.printNode(soapEnv, true));
}
+
+ Object operation=soapCtx.get(MessageContext.WSDL_OPERATION);
+
+ logger.info("Server: Outbound message for operation="+operation);
+ if (operation != null) logger.info("operation class="+operation.getClass());
+
+ if (ctx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)ctx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata.getInputParameters().size() == 1) {
+ ParameterMetaData pmd=opmetadata.getInputParameters().get(0);
+
+ logger.info("Server: Outbound message type="+pmd.getXmlName());
+ }
+ }
} catch (SOAPException ex) {
logger.error("Cannot trace SOAPMessage", ex);
}
13 years, 8 months
savara SVN: r388 - in trunk: validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-03 10:58:23 -0400 (Fri, 03 Sep 2010)
New Revision: 388
Modified:
trunk/distribution/src/main/release/install/build.xml
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
Log:
Fixed deploy issue with jbossws-native configuration, and updated the interceptors to extract the WSDL service name, which is consistent across inbound/outbound requests on both the client and server interceptors.
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2010-09-02 16:46:14 UTC (rev 387)
+++ trunk/distribution/src/main/release/install/build.xml 2010-09-03 14:58:23 UTC (rev 388)
@@ -61,22 +61,22 @@
<target name="register-jbossws-native-interceptor">
<echo message="register the jbossws-native interceptor" />
- <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
- <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+ <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
<copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-validator.xml"
- tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+ tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
<copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-validator.xml"
- tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
</target>
<target name="unregister-jbossws-native-interceptor">
<echo message="unregister the jbossws-native interceptor" />
- <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
- <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
+ <delete file="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
<copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-original.xml"
- tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+ tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-client-config.xml" />
<copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-original.xml"
- tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ tofile="${deployers.dir}/jbossws.deployer/META-INF/standard-jaxws-endpoint-config.xml" />
</target>
</project>
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-02 16:46:14 UTC (rev 387)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-03 14:58:23 UTC (rev 388)
@@ -17,118 +17,65 @@
*/
package org.jboss.savara.validator.jbosswsnative;
-import java.net.URL;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
-public class JBossWSNativeClientInterceptor extends GenericSOAPHandler
-{
- // provide logging
- private static Logger log = Logger.getLogger(JBossWSNativeClientInterceptor.class);
+public class JBossWSNativeClientInterceptor extends GenericSOAPHandler {
+
+ private static Log logger = LogFactory.getLog(JBossWSNativeClientInterceptor.class);
+
+ public JBossWSNativeClientInterceptor() {
+ if (logger.isDebugEnabled()) {
+ logger.debug("JBossWSClientListener created");
+ }
+ }
- public JBossWSNativeClientInterceptor() {
- System.out.println(">> JBossWSClientListener CREATED");
- }
-
- @SuppressWarnings("unchecked")
- protected boolean handleInbound(MessageContext ctx)
- {
-System.out.println(">> ====================================================");
-System.out.println(">> JBossWSClientListener.handleInbound: ctx="+ctx);
-System.out.println(">> JBossWSClientListener.handleInbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
- HttpServletResponse httpServletResponse = (HttpServletResponse)ctx.get(MessageContext.SERVLET_RESPONSE);
- if (httpServletResponse != null)
- {
- try
- {
- System.out.println(">> JBossWSClientListener.handleInbound: response="+
- httpServletResponse);
- }
- catch (Exception e)
- {
- log.warn("Unable to read from the http servlet response! " + e.getMessage());
- }
- }
-
- //skip message processing if not required since it's very time-consuming
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- try
- {
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- System.out.println(DOMWriter.printNode(soapEnv, true));
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot trace SOAPMessage", ex);
- }
+ protected boolean handleInbound(MessageContext ctx) {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- return true;
- }
+ try {
+ Object service=ctx.get(MessageContext.WSDL_SERVICE);
+
+ logger.info("Client: Inbound message for service="+service);
- @SuppressWarnings("unchecked")
- protected boolean handleOutbound(MessageContext ctx)
- {
-System.out.println(">> ====================================================");
-System.out.println(">> JBossWSClientListener.handleOutbound: ctx="+ctx);
-System.out.println(">> JBossWSClientListener.handleOutbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
-
- HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
- if (httpServletRequest != null)
- {
- try
- {
- System.out.println(">> JBossWSClientListener.handleOutbound: destination url="+
- httpServletRequest.getRequestURL().toString());
- System.out.println(">> JBossWSClientListener.handleOutbound: destination host="+
- new URL(httpServletRequest.getRequestURL().toString()).getHost());
- System.out.println(">> JBossWSClientListener.handleOutbound: source host="+
- httpServletRequest.getRemoteHost());
- }
- catch (Exception e)
- {
- log.warn("Unable to read from the http servlet request! " + e.getMessage());
- }
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null) {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
}
+ } catch (SOAPException ex) {
+ logger.error("Cannot trace SOAPMessage", ex);
+ }
- //skip message processing if not required since it's very time-consuming
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- try
- {
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- System.out.println(DOMWriter.printNode(soapEnv, true));
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot trace SOAPMessage", ex);
- }
+ return true;
+ }
- return true;
- }
+ protected boolean handleOutbound(MessageContext ctx) {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- public boolean handleFault(MessageContext ctx)
- {
- return handleOutbound(ctx);
- }
+ try {
+ Object service=ctx.get(MessageContext.WSDL_SERVICE);
+
+ logger.info("Client: Outbound message for service="+service);
+
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null) {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
+ }
+ } catch (SOAPException ex) {
+ logger.error("Cannot trace SOAPMessage", ex);
+ }
+
+ return true;
+ }
+
+ public boolean handleFault(MessageContext ctx) {
+ return handleOutbound(ctx);
+ }
}
Modified: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-02 16:46:14 UTC (rev 387)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-03 14:58:23 UTC (rev 388)
@@ -17,103 +17,66 @@
*/
package org.jboss.savara.validator.jbosswsnative;
-import java.net.URL;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.namespace.QName;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
-public class JBossWSNativeServerInterceptor extends GenericSOAPHandler
-{
- // provide logging
- private static Logger log = Logger.getLogger(JBossWSNativeServerInterceptor.class);
+public class JBossWSNativeServerInterceptor extends GenericSOAPHandler {
+
+ private static Log logger = LogFactory.getLog(JBossWSNativeServerInterceptor.class);
- public JBossWSNativeServerInterceptor() {
- System.out.println(">> JBossWSListener CREATED");
- }
+ public JBossWSNativeServerInterceptor() {
+ if (logger.isDebugEnabled()) {
+ logger.debug("JBossWSNativeServerInterceptor created");
+ }
+ }
- @SuppressWarnings("unchecked")
- protected boolean handleInbound(MessageContext ctx)
- {
-System.out.println(">> ====================================================");
-System.out.println(">> JBossWSListener.handleInbound: ctx="+ctx);
-System.out.println(">> JBossWSListener.handleInbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
- HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
- if (httpServletRequest != null)
- {
- try
- {
- System.out.println(">> JBossWSListener.handleInbound: destination url="+
- httpServletRequest.getRequestURL().toString());
- System.out.println(">> JBossWSListener.handleInbound: destination host="+
- new URL(httpServletRequest.getRequestURL().toString()).getHost());
- System.out.println(">> JBossWSListener.handleInbound: source host="+
- httpServletRequest.getRemoteHost());
- }
- catch (Exception e)
- {
- log.warn("Unable to read from the http servlet request! " + e.getMessage());
- }
- }
-
- //skip message processing if not required since it's very time-consuming
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- try
- {
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- System.out.println(DOMWriter.printNode(soapEnv, true));
- }
- }
- catch (SOAPException ex)
- {
- log.error("Cannot trace SOAPMessage", ex);
- }
-
- return true;
- }
+ protected boolean handleInbound(MessageContext ctx) {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ try {
+ Object service=ctx.get(MessageContext.WSDL_SERVICE);
+
+ logger.info("Server: Inbound message for service="+service);
- @SuppressWarnings("unchecked")
- protected boolean handleOutbound(MessageContext ctx)
- {
-System.out.println(">> ====================================================");
-System.out.println(">> JBossWSListener.handleOutbound: ctx="+ctx);
-System.out.println(">> JBossWSListener.handleOutbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null) {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
+ }
+
+ } catch (SOAPException ex) {
+ logger.error("Cannot trace SOAPMessage", ex);
+ }
- //skip message processing if not required since it's very time-consuming
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
- try
- {
- SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
- if (soapEnv != null)
- {
- System.out.println(DOMWriter.printNode(soapEnv, true));
- }
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext ctx) {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ try {
+ Object service=ctx.get(MessageContext.WSDL_SERVICE);
+
+ logger.info("Server: Outbound message for service="+service);
+
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null) {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
}
- catch (SOAPException ex)
- {
- log.error("Cannot trace SOAPMessage", ex);
- }
+ } catch (SOAPException ex) {
+ logger.error("Cannot trace SOAPMessage", ex);
+ }
- return true;
- }
+ return true;
+ }
- public boolean handleFault(MessageContext ctx)
- {
- return handleOutbound(ctx);
- }
+ public boolean handleFault(MessageContext ctx) {
+ return handleOutbound(ctx);
+ }
}
13 years, 8 months
savara SVN: r387 - in trunk: distribution/src/files and 6 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-02 12:46:14 -0400 (Thu, 02 Sep 2010)
New Revision: 387
Added:
trunk/distribution/src/files/jbossesb/jbossesb-properties-original.xml
trunk/distribution/src/files/jbossesb/jbossesb-properties-validator.xml
trunk/distribution/src/files/jbossws-native/
trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml
trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml
trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml
trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
Removed:
trunk/distribution/src/files/jbossesb/conf/
Modified:
trunk/distribution/src/main/assembly/bin.xml
trunk/distribution/src/main/release/install/build.xml
trunk/pom.xml
trunk/validators/jboss/wsnative/
trunk/validators/jboss/wsnative/pom.xml
Log:
Added distribution support and configuration for the jbossws-native interceptors, and initial implementation to display message content.
Copied: trunk/distribution/src/files/jbossesb/jbossesb-properties-original.xml (from rev 354, trunk/distribution/src/files/jbossesb/conf/jbossesb-properties.xml)
===================================================================
--- trunk/distribution/src/files/jbossesb/jbossesb-properties-original.xml (rev 0)
+++ trunk/distribution/src/files/jbossesb/jbossesb-properties-original.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+ <property name="org.jboss.soa.esb.mime.text.types" value="text/*;application/xml;application/*-xml"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="security">
+ <property name="org.jboss.soa.esb.services.security.implementationClass" value="org.jboss.internal.soa.esb.services.security.JaasSecurityService"/>
+ <property name="org.jboss.soa.esb.services.security.callbackHandler" value="org.jboss.internal.soa.esb.services.security.UserPassCallbackHandler"/>
+
+ <!-- Algorithm and key size for internal sealing of objects -->
+ <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+ <property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+
+ <!-- Timeout in milliseconds. After which the context is considered invalid -->
+ <property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+ <property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.internal.soa.esb.services.security.JBossASContextPropagator"/>
+
+ <!-- Public keystore configuration used to hold keys for encryption/decryption -->
+ <property name="org.jboss.soa.esb.services.security.publicKeystore" value="/publicKeyStore"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeystorePassword" value="testKeystorePassword"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeyAlias" value="testAlias"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeyPassword" value="testPassword"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
+
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish"/>
+ <property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure"/>
+ <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user" value="root"/>
+ <property name="org.jboss.soa.esb.registry.password" value="root"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+ <property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0"/>
+ <property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3"/>
+
+ <!-- specify the interceptors, in order -->
+ <property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor"/>
+ <!-- Example of specifying multiple registry interceptors
+ <property name="org.jboss.soa.esb.registry.interceptors"
+ value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
+ -->
+
+ <!-- The following properties modify the cache interceptor behaviour -->
+ <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
+ <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
+
+ <!-- Organization Category to be used by this deployment. -->
+ <property name="org.jboss.soa.esb.registry.orgCategory" value="org.jboss.soa.esb.:category"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ <property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+ <property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+ <property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+ <property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+ <property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+ <!-- expiry of messages to temporary invm destinations (default replies)
+ expire after the following timeout, specified in milliseconds (5 mins) -->
+ <property name="org.jboss.soa.esb.invm.expiryTime" value="300000"/>
+
+ <!-- Uncomment this to return stack traces when exposing an ESB service through WS
+ <property name="org.jboss.soa.esb.ws.returnStackTrace" value="true"/>
+ -->
+ <!-- Uncomment this to specify the WS response timeout when exposing an ESB service through WS
+ <property name="org.jboss.soa.esb.ws.timeout" value="30000"/>
+ -->
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool-size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="jca">
+ <property name="org.jboss.soa.esb.jca.activation.mapper.jms-ra.rar" value="org.jboss.soa.esb.listeners.jca.JBossActivationMapper"/>
+ <property name="org.jboss.soa.esb.jca.activation.mapper.wmq.jmsra.rar" value="org.jboss.soa.esb.listeners.jca.WMQActivationMapper"/>
+ </properties>
+
+ <properties name="dbstore">
+
+ <!-- connection manager type -->
+ <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/> -->
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+
+ <!-- this property is only used if using the j2ee connection manager -->
+ <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossESBDS"/>
+
+ <!-- standalone connection pooling settings -->
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+
+ </properties>
+ <properties name="filters">
+ <property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+ <property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+ </properties>
+
+ <properties name="rules">
+ <!-- change this to true if you wish to have the same behaviour as ESB4.6 and prior (including SOA 4.3) -->
+ <property name="org.jboss.soa.esb.services.rules.continueState" value="false"/>
+ </properties>
+</esb>
Copied: trunk/distribution/src/files/jbossesb/jbossesb-properties-validator.xml (from rev 354, trunk/distribution/src/files/jbossesb/conf/jbossesb-properties-validator.xml)
===================================================================
--- trunk/distribution/src/files/jbossesb/jbossesb-properties-validator.xml (rev 0)
+++ trunk/distribution/src/files/jbossesb/jbossesb-properties-validator.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
+ <property name="org.jboss.soa.esb.mime.text.types" value="text/*;application/xml;application/*-xml"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="security">
+ <property name="org.jboss.soa.esb.services.security.implementationClass" value="org.jboss.internal.soa.esb.services.security.JaasSecurityService"/>
+ <property name="org.jboss.soa.esb.services.security.callbackHandler" value="org.jboss.internal.soa.esb.services.security.UserPassCallbackHandler"/>
+
+ <!-- Algorithm and key size for internal sealing of objects -->
+ <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+ <property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+
+ <!-- Timeout in milliseconds. After which the context is considered invalid -->
+ <property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+ <property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.internal.soa.esb.services.security.JBossASContextPropagator"/>
+
+ <!-- Public keystore configuration used to hold keys for encryption/decryption -->
+ <property name="org.jboss.soa.esb.services.security.publicKeystore" value="/publicKeyStore"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeystorePassword" value="testKeystorePassword"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeyAlias" value="testAlias"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeyPassword" value="testPassword"/>
+ <property name="org.jboss.soa.esb.services.security.publicKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
+
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish"/>
+ <property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure"/>
+ <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user" value="root"/>
+ <property name="org.jboss.soa.esb.registry.password" value="root"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
+ <property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0"/>
+ <property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3"/>
+
+ <!-- specify the interceptors, in order -->
+ <property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor"/>
+ <!-- Example of specifying multiple registry interceptors
+ <property name="org.jboss.soa.esb.registry.interceptors"
+ value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
+ -->
+
+ <!-- The following properties modify the cache interceptor behaviour -->
+ <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
+ <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
+
+ <!-- Organization Category to be used by this deployment. -->
+ <property name="org.jboss.soa.esb.registry.orgCategory" value="org.jboss.soa.esb.:category"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ <property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
+ <property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
+ <property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
+ <property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
+ <property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
+ <!-- expiry of messages to temporary invm destinations (default replies)
+ expire after the following timeout, specified in milliseconds (5 mins) -->
+ <property name="org.jboss.soa.esb.invm.expiryTime" value="300000"/>
+
+ <!-- Uncomment this to return stack traces when exposing an ESB service through WS
+ <property name="org.jboss.soa.esb.ws.returnStackTrace" value="true"/>
+ -->
+ <!-- Uncomment this to specify the WS response timeout when exposing an ESB service through WS
+ <property name="org.jboss.soa.esb.ws.timeout" value="30000"/>
+ -->
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool-size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="jca">
+ <property name="org.jboss.soa.esb.jca.activation.mapper.jms-ra.rar" value="org.jboss.soa.esb.listeners.jca.JBossActivationMapper"/>
+ <property name="org.jboss.soa.esb.jca.activation.mapper.wmq.jmsra.rar" value="org.jboss.soa.esb.listeners.jca.WMQActivationMapper"/>
+ </properties>
+
+ <properties name="dbstore">
+
+ <!-- connection manager type -->
+ <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/> -->
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
+
+ <!-- this property is only used if using the j2ee connection manager -->
+ <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossESBDS"/>
+
+ <!-- standalone connection pooling settings -->
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+
+ </properties>
+ <properties name="filters">
+ <property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
+ <property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
+ <property name="org.jboss.soa.esb.filter.10" value="org.jboss.savara.validator.jbossesb.ValidatorFilter" />
+ </properties>
+
+ <properties name="rules">
+ <!-- change this to true if you wish to have the same behaviour as ESB4.6 and prior (including SOA 4.3) -->
+ <property name="org.jboss.soa.esb.services.rules.continueState" value="false"/>
+ </properties>
+</esb>
Added: trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml
===================================================================
--- trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml (rev 0)
+++ trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-original.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+
+ <client-config>
+ <config-name>Standard Client</config-name>
+ <feature>http://org.jboss.ws/dispatch/validate</feature>
+ <property>
+ <property-name>http://org.jboss.ws/http#chunksize</property-name>
+ <property-value>2048</property-value>
+ </property>
+ </client-config>
+
+ <client-config>
+ <config-name>HTTP 1.0 Client</config-name>
+ <feature>http://org.jboss.ws/dispatch/validate</feature>
+ </client-config>
+
+ <client-config>
+ <config-name>Standard WSAddressing Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+ <client-config>
+ <config-name>Standard SOAP 1.2 WSAddressing Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+ <client-config>
+ <config-name>Standard WSSecurity Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
Added: trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml
===================================================================
--- trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml (rev 0)
+++ trunk/distribution/src/files/jbossws-native/standard-jaxws-client-config-validator.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+
+ <client-config>
+ <config-name>Standard Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
+ <javaee:handler-class>org.jboss.savara.validator.jbosswsnative.JBossWSNativeClientInterceptor</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ <feature>http://org.jboss.ws/dispatch/validate</feature>
+ <property>
+ <property-name>http://org.jboss.ws/http#chunksize</property-name>
+ <property-value>2048</property-value>
+ </property>
+ </client-config>
+
+ <client-config>
+ <config-name>HTTP 1.0 Client</config-name>
+ <feature>http://org.jboss.ws/dispatch/validate</feature>
+ </client-config>
+
+ <client-config>
+ <config-name>Standard WSAddressing Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+ <client-config>
+ <config-name>Standard SOAP 1.2 WSAddressing Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+ <client-config>
+ <config-name>Standard WSSecurity Client</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
Added: trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml
===================================================================
--- trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml (rev 0)
+++ trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-original.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+
+ <endpoint-config>
+ <config-name>Standard Endpoint</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ </endpoint-config>
+
+ <!--
+ Generates message part names 'parameters' in WSDL for document/literal/wapped.
+ See: [JBWS-771] Use part names that are friendly to .NET
+ -->
+ <endpoint-config>
+ <config-name>.NET friendly Endpoint</config-name>
+ <feature>http://org.jboss.ws/binding/wsdl/dotnet</feature>
+ </endpoint-config>
+
+ <endpoint-config>
+ <config-name>Standard WSAddressing Endpoint</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+ <endpoint-config>
+ <config-name>Standard SOAP 1.2 WSAddressing Endpoint</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+ <endpoint-config>
+ <config-name>Standard WSSecurity Endpoint</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSSecurity Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+</jaxws-config>
Added: trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml
===================================================================
--- trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml (rev 0)
+++ trunk/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-validator.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 schema/jaxws-config_2_0.xsd">
+
+ <endpoint-config>
+ <config-name>Standard Endpoint</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
+ <javaee:handler-class>org.jboss.savara.validator.jbosswsnative.JBossWSNativeServerInterceptor</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ </endpoint-config>
+
+ <!--
+ Generates message part names 'parameters' in WSDL for document/literal/wapped.
+ See: [JBWS-771] Use part names that are friendly to .NET
+ -->
+ <endpoint-config>
+ <config-name>.NET friendly Endpoint</config-name>
+ <feature>http://org.jboss.ws/binding/wsdl/dotnet</feature>
+ </endpoint-config>
+
+ <endpoint-config>
+ <config-name>Standard WSAddressing Endpoint</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+ <endpoint-config>
+ <config-name>Standard SOAP 1.2 WSAddressing Endpoint</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP12_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+ <endpoint-config>
+ <config-name>Standard WSSecurity Endpoint</config-name>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSSecurity Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Recording Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.wsf.framework.invocation.RecordingServerHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
+</jaxws-config>
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2010-09-02 14:13:26 UTC (rev 386)
+++ trunk/distribution/src/main/assembly/bin.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -44,10 +44,15 @@
</fileSet>
<fileSet>
- <directory>src/files/jbossesb/conf</directory>
- <outputDirectory>/modules/conf</outputDirectory>
+ <directory>src/files/jbossesb</directory>
+ <outputDirectory>/modules/conf/jbossesb</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>src/files/jbossws-native</directory>
+ <outputDirectory>/modules/conf/jbossws-native</outputDirectory>
+ </fileSet>
+
<!-- copy samples -->
<fileSet>
<directory>../samples</directory>
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2010-09-02 14:13:26 UTC (rev 386)
+++ trunk/distribution/src/main/release/install/build.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -25,7 +25,7 @@
<fail unless="as.configured" message="Cannot determine target deployment, please check deployment.properties"/>
</target>
- <target name="deploy" depends="check.deploy.props,register-validator-jbossesb-filter"
+ <target name="deploy" depends="check.deploy.props,register-jbossesb-interceptor,register-jbossws-native-interceptor"
description="Deploys SAVARA Validator to the server">
<echo message="Deploy SAVARA Validators to JBossAS" />
<copy todir="${deploy.dir}/savara-validator-jboss.sar">
@@ -39,24 +39,44 @@
</copy>
</target>
- <target name="undeploy" depends="unregister-validator-jbossesb-filter" description="Undeploys SAVARA Validator">
+ <target name="undeploy" depends="unregister-jbossesb-interceptor,unregister-jbossws-native-interceptor"
+ description="Undeploys SAVARA Validator">
<echo message="Undeploy the SAVARA Validators from JBossAS" />
<delete dir="${deploy.dir}/savara-validator-jboss.sar" />
<delete dir="${deploy.dir}/savara-validator-jbossesb.esb" />
<delete dir="${deploy.dir}/savara-validator-jbossws-native.sar" />
</target>
-
- <target name="register-validator-jbossesb-filter">
- <echo message="register the validator filter in the jbossesb-properties file" />
+ <target name="register-jbossesb-interceptor">
+ <echo message="register the jbossesb interceptor" />
<delete file="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
- <copy file="${modules}/conf/jbossesb-properties-validator.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
+ <copy file="${modules}/conf/jbossesb/jbossesb-properties-validator.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
</target>
- <target name="unregister-validator-jbossesb-filter">
- <echo message="unregister the validator filter from the jbossesb-properties file" />
+ <target name="unregister-jbossesb-interceptor">
+ <echo message="unregister the jbossesb interceptor" />
<delete file="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
- <copy file="${modules}/conf/jbossesb-properties.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
+ <copy file="${modules}/conf/jbossesb/jbossesb-properties-original.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
</target>
+
+ <target name="register-jbossws-native-interceptor">
+ <echo message="register the jbossws-native interceptor" />
+ <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+ <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ <copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-validator.xml"
+ tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+ <copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-validator.xml"
+ tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ </target>
+
+ <target name="unregister-jbossws-native-interceptor">
+ <echo message="unregister the jbossws-native interceptor" />
+ <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+ <delete file="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ <copy file="${modules}/conf/jbossws-native/standard-jaxws-client-config-original.xml"
+ tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-client-config.xml" />
+ <copy file="${modules}/conf/jbossws-native/standard-jaxws-endpoint-config-original.xml"
+ tofile="${deployers.dir}/jbossws.deployer/standard-jaxws-endpoint-config.xml" />
+ </target>
</project>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-09-02 14:13:26 UTC (rev 386)
+++ trunk/pom.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -46,6 +46,7 @@
<mvel.version>1.3.4-java1.5</mvel.version>
<jaxb.version>2.1</jaxb.version>
<jboss.version>5.1.0.GA</jboss.version>
+ <jbossws.version>3.2.2.GA</jbossws.version>
</properties>
<modules>
Property changes on: trunk/validators/jboss/wsnative
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
.settings
+ .classpath
.project
.settings
target
Modified: trunk/validators/jboss/wsnative/pom.xml
===================================================================
--- trunk/validators/jboss/wsnative/pom.xml 2010-09-02 14:13:26 UTC (rev 386)
+++ trunk/validators/jboss/wsnative/pom.xml 2010-09-02 16:46:14 UTC (rev 387)
@@ -33,6 +33,12 @@
<type>pom</type>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-framework</artifactId>
+ <version>${jbossws.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Added: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.validator.jbosswsnative;
+
+import java.net.URL;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+public class JBossWSNativeClientInterceptor extends GenericSOAPHandler
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(JBossWSNativeClientInterceptor.class);
+
+ public JBossWSNativeClientInterceptor() {
+ System.out.println(">> JBossWSClientListener CREATED");
+ }
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleInbound(MessageContext ctx)
+ {
+System.out.println(">> ====================================================");
+System.out.println(">> JBossWSClientListener.handleInbound: ctx="+ctx);
+System.out.println(">> JBossWSClientListener.handleInbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
+ HttpServletResponse httpServletResponse = (HttpServletResponse)ctx.get(MessageContext.SERVLET_RESPONSE);
+ if (httpServletResponse != null)
+ {
+ try
+ {
+ System.out.println(">> JBossWSClientListener.handleInbound: response="+
+ httpServletResponse);
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to read from the http servlet response! " + e.getMessage());
+ }
+ }
+
+ //skip message processing if not required since it's very time-consuming
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleOutbound(MessageContext ctx)
+ {
+System.out.println(">> ====================================================");
+System.out.println(">> JBossWSClientListener.handleOutbound: ctx="+ctx);
+System.out.println(">> JBossWSClientListener.handleOutbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
+
+ HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+ if (httpServletRequest != null)
+ {
+ try
+ {
+ System.out.println(">> JBossWSClientListener.handleOutbound: destination url="+
+ httpServletRequest.getRequestURL().toString());
+ System.out.println(">> JBossWSClientListener.handleOutbound: destination host="+
+ new URL(httpServletRequest.getRequestURL().toString()).getHost());
+ System.out.println(">> JBossWSClientListener.handleOutbound: source host="+
+ httpServletRequest.getRemoteHost());
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to read from the http servlet request! " + e.getMessage());
+ }
+ }
+
+ //skip message processing if not required since it's very time-consuming
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+
+ return true;
+ }
+
+ public boolean handleFault(MessageContext ctx)
+ {
+ return handleOutbound(ctx);
+ }
+}
Added: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2010-09-02 16:46:14 UTC (rev 387)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.validator.jbosswsnative;
+
+import java.net.URL;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+public class JBossWSNativeServerInterceptor extends GenericSOAPHandler
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(JBossWSNativeServerInterceptor.class);
+
+ public JBossWSNativeServerInterceptor() {
+ System.out.println(">> JBossWSListener CREATED");
+ }
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleInbound(MessageContext ctx)
+ {
+System.out.println(">> ====================================================");
+System.out.println(">> JBossWSListener.handleInbound: ctx="+ctx);
+System.out.println(">> JBossWSListener.handleInbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
+ HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+ if (httpServletRequest != null)
+ {
+ try
+ {
+ System.out.println(">> JBossWSListener.handleInbound: destination url="+
+ httpServletRequest.getRequestURL().toString());
+ System.out.println(">> JBossWSListener.handleInbound: destination host="+
+ new URL(httpServletRequest.getRequestURL().toString()).getHost());
+ System.out.println(">> JBossWSListener.handleInbound: source host="+
+ httpServletRequest.getRemoteHost());
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to read from the http servlet request! " + e.getMessage());
+ }
+ }
+
+ //skip message processing if not required since it's very time-consuming
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleOutbound(MessageContext ctx)
+ {
+System.out.println(">> ====================================================");
+System.out.println(">> JBossWSListener.handleOutbound: ctx="+ctx);
+System.out.println(">> JBossWSListener.handleOutbound: op="+(QName)ctx.get(MessageContext.WSDL_OPERATION));
+
+ //skip message processing if not required since it's very time-consuming
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ System.out.println(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+
+ return true;
+ }
+
+ public boolean handleFault(MessageContext ctx)
+ {
+ return handleOutbound(ctx);
+ }
+}
13 years, 8 months
savara SVN: r386 - trunk/validators/jboss/wsnative.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-02 10:13:26 -0400 (Thu, 02 Sep 2010)
New Revision: 386
Modified:
trunk/validators/jboss/wsnative/
Log:
Ignore Eclipse artifacts.
Property changes on: trunk/validators/jboss/wsnative
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
13 years, 8 months
savara SVN: r385 - in trunk: distribution/src/main/assembly and 16 other directories.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-02 10:08:59 -0400 (Thu, 02 Sep 2010)
New Revision: 385
Added:
trunk/validators/jboss/wsnative/
trunk/validators/jboss/wsnative/pom.xml
trunk/validators/jboss/wsnative/src/
trunk/validators/jboss/wsnative/src/main/
trunk/validators/jboss/wsnative/src/main/configs/
trunk/validators/jboss/wsnative/src/main/configs/META-INF/
trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml
trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml
trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml
trunk/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml
trunk/validators/jboss/wsnative/src/main/java/
trunk/validators/jboss/wsnative/src/main/java/org/
trunk/validators/jboss/wsnative/src/main/java/org/jboss/
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java
trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java
trunk/validators/jboss/wsnative/src/main/resources/
trunk/validators/jboss/wsnative/src/test/
trunk/validators/jboss/wsnative/src/test/java/
trunk/validators/jboss/wsnative/src/test/resources/
Modified:
trunk/distribution/pom.xml
trunk/distribution/src/main/assembly/bin.xml
trunk/distribution/src/main/release/install/build.xml
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/service/ServiceValidatorService.java
trunk/validators/jboss/pom.xml
Log:
Added distribution of common sar, and skeleton of the JBossWS native service validator.
Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml 2010-09-02 08:11:37 UTC (rev 384)
+++ trunk/distribution/pom.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -40,11 +40,25 @@
<dependencies>
<dependency>
<groupId>org.jboss.savara.validators</groupId>
+ <artifactId>savara-validator-jboss</artifactId>
+ <version>${pom.version}</version>
+ <classifier>dist</classifier>
+ <type>zip</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.savara.validators</groupId>
<artifactId>savara-validator-jbossesb</artifactId>
<version>${pom.version}</version>
<classifier>dist</classifier>
<type>zip</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.savara.validators</groupId>
+ <artifactId>savara-validator-jbossws-native</artifactId>
+ <version>${pom.version}</version>
+ <classifier>dist</classifier>
+ <type>zip</type>
+ </dependency>
</dependencies>
<build>
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2010-09-02 08:11:37 UTC (rev 384)
+++ trunk/distribution/src/main/assembly/bin.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -95,7 +95,9 @@
<outputDirectory>modules</outputDirectory>
<unpack>true</unpack>
<includes>
+ <include>org.jboss.savara.validators:savara-validator-jboss:zip:dist</include>
<include>org.jboss.savara.validators:savara-validator-jbossesb:zip:dist</include>
+ <include>org.jboss.savara.validators:savara-validator-jbossws-native:zip:dist</include>
</includes>
</dependencySet>
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2010-09-02 08:11:37 UTC (rev 384)
+++ trunk/distribution/src/main/release/install/build.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -25,27 +25,35 @@
<fail unless="as.configured" message="Cannot determine target deployment, please check deployment.properties"/>
</target>
- <target name="deploy" depends="check.deploy.props,register-validator-filter"
+ <target name="deploy" depends="check.deploy.props,register-validator-jbossesb-filter"
description="Deploys SAVARA Validator to the server">
- <echo message="Deploy SAVARA Validator to JBoss AS/ESB server" />
+ <echo message="Deploy SAVARA Validators to JBossAS" />
+ <copy todir="${deploy.dir}/savara-validator-jboss.sar">
+ <fileset dir="${modules}/savara-validator-jboss.sar"/>
+ </copy>
<copy todir="${deploy.dir}/savara-validator-jbossesb.esb">
<fileset dir="${modules}/savara-validator-jbossesb.esb"/>
</copy>
+ <copy todir="${deploy.dir}/savara-validator-jbossws-native.sar">
+ <fileset dir="${modules}/savara-validator-jbossws-native.sar"/>
+ </copy>
</target>
- <target name="undeploy" depends="unregister-validator-filter" description="Undeploys SAVARA Validator">
- <echo message="Undeploy the SAVARA Validator from JBoss AS/ESB server" />
+ <target name="undeploy" depends="unregister-validator-jbossesb-filter" description="Undeploys SAVARA Validator">
+ <echo message="Undeploy the SAVARA Validators from JBossAS" />
+ <delete dir="${deploy.dir}/savara-validator-jboss.sar" />
<delete dir="${deploy.dir}/savara-validator-jbossesb.esb" />
+ <delete dir="${deploy.dir}/savara-validator-jbossws-native.sar" />
</target>
- <target name="register-validator-filter">
+ <target name="register-validator-jbossesb-filter">
<echo message="register the validator filter in the jbossesb-properties file" />
<delete file="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
<copy file="${modules}/conf/jbossesb-properties-validator.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
</target>
- <target name="unregister-validator-filter">
+ <target name="unregister-validator-jbossesb-filter">
<echo message="unregister the validator filter from the jbossesb-properties file" />
<delete file="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
<copy file="${modules}/conf/jbossesb-properties.xml" tofile="${deployers.dir}/esb.deployer/jbossesb-properties.xml" />
Modified: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/service/ServiceValidatorService.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/service/ServiceValidatorService.java 2010-09-02 08:11:37 UTC (rev 384)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/service/ServiceValidatorService.java 2010-09-02 14:08:59 UTC (rev 385)
@@ -49,7 +49,7 @@
* Service Validation Manager and registering it with JNDI.
*/
protected void startService() throws Exception {
- logger.info("Starting JBoss Savara Service Validator Manager");
+ logger.info("Starting Savara Service Validator Manager");
m_serviceValidatorManager = new ServiceValidatorManager();
@@ -61,7 +61,7 @@
* Service Validation Manager and unregistering it from JNDI.
*/
protected void stopService() throws Exception {
- logger.info("Stopping JBoss Savara Service Validator Manager");
+ logger.info("Stopping Savara Service Validator Manager");
unbind(m_jndiName);
Modified: trunk/validators/jboss/pom.xml
===================================================================
--- trunk/validators/jboss/pom.xml 2010-09-02 08:11:37 UTC (rev 384)
+++ trunk/validators/jboss/pom.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -19,6 +19,7 @@
<modules>
<module>common</module>
<module>esb</module>
+ <module>wsnative</module>
</modules>
</project>
Added: trunk/validators/jboss/wsnative/pom.xml
===================================================================
--- trunk/validators/jboss/wsnative/pom.xml (rev 0)
+++ trunk/validators/jboss/wsnative/pom.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,107 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.savara.validators</groupId>
+ <artifactId>savara-validator-jbossws-native</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Savara::Validators::JBoss::WS-Native</name>
+
+ <parent>
+ <groupId>org.jboss.savara.validators</groupId>
+ <artifactId>jboss</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.savara.validators</groupId>
+ <artifactId>savara-validator-jboss</artifactId>
+ <version>${savara.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <version>${jboss.version}</version>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>dist</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>savara-validator-jbossws-native.sar</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/configs/ws-native-assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.4.GA</version>
+ </docletArtifact>
+ <aggregate>true</aggregate>
+ <attach>false</attach>
+ <additionalparam>
+ -d ${project.build.directory}/javadoc
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+ -link http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ <locale>en_US</locale>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Added: trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml
===================================================================
--- trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean class="org.jboss.savara.validator.jbosswsnative.service.JBossWSNativeServiceValidatorService"
+ name="JBossWSNativeServiceValidator">
+ <!--
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.savara:service=ServiceValidatorManager", exposedInterface=org.jboss.savara.validator.service.ServiceValidatorServiceMBean.class,registerDirectly=true)</annotation>
+ -->
+ <depends>jboss.savara:service=ServiceValidatorManager</depends>
+ </bean>
+
+</deployment>
Added: trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml
===================================================================
--- trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-scanning.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,3 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+ <!-- prevent scanning for annotations -->
+</scanning>
Added: trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml
===================================================================
--- trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/configs/META-INF/jboss-structure.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<structure>
+ <context>
+ <path name=""/>
+ <metaDataPath>
+ <path name="META-INF"/>
+ </metaDataPath>
+ <classpath>
+ <path name=""/>
+ <path name="" suffixes=".jar" />
+ <path name="lib" suffixes=".jar" />
+ </classpath>
+ </context>
+</structure>
Added: trunk/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml
===================================================================
--- trunk/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/configs/ws-native-assembly.xml 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,27 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id>dist</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>src/main/configs</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>ws-native-assembly.xml</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/lib</outputDirectory>
+ <includes>
+ <include>org.jboss.savara.validators:savara-validator-jbossws-native</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
Added: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorService.java 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.validator.jbosswsnative.service;
+
+import java.util.logging.Logger;
+
+import javax.naming.*;
+
+/**
+ * This is the JBossWS Native Savara Service Validator Service managing the Service Validator.
+ *
+ * @author gbrown
+ *
+ */
+public class JBossWSNativeServiceValidatorService extends org.jboss.system.ServiceMBeanSupport implements JBossWSNativeServiceValidatorServiceMBean {
+
+ private final static Logger logger = Logger.getLogger(JBossWSNativeServiceValidatorService.class.getName());
+
+ /**
+ * The default constructor.
+ */
+ public JBossWSNativeServiceValidatorService() {
+ }
+
+ /**
+ * This method starts the service, instantiating the
+ * Service Validation Manager and registering it with JNDI.
+ */
+ protected void startService() throws Exception {
+ logger.info("Starting Savara JBossWS Native Service Validator Adapter");
+ }
+
+ /**
+ * This method stops the service, closing the
+ * Service Validation Manager and unregistering it from JNDI.
+ */
+ protected void stopService() throws Exception {
+ logger.info("Stopping Savara JBossWS Native Service Validator Adapter");
+ }
+
+}
Added: trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java
===================================================================
--- trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java (rev 0)
+++ trunk/validators/jboss/wsnative/src/main/java/org/jboss/savara/validator/jbosswsnative/service/JBossWSNativeServiceValidatorServiceMBean.java 2010-09-02 14:08:59 UTC (rev 385)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.validator.jbosswsnative.service;
+
+import javax.naming.NamingException;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * The MBean for the JBossWS Native Service Validator Service.
+ *
+ * @author gbrown
+ *
+ */
+public interface JBossWSNativeServiceValidatorServiceMBean extends ServiceMBean {
+
+}
13 years, 8 months
savara SVN: r384 - trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-02 04:11:37 -0400 (Thu, 02 Sep 2010)
New Revision: 384
Modified:
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java
Log:
Change tracker namespace to a savara based one.
Modified: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java 2010-09-01 18:46:27 UTC (rev 383)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java 2010-09-02 08:11:37 UTC (rev 384)
@@ -70,6 +70,7 @@
*/
public class JMSServiceTracker implements ServiceTracker {
+ private static final String SAVARA_SERVICE_TRACKER_NS = "http://www.savara.org/service/tracker";
/**
* This is the default constructor for the JMS service
* tracker implementation.
@@ -1103,8 +1104,7 @@
}
ret.append("<sd:record xmlns:sd=\""+
- TrackerEvent.TRACKER_NAMESPACE+
- "\" "+nameText+versionText+">");
+ SAVARA_SERVICE_TRACKER_NS+"\" "+nameText+versionText+">");
ret.append(getSessionIdentityText(session, mesg));
13 years, 8 months
savara SVN: r383 - in trunk/validators/jboss/common/src/main: java/org/jboss/savara/validator/pi4soa and 1 other directory.
by do-not-reply@jboss.org
Author: objectiser
Date: 2010-09-01 14:46:27 -0400 (Wed, 01 Sep 2010)
New Revision: 383
Added:
trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java
Modified:
trunk/validators/jboss/common/src/main/configs/pi4soa.xml
Log:
Added Savara specific service tracker - initially just commenting out started/finished events.
Modified: trunk/validators/jboss/common/src/main/configs/pi4soa.xml
===================================================================
--- trunk/validators/jboss/common/src/main/configs/pi4soa.xml 2010-09-01 16:14:04 UTC (rev 382)
+++ trunk/validators/jboss/common/src/main/configs/pi4soa.xml 2010-09-01 18:46:27 UTC (rev 383)
@@ -21,15 +21,8 @@
-->
<pi4soa>
- <container>
- <serviceTracker class="org.pi4soa.service.tracker.jms.JMSServiceTracker" >
- <jmsConnectionFactory>ConnectionFactory</jmsConnectionFactory>
- <jmsDestination>topic/tracker</jmsDestination>
- <recordMessagePayload>true</recordMessagePayload>
- </serviceTracker>
- </container>
<monitor>
- <serviceTracker class="org.pi4soa.service.tracker.jms.JMSServiceTracker" >
+ <serviceTracker class="org.jboss.savara.validator.pi4soa.JMSServiceTracker" >
<jmsConnectionFactory>ConnectionFactory</jmsConnectionFactory>
<jmsDestination>topic/tracker</jmsDestination>
<recordMessagePayload>true</recordMessagePayload>
Added: trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java
===================================================================
--- trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java (rev 0)
+++ trunk/validators/jboss/common/src/main/java/org/jboss/savara/validator/pi4soa/JMSServiceTracker.java 2010-09-01 18:46:27 UTC (rev 383)
@@ -0,0 +1,1196 @@
+/*
+ * Copyright 2005 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * Sep 12, 2005 : Initial version created by gary
+ */
+
+// Original version copied from pi4soa service tracker, licensed under Apache version 2
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.savara.validator.pi4soa;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.jms.QueueConnectionFactory;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.XMLUtils;
+import org.pi4soa.service.Channel;
+import org.pi4soa.service.Identity;
+import org.pi4soa.service.Message;
+import org.pi4soa.service.ServiceException;
+import org.pi4soa.service.behavior.MessageClassification;
+import org.pi4soa.service.behavior.MessageDefinition;
+import org.pi4soa.service.behavior.Receive;
+import org.pi4soa.service.behavior.Send;
+import org.pi4soa.service.behavior.ServiceDescription;
+import org.pi4soa.service.session.Session;
+import org.pi4soa.service.tracker.PublishingServiceTracker;
+import org.pi4soa.service.tracker.ServiceTracker;
+import org.pi4soa.service.tracker.TrackerEvent;
+
+/**
+ * This class provides an implementation of the publishing service
+ * tracker that sends the monitoring information using the JMS
+ * API.
+ *
+ */
+public class JMSServiceTracker implements ServiceTracker {
+
+ /**
+ * This is the default constructor for the JMS service
+ * tracker implementation.
+ *
+ */
+ public JMSServiceTracker() {
+ }
+
+ /**
+ * This method is invoked to initialize the JMS connection, based
+ * on the established properties.
+ *
+ */
+ public void initialize() {
+
+ logger.info("Initializing Savara JMS Service Tracker");
+
+ javax.naming.Context ctx=null;
+
+ try {
+ if (NamesUtil.isSet(m_jndiInitialContextFactory)) {
+ java.util.Properties jndiProps = new java.util.Properties();
+ jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ m_jndiInitialContextFactory);
+ jndiProps.setProperty(Context.PROVIDER_URL,
+ m_jndiProviderURL);
+
+ if (m_jndiFactoryURLPackages != null) {
+ jndiProps.setProperty(Context.URL_PKG_PREFIXES,
+ m_jndiFactoryURLPackages);
+ }
+
+ ctx = new javax.naming.InitialContext(jndiProps);
+ } else {
+ if (logger.isLoggable(java.util.logging.Level.FINER)) {
+ logger.finer("Creating default initial context");
+ }
+ ctx = new javax.naming.InitialContext();
+ }
+ } catch(Exception e) {
+ logger.severe("Failed to create JNDI initial context: "+e);
+ }
+
+ // Get connection factory and destination topic
+ if (ctx != null) {
+
+ try {
+ try {
+ javax.jms.ConnectionFactory factory =
+ (javax.jms.ConnectionFactory)
+ ctx.lookup(m_jmsConnectionFactory);
+
+ m_connection = factory.createConnection();
+
+ if (logger.isLoggable(Level.FINER)) {
+ logger.finer("Connection: "+m_connection);
+ }
+
+ } catch(java.lang.RuntimeException re) {
+ if (m_jmsConnectionFactoryAlternate != null) {
+ QueueConnectionFactory qcf = (QueueConnectionFactory)
+ ctx.lookup(m_jmsConnectionFactoryAlternate);
+ m_connection = qcf.createQueueConnection();
+
+ if (logger.isLoggable(Level.FINER)) {
+ logger.finer("Alternate Connection: "+m_connection);
+ }
+
+ } else {
+ throw re;
+ }
+ }
+
+ javax.jms.Destination dest =
+ (javax.jms.Destination)ctx.lookup(m_jmsDestination);
+
+ m_session = m_connection.createSession(false,
+ javax.jms.Session.AUTO_ACKNOWLEDGE);
+
+ m_producer = m_session.createProducer(dest);
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(Thread.currentThread()+
+ ": Created JMS ServiceTracker connection");
+ }
+
+ } catch(Exception e) {
+ logger.severe("Failed to create JMS connection: "+e);
+ }
+ }
+ }
+
+ /**
+ * This method sets the JNDI initial context factory class name.
+ *
+ * @param factory The factory class name
+ */
+ public void setJNDIInitialContextFactory(String factory) {
+ m_jndiInitialContextFactory = factory;
+ }
+
+ /**
+ * This method sets the provider URL that is used when publishing
+ * the tracker events.
+ *
+ * @param url The provider url
+ */
+ public void setJNDIProviderURL(String url) {
+ m_jndiProviderURL = url;
+ }
+
+ /**
+ * This method sets the JNDI factory URL packages.
+ *
+ * @param pkgs The packages
+ */
+ public void setJNDIFactoryURLPackages(String pkgs) {
+ m_jndiFactoryURLPackages = pkgs;
+ }
+
+ /**
+ * This method sets the JMS connection factory name, to
+ * be looked up within JNDI.
+ *
+ * @param cf The connection factory
+ */
+ public void setJMSConnectionFactory(String cf) {
+ m_jmsConnectionFactory = cf;
+ }
+
+ /**
+ * This method sets the alternate JMS connection factory name, to
+ * be looked up within JNDI.
+ *
+ * @param cf The connection factory
+ */
+ public void setJMSConnectionFactoryAlternate(String cf) {
+ m_jmsConnectionFactoryAlternate = cf;
+ }
+
+ /**
+ * This method sets the JMS destination name, to
+ * be looked up within JNDI.
+ *
+ * @param dest The destination
+ */
+ public void setJMSDestination(String dest) {
+ m_jmsDestination = dest;
+ }
+
+ /**
+ * This method is used to publish the service tracker message.
+ *
+ * @param serviceName The service name
+ * @param session The session
+ * @param mesg The message
+ */
+ protected synchronized void publish(String serviceName, Session session,
+ String mesg) {
+
+ // Establish JMS connection and topic
+ if (m_initialized == false &&
+ m_jmsConnectionFactory != null &&
+ m_jmsDestination != null) {
+ initialize();
+
+ m_initialized = true;
+ }
+
+ if (m_producer != null) {
+
+ try {
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(mesg);
+ }
+
+ TextMessage tm=m_session.createTextMessage(mesg);
+
+ if (logger.isLoggable(Level.FINEST)) {
+ logger.finest(Thread.currentThread()+
+ ": Sending JMS ServiceTracker record="+tm);
+ }
+
+ m_producer.send(tm);
+ } catch(Exception e) {
+ logger.severe("Failed to publish message: "+e);
+ }
+
+ } else {
+ logger.warning("Could not publish message: "+mesg);
+ }
+ }
+
+ /**
+ * This method closes the service tracker.
+ *
+ * @exception ServiceException Failed to close
+ */
+ public void close() throws ServiceException {
+
+ try {
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(Thread.currentThread()+
+ ": Closing JMS ServiceTracker connection");
+ }
+
+ if (m_session != null) {
+ m_session.close();
+ m_session = null;
+ }
+
+ if (m_connection != null) {
+ m_connection.close();
+ m_connection = null;
+ }
+
+ } catch(Exception e) {
+ logger.severe("Failed to close JMS connection: "+e);
+
+ m_initialized = false;
+
+ throw new ServiceException("Failed to close JMS connection", e);
+ }
+
+ m_initialized = false;
+ }
+
+ /**
+ * This method sets whether the message payload should be
+ * recorded as part of the service tracker send and receive
+ * events.
+ *
+ * @param val Whether to record the message payload
+ */
+ public void setRecordMessagePayload(Boolean val) {
+ if (val != null) {
+ m_recordMessagePayload = val.booleanValue();
+ } else {
+ m_recordMessagePayload = false;
+ }
+ }
+
+ /**
+ * This method indicates that a new service instance
+ * has started.
+ *
+ * @param service The service
+ * @param session The session
+ */
+ public void serviceStarted(ServiceDescription service,
+ Session session) {
+ String version="";
+
+ if (service.getVersion() != null) {
+ version = VERSION_ATTR+"=\""+
+ service.getVersion()+"\" ";
+ }
+
+ String xml="<sd:"+TrackerEvent.SERVICE_STARTED+" "+
+ NAME_ATTR+"=\""+service.getFullyQualifiedName()+
+ "\" "+version+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" />";
+
+ //record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method indicates that a service instance
+ * has finished.
+ *
+ * @param service The service
+ * @param session The session
+ */
+ public void serviceFinished(ServiceDescription service,
+ Session session) {
+ String version="";
+
+ if (service.getVersion() != null) {
+ version = VERSION_ATTR+"=\""+
+ service.getVersion()+"\" ";
+ }
+
+ String xml="<sd:"+TrackerEvent.SERVICE_FINISHED+
+ " "+NAME_ATTR+"=\""+service.getFullyQualifiedName()+
+ "\" "+version+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" />";
+
+ //record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method indicates that a new sub session
+ * has started within an existing service instance.
+ *
+ * @param parent The parent session
+ * @param session The session
+ */
+ public void subSessionStarted(Session parent, Session session) {
+ String xml="<sd:"+TrackerEvent.SUB_SESSION_STARTED+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ PARENT_SESSION_ID_ATTR+"=\""+getSessionId(parent)+
+ "\" "+SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" />";
+
+ //record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method indicates that an existing
+ * sub session has finished.
+ *
+ * @param parent The parent session
+ * @param session The session
+ */
+ public void subSessionFinished(Session parent, Session session) {
+ String xml="<sd:"+TrackerEvent.SUB_SESSION_FINISHED+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ PARENT_SESSION_ID_ATTR+"=\""+getSessionId(parent)+
+ "\" "+SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" />";
+
+ //record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method registers the fact that a message has been
+ * sent from a stateful service.
+ *
+ * @param activity The behavioral activity
+ * @param session The session
+ * @param channel The channel
+ * @param mesg The message that has been handled
+ */
+ public void sentMessage(Send activity, Session session,
+ Channel channel, Message mesg) {
+ String channelText=getChannelText(channel);
+ String messageText=getMessageText(mesg,
+ activity.getMessageDefinition());
+
+ String xml="<sd:"+TrackerEvent.SENT_MESSAGE+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" >"+messageText+
+ channelText+"</sd:"+TrackerEvent.SENT_MESSAGE+">";
+
+ record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method registers the fact that a message has been
+ * sent from a stateless service.
+ *
+ * @param defn The message definition
+ * @param mesg The message that has been handled
+ */
+ public void sentMessage(MessageDefinition defn, Message mesg) {
+ String messageText=getMessageText(mesg, defn);
+ String serviceName=getServiceName(defn);
+
+ String xml="<sd:"+TrackerEvent.SENT_MESSAGE+" "+
+ //SESSION_ID_ATTR+"=\""+serviceName+"\" "+
+ TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" >"+messageText+
+ "</sd:"+TrackerEvent.SENT_MESSAGE+">";
+
+ record(serviceName, null, xml, INFO, null);
+ }
+
+ /**
+ * This method registers the fact that a message has been
+ * received from a stateful service.
+ *
+ * @param activity The behavioral activity
+ * @param session The session
+ * @param channel The channel
+ * @param mesg The message that has been handled
+ */
+ public void receivedMessage(Receive activity, Session session,
+ Channel channel, Message mesg) {
+ String channelText=getChannelText(channel);
+ String messageText=getMessageText(mesg,
+ activity.getMessageDefinition());
+
+ String xml="<sd:"+TrackerEvent.RECEIVED_MESSAGE+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" >"+messageText+
+ channelText+"</sd:"+TrackerEvent.RECEIVED_MESSAGE+">";
+
+ record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method registers the fact that a message has been
+ * received from a stateless service.
+ *
+ * @param defn The message definition
+ * @param mesg The message that has been handled
+ */
+ public void receivedMessage(MessageDefinition defn, Message mesg) {
+ String messageText=getMessageText(mesg, defn);
+ String serviceName=getServiceName(defn);
+
+ String xml="<sd:"+TrackerEvent.RECEIVED_MESSAGE+" "+
+ //SESSION_ID_ATTR+"=\""+serviceName+"\" "+
+ TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" >"+messageText+
+ "</sd:"+TrackerEvent.RECEIVED_MESSAGE+">";
+
+ record(serviceName, null, xml, INFO, null);
+ }
+
+ /**
+ * This method registers that a message was not expected.
+ *
+ * @param sdesc The service description, if known
+ * @param session The session, or null if a stateless service,
+ * or cannot be associated with a session
+ * @param mesg The message that was not expected
+ * @param reason The optional reason why the message was
+ * considered to be unexpected
+ */
+ public void unexpectedMessage(ServiceDescription sdesc,
+ Session session, Message mesg, String reason) {
+ String messageText=getMessageText(mesg, null);
+
+ // Process the reason field to ensure it has no
+ // character that would cause the XML a problem
+ reason = processAttributeContents(reason);
+
+ String xml="<sd:"+TrackerEvent.UNEXPECTED_MESSAGE+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+ reason+"</sd:"+DETAILS_NODE+">"+messageText+
+ "</sd:"+TrackerEvent.UNEXPECTED_MESSAGE+">";
+
+ String serviceName=null;
+
+ if (sdesc != null) {
+ serviceName = sdesc.getFullyQualifiedName();
+ } else {
+ serviceName = getServiceName(session);
+ }
+
+ String serviceVersion=null;
+
+ if (sdesc != null) {
+ serviceVersion = sdesc.getVersion();
+ }
+
+ record(serviceName, serviceVersion, session, mesg, xml, ERROR, null);
+ }
+
+ /**
+ * This method registers that an exception was not handled.
+ *
+ * @param session The session, or null if a stateless service
+ * @param excType The exception type
+ */
+ public void unhandledException(Session session, String excType) {
+
+ String xml="<sd:"+TrackerEvent.UNHANDLED_EXCEPTION+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+
+ getSessionId(session)+"\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+ excType+"</sd:"+DETAILS_NODE+"></sd:"+
+ TrackerEvent.UNHANDLED_EXCEPTION+">";
+
+ record(getServiceName(session), session, xml, ERROR, null);
+ }
+
+ /**
+ * This method reports information regarding the processing
+ * of a service session. The details can either be specified
+ * as a textual string (unstructured data),
+ * or as a structured XML fragment.<p>
+ *
+ * @param session The session, or null if a stateless service
+ * @param details The details
+ */
+ public void information(Session session, String details) {
+ String xml="<sd:"+TrackerEvent.INFORMATION+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+getSessionId(session)+
+ "\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+ XMLUtils.encodeXMLString(details)+
+ "</sd:"+DETAILS_NODE+"></sd:"+
+ TrackerEvent.INFORMATION+">";
+
+ record(getServiceName(session), session, xml, INFO, null);
+ }
+
+ /**
+ * This method reports information regarding the processing
+ * of a service session. The details can either be specified
+ * as a textual string (unstructured data),
+ * or as a structured XML fragment.<p>
+ *
+ * @param session The session, or null if a stateless service
+ * @param details The details
+ * @param exc The optional exception
+ */
+ public void warning(Session session, String details,
+ Throwable exc) {
+ String excText="";
+ if (exc != null) {
+ try {
+ java.io.StringWriter s=new java.io.StringWriter();
+ java.io.PrintWriter p=new java.io.PrintWriter(s);
+
+ exc.printStackTrace(p);
+
+ p.close();
+ s.close();
+
+ excText = "<sd:"+EXCEPTION_NODE+">"+s.toString()+"</sd:"+EXCEPTION_NODE+">";
+ } catch(Exception e) {
+ logger.severe("Failed to record exception stack trace: "+e);
+
+ excText = "<sd:"+EXCEPTION_NODE+">"+exc.getLocalizedMessage()+"</sd:"+EXCEPTION_NODE+">";
+ }
+ }
+
+ String xml="<sd:"+TrackerEvent.WARNING+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+getSessionId(session)+
+ "\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+ XMLUtils.encodeXMLString(details)+
+ "</sd:"+DETAILS_NODE+">"+excText+"</sd:"+
+ TrackerEvent.WARNING+">";
+
+ record(getServiceName(session), session, xml, WARNING, exc);
+ }
+
+ /**
+ * This method reports information regarding the processing
+ * of a service session. The details can either be specified
+ * as a textual string (unstructured data),
+ * or as a structured XML fragment.<p>
+ *
+ * @param session The session, or null if a stateless service
+ * @param details The details
+ * @param exc The optional exception
+ */
+ public void error(Session session, String details,
+ Throwable exc) {
+ String excText="";
+ if (exc != null) {
+ try {
+ java.io.StringWriter s=new java.io.StringWriter();
+ java.io.PrintWriter p=new java.io.PrintWriter(s);
+
+ exc.printStackTrace(p);
+
+ p.close();
+ s.close();
+
+ excText = "<sd:"+EXCEPTION_NODE+">"+s.toString()+"</sd:"+EXCEPTION_NODE+">";
+ } catch(Exception e) {
+ logger.severe("Failed to record exception stack trace: "+e);
+
+ excText = "<sd:"+EXCEPTION_NODE+">"+exc.getLocalizedMessage()+"</sd:"+EXCEPTION_NODE+">";
+ }
+ }
+
+
+ String xml="<sd:"+TrackerEvent.ERROR+
+ " "+SERVICE_INSTANCE_ID_ATTR+"=\""+
+ getServiceInstanceId(session)+"\" "+
+ SESSION_ID_ATTR+"=\""+getSessionId(session)+
+ "\" "+TIMESTAMP_ATTR+"=\""+
+ System.currentTimeMillis()+"\" ><sd:"+DETAILS_NODE+">"+
+ XMLUtils.encodeXMLString(details)+
+ "</sd:"+DETAILS_NODE+">"+excText+"</sd:"+
+ TrackerEvent.ERROR+">";
+
+ record(getServiceName(session), session, xml, ERROR, exc);
+ }
+
+ /**
+ * Check the format of the specified session id.
+ *
+ * @param session The initial session
+ * @return The reformatted session id
+ */
+ protected String getSessionId(Session session) {
+ String ret=null;
+
+ if (session != null) {
+ ret = session.getId().getSessionId();
+ }
+
+ if (ret == null) {
+ ret = "";
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether a long expanded form
+ * of id should be used for the service instance id.
+ *
+ * @return Whether the expanded form of id is used
+ */
+ protected boolean isIdExpanded() {
+ return(true);
+ }
+
+ /**
+ * This method returns the service instance id
+ * associated with the specified session.
+ *
+ * @param session The session
+ * @return The service instance id
+ */
+ protected String getServiceInstanceId(Session session) {
+ String ret=null;
+
+ if (session != null) {
+ if (isIdExpanded()) {
+ ret = session.getId().getServiceDescriptionName()+
+ "/"+session.getId().getServiceInstanceId();
+ } else {
+ ret = session.getId().getServiceInstanceId();
+ }
+ }
+
+ if (ret == null) {
+ ret = "";
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the service name associated with the
+ * supplied session.
+ *
+ * @param session The session
+ * @return The service name
+ */
+ protected String getServiceName(Session session) {
+ String ret="";
+
+ if (session != null && session.getId() != null) {
+ ret = session.getId().getServiceDescriptionName();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the service name associated with the
+ * supplied message definition.
+ *
+ * @param defn The message definition
+ * @return The service name
+ */
+ protected String getServiceName(MessageDefinition defn) {
+ String ret="";
+
+ if (defn != null && defn.getServiceDescription() != null) {
+ ret = defn.getServiceDescription().getFullyQualifiedName();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method constructs the session related information
+ * to be recorded.
+ *
+ * @param session The session
+ * @return The session text
+ */
+ protected String getSessionIdentityText(Session session) {
+ return(getSessionIdentityText(session, null));
+ }
+
+ /**
+ * This method constructs the session related information
+ * to be recorded.
+ *
+ * @param session The session
+ * @param mesg The optional message
+ * @return The session text
+ */
+ public String getSessionIdentityText(Session session, Message mesg) {
+ StringBuffer identities=new StringBuffer();
+
+ if (session != null && session.getSessionIdentity() != null) {
+ identities.append("<sd:"+SESSION_IDENTITY_NODE+">"+
+ "<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+ session.getSessionIdentity().getName()+"\" >"+
+ XMLUtils.encodeXMLString(session.getSessionIdentity().getFullId())+
+ "</sd:"+IDENTITY_NODE+">"+
+ "</sd:"+SESSION_IDENTITY_NODE+">");
+ }
+
+ java.util.Iterator<Identity> ids=null;
+
+ if (session != null) {
+ ids = session.getPrimaryIdentities().iterator();
+ }
+
+ // If session has no identity information, but a
+ // message is supplied, then try getting identity
+ // from it.
+ if ((ids == null || ids.hasNext() == false) &&
+ mesg != null && mesg.getMessageIdentities() != null) {
+ ids = mesg.getMessageIdentities().iterator();
+ }
+
+ if (ids != null && ids.hasNext()) {
+ identities.append("<sd:"+PRIMARY_IDENTITIES_NODE+">");
+
+ while (ids.hasNext()) {
+ Identity cur=ids.next();
+
+ identities.append("<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+ cur.getName()+"\" >");
+ identities.append(XMLUtils.encodeXMLString(cur.getFullId()));
+ identities.append("</sd:"+IDENTITY_NODE+">");
+ }
+
+ identities.append("</sd:"+PRIMARY_IDENTITIES_NODE+">");
+ }
+
+ return(identities.toString());
+ }
+
+ /**
+ * This method returns the XML text associated with the
+ * message.
+ *
+ * @param mesg The message
+ * @param defn The message definition from the description
+ * @return The message text
+ */
+ public String getMessageText(Message mesg, MessageDefinition defn) {
+ String type=null;
+
+ if (defn == null) {
+ type = (mesg.isRequest()?REQUEST_RPC_MESSAGE_TYPE:RESPONSE_RPC_MESSAGE_TYPE);
+
+ if (mesg.isRPCStyle() == false) {
+ type = MESSAGE_STYLE_MESSAGE_TYPE;
+ }
+ } else {
+ type = (defn.getClassification()==MessageClassification.REQUEST?
+ REQUEST_RPC_MESSAGE_TYPE:RESPONSE_RPC_MESSAGE_TYPE);
+ }
+
+ if (NamesUtil.isSet(mesg.getFaultName())) {
+ type = FAULT_RPC_MESSAGE_TYPE;
+ }
+
+ return(getMessageTextForType(mesg, type));
+ }
+
+ /**
+ * This method returns the XML text associated with the
+ * message.
+ *
+ * @param mesg The message
+ * @param type The message classification (request/response/message/fault)
+ * @return The message text
+ */
+ protected String getMessageTextForType(Message mesg, String type) {
+ String ret=null;
+ String fault="";
+ String messageType="";
+ String identities="";
+ String valueText=getMessagePayload(mesg);
+ String endpoint="";
+
+ if (NamesUtil.isSet(mesg.getFaultName())) {
+ fault = FAULT_ATTR+"=\""+mesg.getFaultName()+"\" ";
+ }
+
+ if (NamesUtil.isSet(mesg.getType())) {
+ messageType = MESSAGE_TYPE_ATTR+"=\""+mesg.getType()+"\" ";
+ }
+
+ if (mesg.getSessionIdentity() != null) {
+ identities = "<sd:"+SESSION_IDENTITY_NODE+">"+
+ "<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+ mesg.getSessionIdentity().getName()+"\" >"+
+ mesg.getSessionIdentity().getFullId()+
+ "</sd:"+IDENTITY_NODE+">"+
+ "</sd:"+SESSION_IDENTITY_NODE+">";
+
+ if (mesg.getChannelIdentity() != null) {
+ identities += "<sd:"+CHANNEL_IDENTITY_NODE+">"+
+ "<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+ mesg.getChannelIdentity().getName()+"\" >"+
+ mesg.getChannelIdentity().getFullId()+
+ "</sd:"+IDENTITY_NODE+">"+
+ "</sd:"+CHANNEL_IDENTITY_NODE+">";
+ }
+ } else if (mesg.getMessageIdentities() != null &&
+ mesg.getMessageIdentities().size() > 0) {
+
+ identities += "<sd:"+PRIMARY_IDENTITIES_NODE+">";
+
+ for (int i=0; i < mesg.getMessageIdentities().size(); i++) {
+ Identity id=(Identity)mesg.getMessageIdentities().get(i);
+
+ identities += "<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+ id.getName()+"\" >";
+ identities += id.getFullId();
+ identities += "</sd:"+IDENTITY_NODE+">";
+ }
+
+ identities += "</sd:"+PRIMARY_IDENTITIES_NODE+">";
+ }
+
+ if (mesg.getServiceEndpoint() != null) {
+ endpoint = mesg.getServiceEndpoint().toText(null);
+ }
+
+ String serviceType=mesg.getServiceType();
+ if (serviceType == null) {
+ serviceType = "";
+ }
+
+ ret = "<sd:"+MESSAGE_NODE+" "+OPERATION_ATTR+"=\""+
+ (mesg.getOperationName()==null?"":mesg.getOperationName())+
+ "\" "+TYPE_ATTR+"=\""+type+"\" "+fault+
+ messageType+SERVICE_TYPE_ATTR+"=\""+
+ serviceType+"\" ><sd:"+ENDPOINT_NODE+">"+
+ endpoint+"</sd:"+ENDPOINT_NODE+">"+identities+
+ valueText+"</sd:"+MESSAGE_NODE+">";
+
+ return(ret);
+ }
+
+ /**
+ * This method constructs the message payload value for the
+ * send and receive tracker events. The information is only
+ * provided if the service tracker is configured to supply
+ * it, as the performance impact of transporting large
+ * message payloads in tracker messages would not be appropriate
+ * for production environments - however it may be useful
+ * in development and test environments. If the supplied
+ * message is a multi-part message containing a single part
+ * then the single part will be extracted and used. If a
+ * multi-part message with multiple parts, then the map
+ * textual representation will be provided. If the value is
+ * a DOM representation, then it will be converted to a
+ * string. All other situations will rely on the 'toString'
+ * representation of the value to be appropriate.
+ *
+ * @param mesg The message
+ * @return The payload
+ */
+ protected String getMessagePayload(Message mesg) {
+ String ret="";
+
+ if (m_recordMessagePayload) {
+ Object value=mesg.getValue();
+ if (mesg.isMultiPart() && ((java.util.Map)value).size() == 1) {
+ value = ((java.util.Map)value).values().iterator().next();
+ }
+
+ if (value instanceof org.w3c.dom.Node) {
+ try {
+ value = XMLUtils.getText((org.w3c.dom.Node)value);
+ } catch(Exception e) {
+ logger.severe("Failed to convert message DOM value" +
+ "to string: "+e);
+ value = "";
+ }
+ }
+
+ if (value != null) {
+ ret = "<sd:"+VALUE_NODE+">"+value.toString()+
+ "</sd:"+VALUE_NODE+">";
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the XML text associated with the
+ * channel.
+ *
+ * @param channel The channel
+ * @return The channel text
+ */
+ protected String getChannelText(Channel channel) {
+
+ if (channel == null) {
+ return("");
+ }
+
+ StringBuffer identities=new StringBuffer();
+
+ java.util.Set<Identity> ids=channel.getPrimaryIdentities();
+
+ if (ids != null && ids.size() > 0) {
+ identities.append("<sd:"+PRIMARY_IDENTITIES_NODE+">");
+
+ java.util.Iterator<Identity> iter=ids.iterator();
+ while (iter.hasNext()) {
+ Identity id=iter.next();
+
+ identities.append("<sd:"+IDENTITY_NODE+" "+NAME_ATTR+"=\""+
+ id.getName()+"\" >");
+ identities.append(XMLUtils.encodeXMLString(id.getFullId()));
+ identities.append("</sd:"+IDENTITY_NODE+">");
+ }
+
+ identities.append("</sd:"+PRIMARY_IDENTITIES_NODE+">");
+ }
+
+ return("<sd:"+CHANNEL_NODE+" "+NAME_ATTR+"=\""+
+ channel.getName()+"\" "+TYPE_ATTR+"=\""+
+ channel.getType()+"\" >"+
+ identities.toString()+"</sd:"+CHANNEL_NODE+">");
+ }
+
+ /**
+ * This method processes the supplied value to deal with any
+ * unwanted characters that would be inappropriate for an
+ * XML attribute value.
+ *
+ * @param value The value
+ * @return The processed value
+ */
+ protected String processAttributeContents(String value) {
+ String ret=value;
+
+ ret = ret.replaceAll("\"", "");
+
+ return(ret);
+ }
+
+ /**
+ * This method records the tracker information. This method
+ * also takes the optional 'message', used to derive session
+ * identity, if the session does not currently have any
+ * identity. This situation should only occur if the first
+ * message to a service is an unexpected message.
+ *
+ * @param serviceName The service name
+ * @param serviceVersion The optional service version
+ * @param session The session
+ * @param mesg The message
+ * @param xml The information to be recorded
+ * @param type The type of information (INFO, WARNING, ERROR)
+ * @param exc The optional exception
+ */
+ protected void record(String serviceName, String serviceVersion,
+ Session session, Message mesg, String xml, String type, Throwable exc) {
+
+ String message=build(serviceName, serviceVersion,
+ session, mesg, xml);
+
+ publish(serviceName, session, message);
+ }
+
+ /**
+ * This method records the tracker information.
+ *
+ * @param serviceName The service name
+ * @param session The session
+ * @param xml The information to be recorded
+ * @param type The type of information (INFO, WARNING, ERROR)
+ * @param exc The optional exception
+ */
+ protected void record(String serviceName, Session session,
+ String xml, String type, Throwable exc) {
+ record(serviceName, null, session, null, xml, type, exc);
+ }
+
+ /**
+ * This method constructs the service tracker message to be
+ * published.
+ *
+ * @param serviceName The service name
+ * @param serviceVersion The optional service version
+ * @param session The session
+ * @param mesg The optional message
+ * @param xml The XML for the current tracker event
+ * @return The message
+ */
+ protected String build(String serviceName, String serviceVersion,
+ Session session, Message mesg, String xml) {
+ StringBuffer ret=new StringBuffer();
+ String versionText="";
+ String nameText="";
+
+ if (serviceName != null) {
+ nameText = NAME_ATTR+"=\""+serviceName+"\" ";
+ }
+
+ if (serviceVersion != null) {
+ versionText=VERSION_ATTR+"=\""+serviceVersion+"\" ";
+
+ } else if (session != null && session.getId() != null &&
+ session.getId().getServiceDescriptionVersion() != null) {
+ versionText=VERSION_ATTR+"=\""+
+ session.getId().getServiceDescriptionVersion()+
+ "\" ";
+ }
+
+ ret.append("<sd:record xmlns:sd=\""+
+ TrackerEvent.TRACKER_NAMESPACE+
+ "\" "+nameText+versionText+">");
+
+ ret.append(getSessionIdentityText(session, mesg));
+
+ ret.append("<sd:events>");
+
+ ret.append(xml);
+
+ ret.append("</sd:events>");
+ ret.append("</sd:record>");
+
+ return(ret.toString());
+ }
+
+ /**
+ * This method determines whether message payload will be
+ * recorded.
+ *
+ * @param bool Whether the message payload is recorded
+ */
+ public void setRecordMessagePayload(String bool) {
+ logger.info("Record message payload: "+bool);
+
+ if (bool != null && bool.equalsIgnoreCase("true")) {
+ m_recordMessagePayload = true;
+ } else {
+ m_recordMessagePayload = false;
+ }
+ }
+
+ private static Logger logger = Logger.getLogger(JMSServiceTracker.class.getName());
+
+ private boolean m_recordMessagePayload=false;
+
+ public static final String RECORD_MESSAGE_PAYLOAD = "pi4soa.tracker.messagePayload";
+
+ public static final String INFO="info";
+ public static final String WARNING="warning";
+ public static final String ERROR="error";
+
+ public static final String MESSAGE_NODE="message";
+ public static final String DETAILS_NODE="details";
+ public static final String OPERATION_ATTR="operation";
+ public static final String FAULT_ATTR="fault";
+ public static final String NAME_ATTR="name";
+ public static final String TIMESTAMP_ATTR="timestamp";
+ public static final String TYPE_ATTR="type";
+ public static final String MESSAGE_TYPE_ATTR="messageType";
+ public static final String SERVICE_TYPE_ATTR="serviceType";
+ public static final String EXCEPTION_NODE="exception";
+ public static final String SERVICE_INSTANCE_ID_ATTR="serviceInstanceId";
+ public static final String SESSION_ID_ATTR="sessionId";
+ public static final String PARENT_SESSION_ID_ATTR="parentSessionId";
+
+ public static final String VERSION_ATTR = "version";
+ public static final String FAULT_RPC_MESSAGE_TYPE = "fault";
+ public static final String RESPONSE_RPC_MESSAGE_TYPE = "response";
+ public static final String REQUEST_RPC_MESSAGE_TYPE = "request";
+ public static final String MESSAGE_STYLE_MESSAGE_TYPE = "message";
+ public static final String SESSION_IDENTITY_NODE = "sessionIdentity";
+ public static final String CHANNEL_IDENTITY_NODE = "channelIdentity";
+ public static final String IDENTITY_NODE = "identity";
+ public static final String PRIMARY_IDENTITIES_NODE = "primaryIdentities";
+ public static final String ENDPOINT_NODE = "endpoint";
+ public static final String CHANNEL_NODE = "channel";
+ public static final String VALUE_NODE = "value";
+
+ protected static final String TRACKER_JNDI_INITIAL_CONTEXT_FACTORY_PROPERTY = "pi4soa.tracker.jndi.initialContextFactory";
+ protected static final String TRACKER_JNDI_PROVIDER_URL_PROPERTY = "pi4soa.tracker.jndi.providerURL";
+ protected static final String TRACKER_JNDI_FACTORY_URL_PACKAGES_PROPERTY = "pi4soa.tracker.jndi.factoryURLPackages";
+ protected static final String TRACKER_JMS_TOPIC_CONNECTION_FACTORY_PROPERTY = "pi4soa.tracker.jms.topicConnectionFactory";
+ protected static final String TRACKER_JMS_TOPIC_PROPERTY = "pi4soa.tracker.jms.topic";
+ protected static final String TRACKER_JMS_CONNECTION_FACTORY_PROPERTY = "pi4soa.tracker.jms.connectionFactory";
+ protected static final String TRACKER_JMS_CONNECTION_FACTORY_ALTERNATE_PROPERTY = "pi4soa.tracker.jms.connectionFactoryAlternate";
+ protected static final String TRACKER_JMS_DESTINATION_PROPERTY = "pi4soa.tracker.jms.destination";
+ protected static final String TRACKER_JMS_CLIENT_ID_PROPERTY = "pi4soa.tracker.jms.clientId";
+ protected static final String TRACKER_JMS_DURABLE_SUBSCRIPTION_PROPERTY = "pi4soa.tracker.jms.durableSubscription";
+
+ private boolean m_initialized=false;
+ private String m_jndiInitialContextFactory=null;
+ private String m_jndiProviderURL=null;
+ private String m_jndiFactoryURLPackages=null;
+ private String m_jmsConnectionFactory=null;
+ private String m_jmsConnectionFactoryAlternate=null;
+ private String m_jmsDestination=null;
+
+ private javax.jms.Connection m_connection=null;
+ private javax.jms.Session m_session=null;
+ private javax.jms.MessageProducer m_producer=null;
+}
13 years, 8 months