Author: objectiser
Date: 2011-03-30 10:19:38 -0400 (Wed, 30 Mar 2011)
New Revision: 1342
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
Log:
RIFTSAW-325 - support dynamic assignment of EPR to partnerlink.
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2011-03-30
13:53:09 UTC (rev 1341)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2011-03-30
14:19:38 UTC (rev 1342)
@@ -247,8 +247,32 @@
log.debug("Riftsaw soap request message: \n" +
JavaUtils.getSoapMessageASString(soapRequestMessage));
}
+ org.apache.ode.bpel.iapi.EndpointReference
odeepr=mex.getEndpointReference();
+ javax.xml.ws.EndpointReference epr=null;
+
+ if (odeepr != null) {
+ if (odeepr instanceof org.apache.ode.bpel.epr.URLEndpoint) {
+ org.apache.ode.bpel.epr.URLEndpoint
url=(org.apache.ode.bpel.epr.URLEndpoint)odeepr;
+
+ javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder builder=
+ new javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder();
+
+ epr = builder.address(url.getUrl())
+ .serviceName(serviceName)
+ .endpointName(port)
+ .build();
+
+ if (log.isDebugEnabled()) {
+ log.debug("EPR = " + epr);
+ }
+ }
+
+ } else if (log.isDebugEnabled()) {
+ log.debug("ODE has no EPR for this message exchange");
+ }
+
// The actual WS invocation
- Dispatch<SOAPMessage> proxy = getDispatcher(port);
+ Dispatch<SOAPMessage> proxy = getDispatcher(epr, port);
try {
// Set SOAPAction
@@ -349,8 +373,32 @@
log.debug("Riftsaw soap request message: \n" +
JavaUtils.getSoapMessageASString(soapRequestMessage));
}
+ org.apache.ode.bpel.iapi.EndpointReference
odeepr=mex.getEndpointReference();
+ javax.xml.ws.EndpointReference epr=null;
+
+ if (odeepr != null) {
+ if (odeepr instanceof org.apache.ode.bpel.epr.URLEndpoint) {
+ org.apache.ode.bpel.epr.URLEndpoint
url=(org.apache.ode.bpel.epr.URLEndpoint)odeepr;
+
+ javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder builder=
+ new javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder();
+
+ epr = builder.address(url.getUrl())
+ .serviceName(serviceName)
+ .endpointName(port)
+ .build();
+
+ if (log.isDebugEnabled()) {
+ log.debug("EPR = " + epr);
+ }
+ }
+
+ } else if (log.isDebugEnabled()) {
+ log.debug("ODE has no EPR for this message exchange");
+ }
+
// The actual WS invocation
- Dispatch proxy = getDispatcher(port);
+ Dispatch proxy = getDispatcher(epr, port);
proxy.invokeOneWay(soapRequestMessage);
}
@@ -407,7 +455,7 @@
throw new RuntimeException("Not implemented. Should be removed form
interface");
}
- private synchronized Dispatch<SOAPMessage> getDispatcher(QName portName)
+ private synchronized Dispatch<SOAPMessage>
getDispatcher(javax.xml.ws.EndpointReference epr, QName portName)
{
if(null==dispatcher) {
@@ -416,12 +464,22 @@
JAXWSInitializer initializer=initializeStack(portName);
Service service = Service.create(this.wsdlUrl, serviceName);
- dispatcher = service.createDispatch(
- portName,
- SOAPMessage.class,
- Service.Mode.MESSAGE
- );
+ if (epr != null) {
+ dispatcher = service.createDispatch(
+ epr,
+ SOAPMessage.class,
+ Service.Mode.MESSAGE,
+ new javax.xml.ws.soap.AddressingFeature()
+ );
+ } else {
+ dispatcher = service.createDispatch(
+ portName,
+ SOAPMessage.class,
+ Service.Mode.MESSAGE
+ );
+ }
+
if (initializer != null) {
initializer.serviceCreated();
}
Show replies by date