svn commit: r919960 - /axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java

2010-03-07 Thread amilas
Author: amilas
Date: Sun Mar  7 10:08:38 2010
New Revision: 919960

URL: http://svn.apache.org/viewvc?rev=919960&view=rev
Log:
always transport out should not be taken from the Http transport. Most of the 
time correct transport out is set
in the message context itself. so first should be look at it and then 
InCommingtransport name. http transport out 
can be looked only if nothing is there.

Modified:

axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java

Modified: 
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=919960&r1=919959&r2=919960&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
 Sun Mar  7 10:08:38 2010
@@ -22,6 +22,7 @@
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.ConfigurationContext;
@@ -30,6 +31,7 @@
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.transport.MessageFormatter;
 import org.apache.axis2.transport.OutTransportInfo;
@@ -165,8 +167,18 @@
 format.setMimeBoundary((String) mimeBoundaryProperty);
 }
 
-TransportOutDescription transportOut = 
msgContext.getConfigurationContext().
-
getAxisConfiguration().getTransportOut(Constants.TRANSPORT_HTTP);
+AxisConfiguration axisConfiguration = 
msgContext.getConfigurationContext().getAxisConfiguration();
+TransportOutDescription transportOut = null;
+if (msgContext.getTransportOut() != null){
+ transportOut = msgContext.getTransportOut();
+} else if (msgContext.getIncomingTransportName() != null){
+transportOut = 
axisConfiguration.getTransportOut(msgContext.getIncomingTransportName());
+} else if 
(msgContext.getOperationContext().getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN)
 != null){
+String transportName = 
msgContext.getOperationContext().getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN).getIncomingTransportName();
+transportOut = 
msgContext.getConfigurationContext().getAxisConfiguration().getTransportOut(transportName);
+} else {
+transportOut = 
msgContext.getConfigurationContext().getAxisConfiguration().getTransportOut(Constants.TRANSPORT_HTTP);
+}
 
  // set the timeout properteies
 




svn commit: r919967 - /axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java

2010-03-07 Thread amilas
Author: amilas
Date: Sun Mar  7 11:16:14 2010
New Revision: 919967

URL: http://svn.apache.org/viewvc?rev=919967&view=rev
Log:
fixing the issue AXIS2-4641. added a null check for message context.

Modified:

axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java

Modified: 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?rev=919967&r1=919966&r2=919967&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
 Sun Mar  7 11:16:14 2010
@@ -293,12 +293,13 @@
 SimpleDateFormat zulu = new SimpleDateFormat("-MM-dd");
 
 MessageContext messageContext = 
MessageContext.getCurrentMessageContext();
-AxisService axisServce = messageContext.getAxisService();
-// if the user has given a pirticualr timezone we use it.
-if (axisServce.getParameter("TimeZone") != null){
-   
zulu.setTimeZone(TimeZone.getTimeZone((String)axisServce.getParameter("TimeZone").getValue()));
+if (messageContext != null) {
+AxisService axisServce = messageContext.getAxisService();
+// if the user has given a pirticualr timezone we use it.
+if (axisServce.getParameter("TimeZone") != null) {
+zulu.setTimeZone(TimeZone.getTimeZone((String) 
axisServce.getParameter("TimeZone").getValue()));
+}
 }
-
 return zulu.format(obj);
 }
 return obj.toString();




svn commit: r919972 - /axis/axis2/java/core/trunk/modules/osgi/resources/org/apache/axis2/osgi/deployment/axis2.xml

2010-03-07 Thread amilas
Author: amilas
Date: Sun Mar  7 11:34:23 2010
New Revision: 919972

URL: http://svn.apache.org/viewvc?rev=919972&view=rev
Log:
fixing issue AXIS2-4639

Modified:

axis/axis2/java/core/trunk/modules/osgi/resources/org/apache/axis2/osgi/deployment/axis2.xml

Modified: 
axis/axis2/java/core/trunk/modules/osgi/resources/org/apache/axis2/osgi/deployment/axis2.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/osgi/resources/org/apache/axis2/osgi/deployment/axis2.xml?rev=919972&r1=919971&r2=919972&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/osgi/resources/org/apache/axis2/osgi/deployment/axis2.xml
 (original)
+++ 
axis/axis2/java/core/trunk/modules/osgi/resources/org/apache/axis2/osgi/deployment/axis2.xml
 Sun Mar  7 11:34:23 2010
@@ -332,6 +332,7 @@
 
 
 
+
 
 
 




svn commit: r920200 - /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

2010-03-07 Thread ruwan
Author: ruwan
Date: Mon Mar  8 06:05:44 2010
New Revision: 920200

URL: http://svn.apache.org/viewvc?rev=920200&view=rev
Log:
Adding a method to the AxisConfiguration to add a service to an axisting active 
service group

Modified:

axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=920200&r1=920199&r2=920200&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
 Mon Mar  8 06:05:44 2010
@@ -407,6 +407,70 @@
 addChild(axisServiceGroup);
 }
 
+/**
+ * This method is used to add a service to an existing active service 
group in the axis configuration
+ *
+ * @param axisService service to be added to the existing service group 
provided
+ * @param serviceGroupName name of the service group which should be 
existing in the axis configuration
+ * @throws AxisFault in case of an error in adding the service to the 
group specified or if the group is not existing
+ */
+public void addServiceToExistingServiceGroup(AxisService axisService,
+ String serviceGroupName) 
throws AxisFault {
+
+AxisServiceGroup serviceGroup = getServiceGroup(serviceGroupName);
+if (serviceGroup == null) {
+String message = "A ServiceGroup with the provided name "
++ serviceGroupName + " is not existing";
+log.error(message);
+throw new AxisFault(message);
+}
+
+if (axisService.getSchemaTargetNamespace() == null) {
+axisService.setSchemaTargetNamespace(Java2WSDLConstants.AXIS2_XSD);
+}
+
+if (axisService.isUseDefaultChains()) {
+Iterator operations = axisService.getOperations();
+while (operations.hasNext()) {
+AxisOperation operation = operations.next();
+phasesinfo.setOperationPhases(operation);
+}
+}
+
+Map endpoints = axisService.getEndpoints();
+if (endpoints == null || endpoints.size() == 0) {
+   
org.apache.axis2.deployment.util.Utils.addEndpointsToService(
+   axisService, 
axisService.getAxisConfiguration());
+endpoints = axisService.getEndpoints();
+   }
+
+String serviceName = axisService.getName();
+addToAllServicesMap(axisService);
+
+if (endpoints != null) {
+Iterator endpointNameIter = endpoints.keySet().iterator();
+while (endpointNameIter.hasNext()) {
+String endpointName = endpointNameIter.next();
+if (log.isDebugEnabled()) {
+log.debug("Adding service to allEndpoints map: ("
++ serviceName + "," + endpointName + ") ");
+}
+
+allEndpoints.put(serviceName + "." + endpointName, 
axisService);
+}
+if (log.isDebugEnabled()) {
+log.debug("After adding to allEndpoints map, size is "
++ allEndpoints.size());
+}
+}
+
+serviceGroup.addService(axisService);
+
+if (!axisService.isClientSide()) {
+notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY, 
axisService), axisService);
+}
+}
+
 public void addToAllServicesMap(AxisService axisService) throws AxisFault {
 String serviceName = axisService.getName();
 AxisService oldService = allServices.get(serviceName);