You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/09/09 04:42:26 UTC
svn commit: r441728 - in
/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model:
WSDLDefinition.cpp WSDLDefinition.h WSDLOperation.h
Author: jsdelfino
Date: Fri Sep 8 19:42:25 2006
New Revision: 441728
URL: http://svn.apache.org/viewvc?view=rev&rev=441728
Log:
Added a findOperation to WSDLDefinition to find an operation on a portType, and a wrappedStyle property to WSDLOperation
Modified:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.h
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp?view=diff&rev=441728&r1=441727&r2=441728
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp Fri Sep 8 19:42:25 2006
@@ -239,6 +239,93 @@
}
///
+ /// Find the operation defined in this wsdl
+ ///
+ const WSDLOperation& WSDLDefinition::findOperation(const string& portTypeName,
+ const string& operationName)
+ {
+ string operationKey = portTypeName+"#"+operationName;
+ OperationMap::iterator iter = operationMap.find(operationKey);
+ if (iter != operationMap.end())
+ {
+ return iter->second;
+ }
+
+ string soapAction = "";
+ bool documentStyle = true;
+ bool useEncoded = false;
+ WSDLOperation::soapVersion soapVer = WSDLOperation::SOAP11;
+
+ // Get the portType
+ DataObjectPtr wsPortType = findPortType(portTypeName);
+ if (!wsPortType)
+ {
+ string message = "Unable to find PortType ";
+ message = message + portTypeName;
+ message = message + " in the WSDL definition";
+ throw SystemConfigurationException(message.c_str());
+ }
+
+ //Utils::printDO(wsPortType);
+
+ // Found the portType, find the operation
+ DataObjectList& operationList = wsPortType->getList("operation");
+ for (int k=0; k< operationList.size(); k++)
+ {
+ string opName(operationList[k]->getCString("name"));
+ if( opName.compare(operationName) == 0)
+ {
+ // Found the operation
+
+ // Find the type of the request message
+ string inputMessageType = string(operationList[k]->getCString("input/message"));
+
+ DataObjectPtr wsMessageIn = findMessage(inputMessageType);
+ if (!wsMessageIn)
+ {
+ string message = "Unable to find message ";
+ message = message + inputMessageType;
+ message = message + " in the WSDL definition";
+ throw SystemConfigurationException(message.c_str());
+ }
+
+ string requestType(wsMessageIn->getList("part")[0]->getCString("element"));
+
+ // Find the type of the response message
+ string outputMessageType = string(operationList[k]->getCString("output/message"));
+
+ DataObjectPtr wsMessageOut = findMessage(outputMessageType);
+ if (!wsMessageOut)
+ {
+ string message = "Unable to find message ";
+ message = message + outputMessageType;
+ message = message + " in the WSDL definition";
+ throw SystemConfigurationException(message.c_str());
+ }
+
+ string responseType(wsMessageOut->getList("part")[0]->getCString("element"));
+
+ WSDLOperation& wsdlOp = operationMap[operationKey];
+ wsdlOp.setOperationName(operationName);
+ wsdlOp.setSoapAction(soapAction);
+ wsdlOp.setEndpoint("");
+ wsdlOp.setSoapVersion(soapVer);
+ wsdlOp.setDocumentStyle(documentStyle);
+ wsdlOp.setEncoded(useEncoded);
+ wsdlOp.setInputType(requestType);
+ wsdlOp.setOutputType(responseType);
+ return wsdlOp;
+ }
+ }
+
+ string message = "Unable to find Operation ";
+ message = message + operationName;
+ message = message + " in the WSDL definition";
+ throw SystemConfigurationException(message.c_str());
+
+ }
+
+ ///
/// Find a service
///
DataObjectPtr WSDLDefinition::findService(const string& serviceName)
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h?view=diff&rev=441728&r1=441727&r2=441728
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h Fri Sep 8 19:42:25 2006
@@ -79,6 +79,16 @@
const string& portName,
const string& operationName);
+ /**
+ * Find an operation in the WSDL definitions.
+ * @param portTypeName The name of the portType on which this
+ * operation is defined.
+ * @param operationName The name of the operation to find.
+ * @return The operation if found. Exception thrown if not found.
+ */
+ SCA_API const WSDLOperation& findOperation(const string& portTypeName,
+ const string& operationName);
+
private:
/**
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.h?view=diff&rev=441728&r1=441727&r2=441728
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.h Fri Sep 8 19:42:25 2006
@@ -91,6 +91,9 @@
SCA_API void setDocumentStyle(bool docStyle) {documentStyle = docStyle;}
SCA_API bool isDocumentStyle() const {return documentStyle;}
+ SCA_API void setWrappedStyle(bool wrapStyle) {wrappedStyle = wrapStyle;}
+ SCA_API bool isWrappedStyle() const {return wrappedStyle;}
+
SCA_API void setEncoded(bool enc) {encoded = enc;}
SCA_API bool isEncoded() const {return encoded;}
@@ -120,6 +123,7 @@
string endpoint;
bool documentStyle;
+ bool wrappedStyle;
bool encoded;
soapVersion soapVer;
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org