Author: richard.opalka(a)jboss.com
Date: 2008-04-10 06:01:20 -0400 (Thu, 10 Apr 2008)
New Revision: 6321
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
Log:
[JBWS-2097] refactoring - use addressing api only
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java 2008-04-10
09:37:46 UTC (rev 6320)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java 2008-04-10
10:01:20 UTC (rev 6321)
@@ -22,10 +22,14 @@
package org.jboss.test.ws.jaxws.wsrm;
import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URISyntaxException;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
import javax.xml.ws.addressing.AddressingProperties;
import javax.xml.ws.addressing.JAXWSAConstants;
-import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+import org.jboss.wsf.common.utils.UUIDGenerator;
/**
* WS-RM Tests helper
@@ -35,6 +39,15 @@
public final class Helper
{
+ private static AddressingBuilder BUILDER;
+ private static AddressingConstants CONSTANTS;
+
+ static
+ {
+ BUILDER = AddressingBuilder.getAddressingBuilder();
+ CONSTANTS = BUILDER.newAddressingConstants();
+ }
+
private Helper()
{
// no instances
@@ -49,10 +62,28 @@
public static void setAddrProps(Object proxy, String wsaAction, String serviceURL)
{
BindingProvider bp = (BindingProvider)proxy;
- AddressingProperties props = AddressingClientUtil.createAnonymousProps(wsaAction,
serviceURL);
+ AddressingProperties props = createAnonymousProps(wsaAction, serviceURL);
+
bp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
props);
}
+ public static AddressingProperties createAnonymousProps(String wsaAction, String
wsaTo)
+ {
+ try
+ {
+ AddressingProperties addrProps = BUILDER.newAddressingProperties();
+ addrProps.setMessageID(BUILDER.newURI(new URI("urn:uuid:" +
UUIDGenerator.generateRandomUUIDString())));
+ addrProps.setAction(BUILDER.newURI(wsaAction));
+ addrProps.setTo(BUILDER.newURI(wsaTo));
+ addrProps.setReplyTo(BUILDER.newEndpointReference(new
URI(CONSTANTS.getAnonymousURI())));
+ return addrProps;
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
/**
* Invokes method using java reflection api
* @throws Exception if some reflection related problem occurs
Show replies by date