You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2007/07/18 10:55:48 UTC
svn commit: r557203 - in
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2:
deployment/util/ description/ transport/http/ transport/nhttp/ util/
Author: davidillsley
Date: Wed Jul 18 01:55:47 2007
New Revision: 557203
URL: http://svn.apache.org/viewvc?view=rev&rev=557203
Log:
Fix up MEP processing for WSDL2.0 and action processing for
both wsdl 1.1 and wsdl 2.0
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/Axis2HttpRequest.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Wed Jul 18 01:55:47 2007
@@ -381,7 +381,7 @@
}
pinfo.setOperationPhases(operation);
axisService.addOperation(operation);
- if (operation.getInputAction() == null) {
+ if (operation.getSoapAction() == null) {
operation.setSoapAction("urn:" + opName);
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java Wed Jul 18 01:55:47 2007
@@ -507,9 +507,25 @@
public void setSoapAction(String soapAction) {
this.soapAction = soapAction;
}
-
+
+ /*
+ * Convenience method to access the WS-A Input Action per the
+ * WS-A spec. Effectively use the soapAction if available else
+ * use the first entry in the WSA Mapping list.
+ *
+ * Use getSoapAction when you want to get the soap action and this
+ * when you want to get the wsa input action.
+ */
public String getInputAction() {
- return soapAction;
+ String result = null;
+ if(soapAction != null && !"".equals(soapAction)){
+ result = soapAction;
+ }else{
+ if(wsamappingList != null && !wsamappingList.isEmpty()){
+ result = (String)wsamappingList.get(0);
+ }
+ }
+ return result;
}
public String getOutputAction() {
@@ -565,5 +581,9 @@
public AxisService getAxisService() {
return (AxisService)getParent();
}
+
+ public String getSoapAction() {
+ return soapAction;
+ }
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java Wed Jul 18 01:55:47 2007
@@ -573,7 +573,7 @@
OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME,
wsdl);
binding.addChild(operation);
- String soapAction = axisOperation.getInputAction();
+ String soapAction = axisOperation.getSoapAction();
if (soapAction == null) {
soapAction = "";
}
@@ -713,7 +713,7 @@
OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME,
wsdl);
binding.addChild(operation);
- String soapAction = axisOperation.getInputAction();
+ String soapAction = axisOperation.getSoapAction();
if (soapAction == null) {
soapAction = "";
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Wed Jul 18 01:55:47 2007
@@ -74,6 +74,7 @@
import org.apache.woden.wsdl20.xml.TypesElement;
import org.apache.woden.wsdl20.xml.DocumentationElement;
import org.apache.woden.wsdl20.xml.DocumentableElement;
+import org.apache.woden.xml.XMLAttr;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.utils.NamespaceMap;
import org.w3c.dom.Document;
@@ -368,6 +369,7 @@
DescriptionElement descriptionElement = null;
if (wsdlURI != null && !"".equals(wsdlURI)) {
description = readInTheWSDLFile(wsdlURI);
+ descriptionElement = description.toElement();
} else if (in != null) {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
@@ -866,6 +868,18 @@
} else {
MEP = pattern.toString();
}
+ if(!isServerSide){
+ // If in the client, need to toggle in-out to out-in etc.
+ if(WSDL2Constants.MEP_URI_IN_OUT.equals(MEP)){
+ MEP = WSDL2Constants.MEP_URI_OUT_IN;
+ }
+ if(WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)){
+ MEP = WSDL2Constants.MEP_URI_OUT_ONLY;
+ }
+ if(WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP)){
+ MEP = WSDL2Constants.MEP_URI_OUT_OPTIONAL_IN;
+ }
+ }
axisOperation = AxisOperationFactory.getOperationDescription(MEP);
axisOperation.setName(opName);
@@ -971,6 +985,30 @@
message.setName(elementQName != null ? elementQName.getLocalPart() : axisOperation.getName().getLocalPart());
axisOperation.addMessage(message, messageLabel);
+
+ if(WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(messageLabel)){
+ XMLAttr xa = messageReference.toElement().getExtensionAttribute(new QName("http://www.w3.org/2006/05/addressing/wsdl","Action"));
+ if(xa!=null){
+ String value = (String)xa.getContent();
+ if(value != null){
+ ArrayList al = axisOperation.getWSAMappingList();
+ if(al == null){
+ al = new ArrayList();
+ axisOperation.setWsamappingList(al);
+ }
+ al.add(value);
+ }
+ }
+ }else{
+ XMLAttr xa = messageReference.toElement().getExtensionAttribute(new QName("http://www.w3.org/2006/05/addressing/wsdl","Action"));
+ if(xa!=null){
+ String value = (String)xa.getContent();
+ if(value != null){
+ axisOperation.setOutputAction(value);
+ }
+ }
+ }
+
// populate this map so that this can be used in SOAPBody based dispatching
if (elementQName != null) {
axisService
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Wed Jul 18 01:55:47 2007
@@ -361,7 +361,7 @@
.length() == 0))) {
// last option is to get it from the axis operation
soapActionString = messageContext.getAxisOperation()
- .getInputAction();
+ .getSoapAction();
}
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/Axis2HttpRequest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/Axis2HttpRequest.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/Axis2HttpRequest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/nhttp/Axis2HttpRequest.java Wed Jul 18 01:55:47 2007
@@ -126,7 +126,7 @@
soapAction = msgContext.getWSAAction();
}
if (soapAction == null) {
- msgContext.getAxisOperation().getInputAction();
+ msgContext.getAxisOperation().getSoapAction();
}
if (msgContext.isSOAP11() && soapAction != null &&
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java?view=diff&rev=557203&r1=557202&r2=557203
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java Wed Jul 18 01:55:47 2007
@@ -264,7 +264,7 @@
opElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF, null,
tns.getPrefix() + ":" + name));
opElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ACTION, wsoap,
- axisOperation.getInputAction()));
+ axisOperation.getSoapAction()));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org