You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2006/05/25 11:25:09 UTC
svn commit: r409341 - in
/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model:
ModelLoader.cpp Wsdl.cpp Wsdl.h
Author: robbinspg
Date: Thu May 25 02:25:08 2006
New Revision: 409341
URL: http://svn.apache.org/viewvc?rev=409341&view=rev
Log:
TUSCANY-401 Add soap12 types
Modified:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.h
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp?rev=409341&r1=409340&r2=409341&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp Thu May 25 02:25:08 2006
@@ -1577,7 +1577,77 @@
"name",
"commonj.sdo", "String",
false, false, true);
+
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "RootType",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tAddress",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tBinding",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tBody",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs",
+ false, true, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tFault",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tFaultRes",
+ false, false, true);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tHeader",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tHeaderFault",
+ false, true, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tOperation",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tParts",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tStyleChoice",
+ false, false, false);
+ dataFactory->addType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "useChoice",
+ false, false, false);
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tAddress",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tBinding",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tBody",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs",
+ "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tFault",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tFaultRes");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tFaultRes",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tBody");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tHeader",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tOperation",
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "tStyleChoice",
+ "commonj.sdo", "String");
+ dataFactory->setBaseType(
+ "http://schemas.xmlsoap.org/wsdl/soap12/", "useChoice",
+ "commonj.sdo", "String");
}
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp?rev=409341&r1=409340&r2=409341&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp Thu May 25 02:25:08 2006
@@ -99,7 +99,6 @@
string portListName(portList[j]->getCString("name"));
if (portListName.compare(portName) == 0)
{
-
// found port
// Add address at this point
string targetAddress(portList[j]->getCString("address/location"));
@@ -115,10 +114,52 @@
message = message + " in the WSDL definition";
throw SystemConfigurationException(message.c_str());
}
+
+
+ string soapAction;
+ bool documentStyle = false;
+ bool useEncoded = false;
+ WsdlOperation::soapVersion soapVer = WsdlOperation::SOAP11;
+
+ // Find the binding operation
+ DataObjectList& bindingOperationList = wsBinding->getList("operation");
+ for (int i=0; i<bindingOperationList.size(); i++)
+ {
+ string name(bindingOperationList[i]->getCString("name"));
+
+ if (name.compare(operationName) == 0)
+ {
+ DataObjectPtr op = bindingOperationList[i]->getDataObject("operation");
+ string opType = op->getType().getURI();
+ if (opType == "http://schemas.xmlsoap.org/wsdl/soap12/")
+ {
+ soapVer = WsdlOperation::SOAP12;
+ }
+ // Get the soapAction
+ soapAction = bindingOperationList[i]->getCString("operation/soapAction");
+
+ // Get the style
+ string style = bindingOperationList[i]->getCString("operation/style");
+ if (style == "")
+ {
+ style = wsBinding->getCString("binding/style");
+ }
+ if (style == "document")
+ {
+ documentStyle = true;
+ }
+
+ // get the use
+ string use = bindingOperationList[i]->getCString("input/body/use");
+ if (style == "encoded")
+ {
+ useEncoded = true;
+ }
+ }
+ }
- // Get the soapAction
- string soapAction = getSoapAction(wsBinding, operationName);
+ // TODO - get the style from the binding or operation????
// Found the binding, get the portType
string wsPortTypeName(wsBinding->getCString("type"));
@@ -169,17 +210,17 @@
}
string responseType(wsMessageOut->getList("part")[0]->getCString("element"));
-
- WsdlOperation& wsdlOp = operationMap[operationKey];
- wsdlOp.setOperationName(operationName);
- wsdlOp.setSoapAction(soapAction);
- wsdlOp.setEndpoint(targetAddress);
- wsdlOp.setSoapVersion(WsdlOperation::SOAP11);
- wsdlOp.setDocumentStyle(true);
- wsdlOp.setEncoded(false);
- wsdlOp.setInputType(requestType);
- wsdlOp.setOutputType(responseType);
- return wsdlOp;
+
+ WsdlOperation& wsdlOp = operationMap[operationKey];
+ wsdlOp.setOperationName(operationName);
+ wsdlOp.setSoapAction(soapAction);
+ wsdlOp.setEndpoint(targetAddress);
+ wsdlOp.setSoapVersion(soapVer);
+ wsdlOp.setDocumentStyle(documentStyle);
+ wsdlOp.setEncoded(useEncoded);
+ wsdlOp.setInputType(requestType);
+ wsdlOp.setOutputType(responseType);
+ return wsdlOp;
}
}
@@ -187,16 +228,8 @@
message = "Unable to find Operation ";
message = message + operationName;
message = message + " in the WSDL definition";
- throw SystemConfigurationException(message.c_str());
-
-
-
-
+ throw SystemConfigurationException(message.c_str());
}
-
-
-
-
}
// cannot find the port
message = "Unable to find port ";
@@ -207,8 +240,6 @@
}
-
-
///
/// Find a service
///
@@ -319,31 +350,6 @@
return message;
}
-
- ///
- /// Get the soap action
- ///
- string Wsdl::getSoapAction(DataObjectPtr binding, const string& operationName)
- {
-
-
- // Find the binding operation
- DataObjectList& bindingOperationList = binding->getList("operation");
- for (int i=0; i<bindingOperationList.size(); i++)
- {
- string name(bindingOperationList[i]->getCString("name"));
-
- if (name.compare(operationName) == 0)
- {
- // Found the binding operation, return the soap action
- string soapAction(bindingOperationList[i]->getCString("operation/soapAction"));
- return soapAction;
- }
- }
-
- return string("");
- }
-
} // End namespace model
} // End namespace sca
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.h?rev=409341&r1=409340&r2=409341&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.h Thu May 25 02:25:08 2006
@@ -111,15 +111,6 @@
*/
DataObjectPtr findMessage(const string& messageName);
- /**
- * The the details of the soap action setting for an operation
- * on a soap binding.
- * @param binding The data object describing the binding.
- * @param operationName The name of the operation.
- * @return The soap action setting from the WSDL.
- */
- string getSoapAction(DataObjectPtr binding, const string& operationName);
-
/**
* The data object representation of the WSDL document.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org