Author: objectiser
Date: 2012-06-11 05:10:24 -0400 (Mon, 11 Jun 2012)
New Revision: 1564
Modified:
branches/RiftSaw-2.3.x/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
Log:
RIFTSAW-497 - only create dispatcher if EPR explicitly provided, otherwise used cached
dispatcher with default URL.
Modified:
branches/RiftSaw-2.3.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
branches/RiftSaw-2.3.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2012-06-08
08:58:10 UTC (rev 1563)
+++
branches/RiftSaw-2.3.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2012-06-11
09:10:24 UTC (rev 1564)
@@ -458,34 +458,43 @@
// Bug 807577 - when EPR explicitly provided, this worked for first invocation, but
subsequent invocations
// on different URLs were directed to same service as initial request, as dispatcher
was not being re-created.
- // If this causes performance issues, then may need to flag clients that use explicit
EPRs, and only refresh
- // the dispatcher for those cases
- //if(null==dispatcher) {
-
- log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName);
- JAXWSInitializer initializer=initializeStack(portName);
+ if(epr != null) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName+" (epr="+epr+")");
+ }
+ JAXWSInitializer initializer=initializeStack(portName);
- Service service = Service.create(this.wsdlUrl, serviceName);
+ Service service = Service.create(this.wsdlUrl, serviceName);
- if (epr != null) {
- dispatcher = service.createDispatch(
+ dispatcher = service.createDispatch(
epr,
SOAPMessage.class,
Service.Mode.MESSAGE,
- new javax.xml.ws.soap.AddressingFeature()
- );
- } else {
- dispatcher = service.createDispatch(
+ new javax.xml.ws.soap.AddressingFeature());
+
+ if (initializer != null) {
+ initializer.serviceCreated(this.serviceName, portName, this.baseURI, dispatcher);
+ }
+ } else if(null==dispatcher) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName);
+ }
+ JAXWSInitializer initializer=initializeStack(portName);
+
+ Service service = Service.create(this.wsdlUrl, serviceName);
+
+ dispatcher = service.createDispatch(
portName,
SOAPMessage.class,
- Service.Mode.MESSAGE
- );
- }
+ Service.Mode.MESSAGE);
- if (initializer != null) {
- initializer.serviceCreated(this.serviceName, portName, this.baseURI, dispatcher);
- }
- //}
+ if (initializer != null) {
+ initializer.serviceCreated(this.serviceName, portName, this.baseURI, dispatcher);
+ }
+ }
+
return dispatcher;
}
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 2012-06-08
08:58:10 UTC (rev 1563)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2012-06-11
09:10:24 UTC (rev 1564)
@@ -458,34 +458,43 @@
// Bug 807577 - when EPR explicitly provided, this worked for first invocation, but
subsequent invocations
// on different URLs were directed to same service as initial request, as dispatcher
was not being re-created.
- // If this causes performance issues, then may need to flag clients that use explicit
EPRs, and only refresh
- // the dispatcher for those cases
- //if(null==dispatcher || epr != null) {
-
- log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName);
- JAXWSInitializer initializer=initializeStack(portName);
+ if(epr != null) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName+" (epr="+epr+")");
+ }
+ JAXWSInitializer initializer=initializeStack(portName);
- Service service = Service.create(this.wsdlUrl, serviceName);
+ Service service = Service.create(this.wsdlUrl, serviceName);
- if (epr != null) {
- dispatcher = service.createDispatch(
+ dispatcher = service.createDispatch(
epr,
SOAPMessage.class,
Service.Mode.MESSAGE,
- new javax.xml.ws.soap.AddressingFeature()
- );
- } else {
- dispatcher = service.createDispatch(
+ new javax.xml.ws.soap.AddressingFeature());
+
+ if (initializer != null) {
+ initializer.serviceCreated(this.serviceName, portName, this.baseURI, dispatcher);
+ }
+ } else if(null==dispatcher) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName);
+ }
+ JAXWSInitializer initializer=initializeStack(portName);
+
+ Service service = Service.create(this.wsdlUrl, serviceName);
+
+ dispatcher = service.createDispatch(
portName,
SOAPMessage.class,
- Service.Mode.MESSAGE
- );
- }
+ Service.Mode.MESSAGE);
- if (initializer != null) {
- initializer.serviceCreated(this.serviceName, portName, this.baseURI, dispatcher);
- }
- //}
+ if (initializer != null) {
+ initializer.serviceCreated(this.serviceName, portName, this.baseURI, dispatcher);
+ }
+ }
+
return dispatcher;
}