Просмотр исходного кода

Intentional merge to keep first working version

Conflicts:
	Plugins/org.commontk.dicom.wg23.app/ctkDicomAppServerPrivate.cpp
	Plugins/org.commontk.dicom.wg23.app/ctkDicomHostService.cpp
	Plugins/org.commontk.dicom.wg23.app/ctkDicomHostService.h
	Plugins/org.commontk.dicom.wg23.core/ctkDicomServicePrivate.cpp
	Plugins/org.commontk.dicom.wg23.host/ctkDicomAppService.cpp
	Plugins/org.commontk.dicom.wg23.host/ctkDicomAppService.h
	Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.cpp
ivowolf лет назад: 15
Родитель
Сommit
7cb840cdb5
33 измененных файлов с 1300 добавлено и 207 удалено
  1. 16 0
      Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHost.cpp
  2. 8 0
      Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHost.h
  3. 1 0
      Plugins/org.commontk.dicom.wg23.app/CMakeLists.txt
  4. 101 0
      Plugins/org.commontk.dicom.wg23.app/ctkAppSoapMessageProcessor.cpp
  5. 52 0
      Plugins/org.commontk.dicom.wg23.app/ctkAppSoapMessageProcessor.h
  6. 13 52
      Plugins/org.commontk.dicom.wg23.app/ctkDicomAppServerPrivate.cpp
  7. 3 7
      Plugins/org.commontk.dicom.wg23.app/ctkDicomAppServerPrivate.h
  8. 30 11
      Plugins/org.commontk.dicom.wg23.app/ctkDicomHostService.cpp
  9. 13 6
      Plugins/org.commontk.dicom.wg23.app/ctkDicomHostService.h
  10. 4 0
      Plugins/org.commontk.dicom.wg23.core/CMakeLists.txt
  11. 1 1
      Plugins/org.commontk.dicom.wg23.core/ctkDicomAppInterface.h
  12. 9 7
      Plugins/org.commontk.dicom.wg23.core/ctkDicomExchangeInterface.h
  13. 69 0
      Plugins/org.commontk.dicom.wg23.core/ctkDicomExchangeService.cpp
  14. 48 0
      Plugins/org.commontk.dicom.wg23.core/ctkDicomExchangeService.h
  15. 2 2
      Plugins/org.commontk.dicom.wg23.core/ctkDicomHostInterface.h
  16. 15 4
      Plugins/org.commontk.dicom.wg23.core/ctkDicomServicePrivate.cpp
  17. 3 1
      Plugins/org.commontk.dicom.wg23.core/ctkDicomServicePrivate.h
  18. 1 1
      Plugins/org.commontk.dicom.wg23.core/ctkDicomWG23Types.h
  19. 329 3
      Plugins/org.commontk.dicom.wg23.core/ctkDicomWG23TypesHelper.h
  20. 108 0
      Plugins/org.commontk.dicom.wg23.core/ctkExchangeSoapMessageProcessor.cpp
  21. 53 0
      Plugins/org.commontk.dicom.wg23.core/ctkExchangeSoapMessageProcessor.h
  22. 59 0
      Plugins/org.commontk.dicom.wg23.core/ctkSoapMessageProcessor.h
  23. 46 0
      Plugins/org.commontk.dicom.wg23.core/ctkSoapMessageProcessorList.cpp
  24. 47 0
      Plugins/org.commontk.dicom.wg23.core/ctkSoapMessageProcessorList.h
  25. 1 0
      Plugins/org.commontk.dicom.wg23.host/CMakeLists.txt
  26. 26 6
      Plugins/org.commontk.dicom.wg23.host/ctkDicomAppService.cpp
  27. 15 9
      Plugins/org.commontk.dicom.wg23.host/ctkDicomAppService.h
  28. 10 82
      Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.cpp
  29. 3 12
      Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.h
  30. 133 0
      Plugins/org.commontk.dicom.wg23.host/ctkHostSoapMessageProcessor.cpp
  31. 56 0
      Plugins/org.commontk.dicom.wg23.host/ctkHostSoapMessageProcessor.h
  32. 19 3
      Plugins/org.commontk.example.dicomapp/ctkExampleDicomAppLogic.cpp
  33. 6 0
      Plugins/org.commontk.example.dicomapp/ctkExampleDicomAppLogic_p.h

+ 16 - 0
Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHost.cpp

@@ -71,3 +71,19 @@ void ctkDicomExampleHost::forwardConsoleOutput()
     std::cout << line.toStdString();
   }
 }
+
+bool ctkDicomExampleHost::notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData)
+{
+  return false;
+}
+
+QList<ctkDicomWG23::ObjectLocator>* ctkDicomExampleHost::getData(
+  QList<QUuid> objectUUIDs, 
+  QList<QString> acceptableTransferSyntaxUIDs, 
+  bool includeBulkData)
+{
+  return NULL;
+}
+void ctkDicomExampleHost::releaseData(QList<QUuid> objectUUIDs)
+{
+}

+ 8 - 0
Plugins/org.commontk.dicom.examplehost/ctkDicomExampleHost.h

@@ -20,6 +20,14 @@ public:
     virtual QString getOutputLocation(const QStringList& /*preferredProtocols*/) { return ""; }
     virtual void notifyStateChanged(ctkDicomWG23::State state);
     virtual void notifyStatus(const ctkDicomWG23::Status& status);
+    // exchange methods
+    virtual bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData);
+    virtual QList<ctkDicomWG23::ObjectLocator>* getData(
+      QList<QUuid> objectUUIDs, 
+      QList<QString> acceptableTransferSyntaxUIDs, 
+      bool includeBulkData);
+    virtual void releaseData(QList<QUuid> objectUUIDs);
+    
     const QProcess& getAppProcess() const { return appProcess; }
     ~ctkDicomExampleHost();
 

+ 1 - 0
Plugins/org.commontk.dicom.wg23.app/CMakeLists.txt

@@ -13,6 +13,7 @@ SET(PLUGIN_SRCS
   ctkDicomWG23AppPlugin.cpp
   ctkDicomAbstractApp.cpp
   ctkDicomHostService.cpp
+  ctkAppSoapMessageProcessor.cpp
 )
 
 # Files which should be processed by Qts moc

+ 101 - 0
Plugins/org.commontk.dicom.wg23.app/ctkAppSoapMessageProcessor.cpp

@@ -0,0 +1,101 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#include "ctkAppSoapMessageProcessor.h"
+
+#include <ctkDicomWG23TypesHelper.h>
+#include "ctkPluginContext.h"
+#include "ctkDicomWG23AppPlugin_p.h"
+
+ctkAppSoapMessageProcessor::ctkAppSoapMessageProcessor(ctkDicomAppInterface* inter)
+: appInterface(inter)
+{}
+
+bool ctkAppSoapMessageProcessor::process(
+	const QtSoapMessage& message,
+	QtSoapMessage* reply ) const
+{
+  // TODO check for NULL appInterface?
+  
+  const QtSoapType& method = message.method();
+  QString methodName = method.name().name();
+
+  qDebug() << "AppMessageProcessor: Received soap method request: " << methodName;
+
+  bool foundMethod = false;
+  
+  if (methodName == "getState")
+  {
+    processGetState(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "setState")
+  {
+    processSetState(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "bringToFront")
+  {
+    processBringToFront(message, reply);
+    foundMethod = true;
+  }
+  
+  return foundMethod;
+}
+		
+void ctkAppSoapMessageProcessor::processGetState(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message: nothing to be done
+  // query interface
+  const ctkDicomWG23::State result = appInterface->getState();
+  // set reply message
+  reply->setMethod("getState");
+  QtSoapSimpleType* resultType = new ctkDicomSoapState("getStateResponse",result);
+  reply->addMethodArgument(resultType);
+}
+
+void ctkAppSoapMessageProcessor::processSetState(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["newState"];
+  // query interface
+  bool result = appInterface->setState(ctkDicomSoapState::getState(inputType));
+  // set reply message
+  reply->setMethod("setState");
+  QtSoapType* resultType = new ctkDicomSoapBool("setStateResponse",result);
+  reply->addMethodArgument(resultType);
+}
+
+void ctkAppSoapMessageProcessor::processBringToFront(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["requestedScreenArea"];
+  const QRect requestedScreenArea = ctkDicomSoapRectangle::getQRect(inputType);
+  // query interface
+  bool result = appInterface->bringToFront(requestedScreenArea);
+  // set reply message
+  reply->setMethod("bringToFront");
+  QtSoapType* resultType = new ctkDicomSoapBool("bringToFrontResponse",result);
+  reply->addMethodArgument(resultType);
+}

+ 52 - 0
Plugins/org.commontk.dicom.wg23.app/ctkAppSoapMessageProcessor.h

@@ -0,0 +1,52 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#ifndef CTKAPPSOAPMESSAGEPROCESSOR_H
+#define CTKAPPSOAPMESSAGEPROCESSOR_H
+
+#include "ctkSoapMessageProcessor.h"
+#include "ctkDicomAppInterface.h"
+
+class ctkAppSoapMessageProcessor : public ctkSoapMessageProcessor
+{
+
+public:
+
+  ctkAppSoapMessageProcessor( ctkDicomAppInterface* inter );
+
+  bool process(
+    const QtSoapMessage& message,
+    QtSoapMessage* reply) const;
+    
+private:
+
+  void processGetState(const QtSoapMessage& message,
+                       QtSoapMessage* reply) const;
+  void processSetState(const QtSoapMessage& message,
+                       QtSoapMessage* reply) const;
+  void processBringToFront(const QtSoapMessage& message,
+                           QtSoapMessage* reply) const;
+               
+  ctkDicomAppInterface* appInterface;
+
+};
+
+#endif // CTKSOAPMESSAGEPROCESSORLIST_H

+ 13 - 52
Plugins/org.commontk.dicom.wg23.app/ctkDicomAppServerPrivate.cpp

@@ -31,8 +31,11 @@
 #include <ctkDicomWG23TypesHelper.h>
 #include <ctkDicomWG23AppPlugin_p.h>
 
+#include <ctkExchangeSoapMessageProcessor.h>
+#include "ctkAppSoapMessageProcessor.h"
+
 ctkDicomAppServerPrivate::ctkDicomAppServerPrivate(int port) :
-    appInterface(0), port(port)
+      appInterface(0), port(port)
 {
   connect(&server, SIGNAL(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)),
           this, SLOT(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)));
@@ -74,15 +77,11 @@ void ctkDicomAppServerPrivate::incomingWSDLMessage(
     }
   }
 }
+void ctkDicomAppServerPrivate::incomingSoapMessage(
+  const QtSoapMessage& message,
+  QtSoapMessage* reply)
 
-void ctkDicomAppServerPrivate::incomingSoapMessage(const QtSoapMessage& message,
-                                              QtSoapMessage* reply)
 {
-  const QtSoapType& method = message.method();
-  QString methodName = method.name().name();
-
-  qDebug() << "AppServer: Received soap method request: " << methodName;
-
   if(appInterface == NULL)
   {
     ctkPluginContext* context = ctkDicomWG23AppPlugin::getInstance()->getPluginContext();
@@ -93,51 +92,13 @@ void ctkDicomAppServerPrivate::incomingSoapMessage(const QtSoapMessage& message,
       throw std::runtime_error("No Dicom App Service found");
     }
     appInterface = qobject_cast<ctkDicomAppInterface*>(context->getService(serviceRef));
+    
+    ctkAppSoapMessageProcessor* appProcessor = new ctkAppSoapMessageProcessor( appInterface );
+    processors.push_back(appProcessor);
+    ctkExchangeSoapMessageProcessor* exchangeProcessor = new ctkExchangeSoapMessageProcessor( appInterface );
+    processors.push_back(exchangeProcessor);
   }
 
-  if (methodName == "getState")
-  {
-    processGetState(message, reply);
-  }
-  if (methodName == "setState")
-  {
-    processSetState(message, reply);
-  }
-  if (methodName == "bringToFront")
-  {
-    processBringToFront(message, reply);
-  }
+  processors.process(message, reply);
 }
 
-void ctkDicomAppServerPrivate::processGetState(
-    const QtSoapMessage &message, QtSoapMessage *reply)
-{
-    const ctkDicomWG23::State result = appInterface->getState();
-
-    reply->setMethod("GetState");
-    QtSoapSimpleType* stateType = new ctkDicomSoapState("state",result);
-    reply->addMethodArgument(stateType);
-}
-
-void ctkDicomAppServerPrivate::processSetState(
-    const QtSoapMessage &message, QtSoapMessage *reply)
-{
-    const QtSoapType& stateType = message.method()[0];//["state"];
-    bool result = appInterface->setState(ctkDicomSoapState::getState(stateType));
-  
-    reply->setMethod("SetState");
-    QtSoapType* stateLegal = new ctkDicomSoapBool("stateLegal",result);
-    reply->addMethodArgument(stateLegal);
-}
-
-void ctkDicomAppServerPrivate::processBringToFront(
-    const QtSoapMessage &message, QtSoapMessage *reply)
-{
-   const QtSoapType& requestedScreenAreaType = message.method()["requestedScreenArea"];
-   const QRect requestedScreenArea = ctkDicomSoapRectangle::getQRect(requestedScreenAreaType);
-
-   reply->setMethod("bringToFront");
-   bool result = appInterface->bringToFront(requestedScreenArea);
-   QtSoapType* received = new ctkDicomSoapBool("received",result);
-   reply->addMethodArgument(received);
-}

+ 3 - 7
Plugins/org.commontk.dicom.wg23.app/ctkDicomAppServerPrivate.h

@@ -27,6 +27,7 @@
 #include <QtSoapMessage>
 
 #include <ctkSimpleSoapServer.h>
+#include <ctkSoapMessageProcessorList.h>
 
 class ctkDicomAppInterface;
 
@@ -38,7 +39,6 @@ public:
   ctkDicomAppServerPrivate(int port);
 
   ctkSimpleSoapServer server;
-  ctkDicomAppInterface* appInterface;
   int port;
 
 public slots:
@@ -49,12 +49,8 @@ public slots:
 
 private:
 
-  void processGetState(const QtSoapMessage& message,
-                       QtSoapMessage* reply);
-  void processSetState(const QtSoapMessage& message,
-                       QtSoapMessage* reply);
-  void processBringToFront(const QtSoapMessage& message,
-                           QtSoapMessage* reply);
+  ctkSoapMessageProcessorList processors;
+  ctkDicomAppInterface* appInterface;
 
 };
 

+ 30 - 11
Plugins/org.commontk.dicom.wg23.app/ctkDicomHostService.cpp

@@ -25,18 +25,18 @@
 
 #include "ctkDicomWG23TypesHelper.h"
 
-ctkDicomHostService::ctkDicomHostService(int port, QString path)
-  : d_ptr(new ctkDicomServicePrivate(port, path))
+ctkDicomHostService::ctkDicomHostService(ushort port, QString path):
+    service(port, path), d(new ctkDicomServicePrivate(port, path))
 {
-
 }
+
 ctkDicomHostService::~ctkDicomHostService()
 {
 }
 
 QString ctkDicomHostService::generateUID()
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomService);
 
   const QtSoapType& result = d->askHost("generateUID", NULL);
   QString resultUID = ctkDicomSoapUID::getUID(result);
@@ -45,10 +45,10 @@ QString ctkDicomHostService::generateUID()
 
 QString ctkDicomHostService::getOutputLocation(const QStringList& preferredProtocols)
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomHostService);
 
   QtSoapStruct* input = dynamic_cast<QtSoapStruct*>(
-    new ctkDicomSoapArrayOfString("preferredProtocols", preferredProtocols));
+    new ctkDicomSoapArrayOfStringType("string","preferredProtocols", preferredProtocols));
   const QtSoapType& result = d->askHost("getOutputLocation", input);
   QString resultString = result.value().toString();
   return resultString;
@@ -56,7 +56,7 @@ QString ctkDicomHostService::getOutputLocation(const QStringList& preferredProto
 
 QRect ctkDicomHostService::getAvailableScreen(const QRect& preferredScreen)
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomService);
 
   QtSoapStruct* input = new ctkDicomSoapRectangle("preferredScreen", preferredScreen);
   const QtSoapType& result = d->askHost("getAvailableScreen", input);
@@ -67,16 +67,35 @@ QRect ctkDicomHostService::getAvailableScreen(const QRect& preferredScreen)
 
 void ctkDicomHostService::notifyStateChanged(ctkDicomWG23::State state)
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomService);
 
-  QtSoapType* input = new ctkDicomSoapState("newState", state); // spec would be "state", jave has "newState"
+  QtSoapType* input = new ctkDicomSoapState("newState", state); // spec would be "state", java has "newState" FIX JAVA/STANDARD
   d->askHost("notifyStateChanged", input);
 }
 
 void ctkDicomHostService::notifyStatus(const ctkDicomWG23::Status& status)
 {
-  Q_D(ctkDicomService);
-
+  //Q_D(ctkDicomService);
   QtSoapStruct* input = new ctkDicomSoapStatus("status", status);
   d->askHost("notifyStatus", input);
 }
+
+// Exchange methods
+
+bool ctkDicomHostService::notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData)
+{
+  return service.notifyDataAvailable(data, lastData);
+}
+
+QList<ctkDicomWG23::ObjectLocator>* ctkDicomHostService::getData(
+  QList<QUuid> objectUUIDs, 
+  QList<QString> acceptableTransferSyntaxUIDs, 
+  bool includeBulkData)
+{
+  return service.getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
+}
+
+void ctkDicomHostService::releaseData(QList<QUuid> objectUUIDs)
+{
+  service.releaseData(objectUUIDs);
+}

+ 13 - 6
Plugins/org.commontk.dicom.wg23.app/ctkDicomHostService.h

@@ -24,16 +24,14 @@
 #define CTKDICOMHOSTSERVICE_H
 
 #include <ctkDicomHostInterface.h>
-#include <QScopedPointer>
+#include <ctkDicomExchangeService.h>
 #include <org_commontk_dicom_wg23_app_Export.h>
 
-class ctkDicomServicePrivate;
-
 class org_commontk_dicom_wg23_app_EXPORT ctkDicomHostService : public ctkDicomHostInterface
 {
 
 public:
-  ctkDicomHostService(int port, QString path);
+  ctkDicomHostService(ushort port, QString path);
   ~ctkDicomHostService();
 
   QString generateUID();
@@ -42,10 +40,19 @@ public:
   void notifyStateChanged(ctkDicomWG23::State state);
   void notifyStatus(const ctkDicomWG23::Status& status);
 
+  // Exchange methods
+  bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData);
+  QList<ctkDicomWG23::ObjectLocator>* getData(
+    QList<QUuid> objectUUIDs, 
+    QList<QString> acceptableTransferSyntaxUIDs, 
+    bool includeBulkData);
+  void releaseData(QList<QUuid> objectUUIDs);
+
 private:
-  Q_DECLARE_PRIVATE(ctkDicomService)
+  ctkDicomServicePrivate * d;
+
+  ctkDicomExchangeService service;
 
-  const QScopedPointer<ctkDicomServicePrivate> d_ptr;
 };
 
 #endif // CTKDICOMHOSTSERVICE_H

+ 4 - 0
Plugins/org.commontk.dicom.wg23.core/CMakeLists.txt

@@ -22,6 +22,9 @@ SET(PLUGIN_SRCS
   ctkDicomServicePrivate.cpp
   ctkDicomWG23Types.h
   ctkDicomWG23TypesHelper.h
+  ctkDicomExchangeService.cpp
+  ctkSoapMessageProcessorList.cpp
+  ctkExchangeSoapMessageProcessor.cpp
 )
 
 # Files which should be processed by Qts moc
@@ -34,6 +37,7 @@ SET(PLUGIN_MOC_SRCS
   ctkDicomWG23CorePlugin_p.h
   ctkSimpleSoapServer.h
   ctkSoapConnectionRunnable_p.h
+  ctkDicomExchangeService.h
 )
 
 # Qt Designer files which should be processed by Qts uic

+ 1 - 1
Plugins/org.commontk.dicom.wg23.core/ctkDicomAppInterface.h

@@ -43,7 +43,7 @@ public:
   virtual bool bringToFront(const QRect& requestedScreenArea) = 0;
 
   // Data exchange interface methods
-  // ...
+  // inherited from ctkDicomExchangeInterface
 
 };
 

+ 9 - 7
Plugins/org.commontk.dicom.wg23.core/ctkDicomExchangeInterface.h

@@ -27,7 +27,6 @@
 #include <QRect>
 
 #include "ctkDicomWG23Types.h"
-
 #include <org_commontk_dicom_wg23_core_Export.h>
 
 class org_commontk_dicom_wg23_core_EXPORT ctkDicomExchangeInterface : public QObject
@@ -37,18 +36,21 @@ class org_commontk_dicom_wg23_core_EXPORT ctkDicomExchangeInterface : public QOb
 public:
 
   // Data exchange interface methods
-  //
 
-  //virtual bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData) = 0;
-  //virtual QList<ctkDicomWG23::ObjectLocator> getData(QList<QUuid> objectUUIDs, QList<QString> acceptableTransferSyntaxUIDs, bool includeBulkData) = 0;
+  virtual bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData) = 0;
+
+  virtual QList<ctkDicomWG23::ObjectLocator>* getData(
+    QList<QUuid> objectUUIDs, 
+    QList<QString> acceptableTransferSyntaxUIDs, 
+    bool includeBulkData) = 0;
+
+  virtual void releaseData(QList<QUuid> objectUUIDs) = 0;
 
-  //    8.3.3 getAsModels(objectUUIDs : ArrayOfUUID, classUID : UID, supportedInfosetTypes : ArrayOfMimeType) : ModelSetDescriptor	33
+//    8.3.3 getAsModels(objectUUIDs : ArrayOfUUID, classUID : UID, supportedInfosetTypes : ArrayOfMimeType) : ModelSetDescriptor	33
 //    8.3.4 queryModel(models : ArrayOfUUID, xpaths : ArrayOfString) : ArrayOfQueryResult	34
 //    8.3.5 queryInfoset(models : ArrayOfUUID, xpaths : ArrayOfString) : ArrayOfQueryResultInfoset	34
-//    8.3.6 releaseData(objectUUIDs : ArrayOfUUID): void	35
 //    8.3.7 releaseModels(objectUUIDs : ArrayOfUUID): void
 
-  virtual ~ctkDicomExchangeInterface() {}
 };
 
 #endif // ctkDicomExchangeInterface_H

+ 69 - 0
Plugins/org.commontk.dicom.wg23.core/ctkDicomExchangeService.cpp

@@ -0,0 +1,69 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#include "ctkDicomExchangeService.h"
+
+#include "ctkDicomServicePrivate.h"
+
+#include "ctkDicomWG23TypesHelper.h"
+
+ctkDicomExchangeService::ctkDicomExchangeService(ushort port, QString path)
+ : d(new ctkDicomServicePrivate(port, path))
+{
+
+}
+ctkDicomExchangeService::~ctkDicomExchangeService()
+{
+    delete d;
+    d = NULL;
+}
+
+bool ctkDicomExchangeService::notifyDataAvailable(
+        ctkDicomWG23::AvailableData data, bool lastData){
+    //Q_D(ctkDicomService);
+    QList<QtSoapType*> list;
+    list << new ctkDicomSoapAvailableData("data", data);
+    list << new ctkDicomSoapBool("lastData", lastData);
+    const QtSoapType & result = d->askHost("notifyDataAvailable",list);
+    return ctkDicomSoapBool::getBool(result);
+}
+
+
+
+QList<ctkDicomWG23::ObjectLocator>* ctkDicomExchangeService::getData(
+        QList<QUuid> objectUUIDs,
+        QList<QString> acceptableTransferSyntaxUIDs, bool includeBulkData){
+
+    //Q_D(ctkDicomService);
+    QList<QtSoapType*> list;
+
+    list << new ctkDicomSoapArrayOfUUIDS("objectUUIDS",objectUUIDs);
+    list << new ctkDicomSoapArrayOfStringType("UID","acceptableTransferSyntaxUIDs", acceptableTransferSyntaxUIDs);
+    list << new ctkDicomSoapBool("includeBulkData", includeBulkData);
+    const QtSoapType & result = d->askHost("getData",list);
+    return ctkDicomSoapArrayOfObjectLocators::getArray(static_cast<const QtSoapArray &>(result));
+}
+
+void ctkDicomExchangeService::releaseData(QList<QUuid> objectUUIDs){
+
+}
+
+

+ 48 - 0
Plugins/org.commontk.dicom.wg23.core/ctkDicomExchangeService.h

@@ -0,0 +1,48 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+
+#ifndef CTKDICOMEXCHANGESERVICE_H
+#define CTKDICOMEXCHANGESERVICE_H
+
+#include <ctkDicomExchangeInterface.h>
+#include <QScopedPointer>
+#include <org_commontk_dicom_wg23_core_Export.h>
+
+class ctkDicomServicePrivate;
+
+class org_commontk_dicom_wg23_core_EXPORT ctkDicomExchangeService : public ctkDicomExchangeInterface
+{
+
+public:
+  ctkDicomExchangeService(ushort port, QString path);
+  ~ctkDicomExchangeService();
+
+  bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData);
+  QList<ctkDicomWG23::ObjectLocator> *getData(QList<QUuid> objectUUIDs,
+                                             QList<QString> acceptableTransferSyntaxUIDs, bool includeBulkData);
+  void releaseData(QList<QUuid> objectUUIDs);
+
+
+protected:
+  ctkDicomServicePrivate * d;
+};
+#endif // CTKDICOMEXCHANGESERVICE_H

+ 2 - 2
Plugins/org.commontk.dicom.wg23.core/ctkDicomHostInterface.h

@@ -31,7 +31,7 @@
 
 #include <org_commontk_dicom_wg23_core_Export.h>
 
-class org_commontk_dicom_wg23_core_EXPORT ctkDicomHostInterface : public ctkDicomExchangeInterface
+class org_commontk_dicom_wg23_core_EXPORT ctkDicomHostInterface: public ctkDicomExchangeInterface
 {
   Q_OBJECT
 
@@ -45,7 +45,7 @@ public:
   virtual void notifyStatus(const ctkDicomWG23::Status& status) = 0;
 
   // Data exchange interface methods
-  // ...
+  // inherited from ctkDicomExchangeInterface
 
 };
 

+ 15 - 4
Plugins/org.commontk.dicom.wg23.core/ctkDicomServicePrivate.cpp

@@ -43,7 +43,15 @@ void ctkDicomServicePrivate::responseReady()
   blockingLoop.exit();
 }
 
-const QtSoapType & ctkDicomServicePrivate::askHost(const QString& methodName, QtSoapType* soapType )
+const QtSoapType & ctkDicomServicePrivate::askHost(const QString& methodName,
+                                                   QtSoapType* soapType ){
+    QList<QtSoapType*> list;
+    list.append(soapType);
+    return askHost(methodName,list);
+}
+
+const QtSoapType & ctkDicomServicePrivate::askHost(const QString& methodName,
+                                                   const QList<QtSoapType*>& soapTypes )
 {
   QString action="\"";
   //action.append(methodName);
@@ -54,10 +62,13 @@ const QtSoapType & ctkDicomServicePrivate::askHost(const QString& methodName, Qt
 
   QtSoapMessage request;
   request.setMethod(QtSoapQName(methodName,"http://wg23.dicom.nema.org/"));
-  if( soapType != NULL )
+  if( !soapTypes.isEmpty())
   {
-    request.addMethodArgument(soapType);
-    qDebug() << "  Argument type is " << soapType->typeName() << ". Argument name is " << soapType->name().name();
+      for (QList<QtSoapType*>::ConstIterator it = soapTypes.begin();
+            it < soapTypes.constEnd(); it++){
+        request.addMethodArgument(*it);
+        qDebug() << "  Argument type added " << (*it)->typeName() << ". Argument name is " << (*it)->name().name();;
+    }
   }
   qDebug() << request.toXmlString();
 

+ 3 - 1
Plugins/org.commontk.dicom.wg23.core/ctkDicomServicePrivate.h

@@ -27,6 +27,7 @@
 #include <QEventLoop>
 #include <QtSoapHttpTransport>
 #include <org_commontk_dicom_wg23_core_Export.h>
+#include <ctkDicomExchangeInterface.h>
 
 class org_commontk_dicom_wg23_core_EXPORT ctkDicomServicePrivate : public QObject
 {
@@ -35,7 +36,8 @@ class org_commontk_dicom_wg23_core_EXPORT ctkDicomServicePrivate : public QObjec
 public:
   ctkDicomServicePrivate(int port, QString path);
 
-  const QtSoapType & askHost(const QString& methodName, QtSoapType* soapStruct);
+  const QtSoapType & askHost(const QString& methodName, const QList<QtSoapType*>& soapTypes);
+  const QtSoapType & askHost(const QString& methodName, QtSoapType* soapType);
     
   QEventLoop blockingLoop;
   QtSoapHttpTransport http;

+ 1 - 1
Plugins/org.commontk.dicom.wg23.core/ctkDicomWG23Types.h

@@ -64,7 +64,7 @@ namespace ctkDicomWG23 {
     QString URI;
   };
 
-  class ObjectDescriptor {
+  struct ObjectDescriptor {
     QUuid descriptorUUID;
     QString mimeType;
     QString classUID;

+ 329 - 3
Plugins/org.commontk.dicom.wg23.core/ctkDicomWG23TypesHelper.h

@@ -151,15 +151,16 @@ class ctkDicomSoapBool : public QtSoapSimpleType{
 };
 
 //Not easy to template, will see later for other types
-class ctkDicomSoapArrayOfString : public QtSoapArray{
+class ctkDicomSoapArrayOfStringType : public QtSoapArray{
     public:
-    ctkDicomSoapArrayOfString ( const QString & name, const QStringList array):
+    ctkDicomSoapArrayOfStringType ( const QString& typeName,
+                                const QString & name, const QStringList array):
             QtSoapArray ( QtSoapQName(name),QtSoapType::String,
                           array.size()){
 
         for (QStringList::ConstIterator it = array.constBegin();
                 it < array.constEnd(); it++){
-            this->append(new QtSoapSimpleType(QtSoapQName("string"),*it));
+            this->append(new QtSoapSimpleType(QtSoapQName(typeName),*it));
         }
     };
 
@@ -174,4 +175,329 @@ class ctkDicomSoapArrayOfString : public QtSoapArray{
 
 };
 
+class ctkDicomSoapArrayOfUUIDS : public QtSoapArray{
+    public:
+    ctkDicomSoapArrayOfUUIDS ( const QString & name, const QList<QUuid> &array):
+            QtSoapArray ( QtSoapQName(name),QtSoapType::String,
+                          array.size()){
+
+        for (QList<QUuid>::ConstIterator it = array.constBegin();
+                it < array.constEnd(); it++){
+            this->append(new QtSoapSimpleType(QtSoapQName("UUID"),(*it).toString()));
+        }
+    };
+
+    static QList<QUuid>* getArray(const QtSoapArray& array){
+        QList<QUuid> * list = new QList<QUuid>();
+        for (int i = 0; i < array.count() ; i++ ){
+            const QString str = array.at(i).value().toString();
+            list->append( QUuid(str));
+        }
+        return list;
+    };
+
+};
+
+class ctkDicomSoapObjectDescriptor : public QtSoapStruct{
+public:
+    ctkDicomSoapObjectDescriptor ( const QString & name,
+        const ctkDicomWG23::ObjectDescriptor& od ):
+    QtSoapStruct ( QtSoapQName(name) ){
+        this->insert(new QtSoapSimpleType(QtSoapQName("DescriptorUUID"),
+                od.descriptorUUID) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("MimeType"),
+                od.mimeType) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("ClassUID"),
+                od.classUID) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("TransferSyntaxUID"),
+                od.transferSyntaxUID) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("Modality"),
+                od.modality) );
+    };
+
+    static ctkDicomWG23::ObjectDescriptor getObjectDescriptor(const QtSoapType& type){
+         ctkDicomWG23::ObjectDescriptor od;
+
+         od.descriptorUUID = QUuid(type["DescriptorUUID"].value().toString());
+         od.mimeType =
+             type["MimeType"].value().toString();
+         od.classUID =
+             type["ClassUID"].value().toString();
+         od.transferSyntaxUID =
+             type["TransferSyntaxUID"].value().toString();
+         od.modality =
+             type["Modality"].value().toString();
+         return od;
+     };
+};
+
+class ctkDicomSoapSeries : public QtSoapStruct{
+    public:
+        ctkDicomSoapSeries ( const QString & name,
+            const ctkDicomWG23::Series& s ):
+        QtSoapStruct ( QtSoapQName(name) ){
+            this->insert(new QtSoapSimpleType(QtSoapQName("SeriesUID"),
+                    s.seriesUID) );
+        QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
+                          s.objectDescriptors.size());
+
+        for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = s.objectDescriptors.constBegin();
+                it < s.objectDescriptors.constEnd(); it++){
+            odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
+        }
+        this->insert(odescriptors);
+    };
+
+    static ctkDicomWG23::Series getSeries(const QtSoapType& type){
+         ctkDicomWG23::Series s;
+
+         s.seriesUID = type["SeriesUID"].value().toString();
+         QList<ctkDicomWG23::ObjectDescriptor> list;
+         const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
+         for (int i = 0; i < array.count() ; i++ ){
+             const ctkDicomWG23::ObjectDescriptor od =
+                     ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
+             list.append(od);
+         }
+         s.objectDescriptors = list;
+         return s;
+     };
+};
+
+
+
+class ctkDicomSoapStudy : public QtSoapStruct{
+    public:
+        ctkDicomSoapStudy ( const QString & name,
+            const ctkDicomWG23::Study& s ):
+        QtSoapStruct ( QtSoapQName(name) ){
+            this->insert(new QtSoapSimpleType(QtSoapQName("StudyUID"),
+                    s.studyUID) );
+        QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
+                          s.objectDescriptors.size());
+
+        for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = s.objectDescriptors.constBegin();
+                it < s.objectDescriptors.constEnd(); it++){
+            odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
+        }
+        this->insert(odescriptors);
+
+        QtSoapArray * series = new QtSoapArray( QtSoapQName("Series"),QtSoapType::Other,
+                          s.series.size());
+
+        for (QList<ctkDicomWG23::Series>::ConstIterator it = s.series.constBegin();
+                it < s.series.constEnd(); it++){
+            series->append(new ctkDicomSoapSeries("Series",*it));
+        }
+        this->insert(series);
+    };
+
+    static ctkDicomWG23::Study getStudy(const QtSoapType& type){
+         ctkDicomWG23::Study s;
+
+         s.studyUID = type["StudyUID"].value().toString();
+         QList<ctkDicomWG23::ObjectDescriptor> list;
+         const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
+         for (int i = 0; i < array.count() ; i++ ){
+             const ctkDicomWG23::ObjectDescriptor od =
+                     ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
+             list.append(od);
+         }
+         s.objectDescriptors = list;
+         QList<ctkDicomWG23::Series> listSeries;
+         const QtSoapArray& array2 = static_cast<const QtSoapArray&> (type["Series"]);
+         for (int i = 0; i < array2.count() ; i++ ){
+             const ctkDicomWG23::Series series =
+                     ctkDicomSoapSeries::getSeries(array2.at(i));
+             listSeries.append(series);
+         }
+         s.series = listSeries;
+
+         return s;
+     };
+};
+
+class ctkDicomSoapPatient : public QtSoapStruct{
+    public:
+        ctkDicomSoapPatient ( const QString & name,
+            const ctkDicomWG23::Patient& p ):
+        QtSoapStruct ( QtSoapQName(name) ){
+            this->insert(new QtSoapSimpleType(QtSoapQName("Name"),
+                    p.name) );
+            this->insert(new QtSoapSimpleType(QtSoapQName("ID"),
+                    p.id) );
+            this->insert(new QtSoapSimpleType(QtSoapQName("AssigningAuthority"),
+                    p.assigningAuthority) );
+            this->insert(new QtSoapSimpleType(QtSoapQName("Sex"),
+                    p.sex) );
+            this->insert(new QtSoapSimpleType(QtSoapQName("BirthDate"),
+                    p.birthDate) );
+            QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
+                          p.objectDescriptors.size());
+
+            for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = p.objectDescriptors.constBegin();
+                it < p.objectDescriptors.constEnd(); it++){
+                odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
+            }
+            this->insert(odescriptors);
+
+            QtSoapArray * study = new QtSoapArray( QtSoapQName("Studies"),QtSoapType::Other,
+                              p.studies.size());
+
+            for (QList<ctkDicomWG23::Study>::ConstIterator it = p.studies.constBegin();
+                it < p.studies.constEnd(); it++){
+                study->append(new ctkDicomSoapStudy("Study",*it));
+            }
+            this->insert(study);
+        };
+
+        static ctkDicomWG23::Patient getPatient(const QtSoapType& type){
+             ctkDicomWG23::Patient p;
+
+             p.name = type["Name"].value().toString();
+             p.id = type["ID"].value().toString();
+             p.assigningAuthority = type["AssigningAuthority"].value().toString();
+             p.sex = type["Sex"].value().toString();
+             p.birthDate = type["Birthdate"].value().toString();
+
+             QList<ctkDicomWG23::ObjectDescriptor> list;
+             const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
+             for (int i = 0; i < array.count() ; i++ ){
+                 const ctkDicomWG23::ObjectDescriptor od =
+                         ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
+                 list.append(od);
+             }
+
+             p.objectDescriptors = list;
+             QList<ctkDicomWG23::Study> listPatient;
+             const QtSoapArray& array2 = static_cast<const QtSoapArray&> (type["Studies"]);
+             for (int i = 0; i < array2.count() ; i++ ){
+                 const ctkDicomWG23::Study study =
+                         ctkDicomSoapStudy::getStudy(array2.at(i));
+                 listPatient.append(study);
+             }
+
+             p.studies = listPatient;
+             return p;
+        };
+};
+
+
+class ctkDicomSoapAvailableData :public QtSoapStruct {
+public:
+    ctkDicomSoapAvailableData ( const QString & name,
+            const ctkDicomWG23::AvailableData& ad ):
+       QtSoapStruct ( QtSoapQName(name) ){
+        QtSoapArray * odescriptors = new QtSoapArray( QtSoapQName("ObjectDescriptors"),QtSoapType::Other,
+                      ad.objectDescriptors.size());
+
+        for (QList<ctkDicomWG23::ObjectDescriptor>::ConstIterator it = ad.objectDescriptors.constBegin();
+            it < ad.objectDescriptors.constEnd(); it++){
+            odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
+        }
+        this->insert(odescriptors);
+
+        QtSoapArray * patient = new QtSoapArray( QtSoapQName("Patient"),QtSoapType::Other,
+                          ad.patients.size());
+
+        for (QList<ctkDicomWG23::Patient>::ConstIterator it = ad.patients.constBegin();
+            it < ad.patients.constEnd(); it++){
+            patient->append(new ctkDicomSoapPatient("Patient",*it));
+        }
+        this->insert(patient);
+    };
+   static ctkDicomWG23::AvailableData getAvailableData (const QtSoapType& type){
+        ctkDicomWG23::AvailableData ad;
+
+        QList<ctkDicomWG23::ObjectDescriptor> list;
+        const QtSoapArray& array = static_cast<const QtSoapArray&> (type["ObjectDescriptors"]);
+        for (int i = 0; i < array.count() ; i++ ){
+            const ctkDicomWG23::ObjectDescriptor od =
+                    ctkDicomSoapObjectDescriptor::getObjectDescriptor(array.at(i));
+            list.append(od);
+        }
+        ad.objectDescriptors = list;
+        QList<ctkDicomWG23::Patient> listPatients;
+        const QtSoapArray& array2 = static_cast<const QtSoapArray&> (type["Patients"]);
+        for (int i = 0; i < array2.count() ; i++ ){
+            const ctkDicomWG23::Patient patient =
+                    ctkDicomSoapPatient::getPatient(array2.at(i));
+            listPatients.append(patient);
+        }
+        ad.patients = listPatients;
+        return ad;
+   };
+};
+
+class ctkDicomSoapObjectLocator : public QtSoapStruct{
+public:
+    ctkDicomSoapObjectLocator ( const QString & name,
+        const ctkDicomWG23::ObjectLocator& ol ):
+    QtSoapStruct ( QtSoapQName(name) ){
+        this->insert(new QtSoapSimpleType(QtSoapQName("Locator"),
+                ol.locator) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("Source"),
+                ol.source) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("TransfertSyntax"),
+                ol.transferSyntax) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("Length"),
+                ol.length) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("Offset"),
+                ol.offset) );
+        this->insert(new QtSoapSimpleType(
+                QtSoapQName("URI"),
+                ol.URI) );
+    };
+
+    static ctkDicomWG23::ObjectLocator getObjectLocator(const QtSoapType& type){
+         ctkDicomWG23::ObjectLocator ol;
+
+         ol.locator = QUuid(type["Locator"].value().toString());
+         ol.source = QUuid(type["Source"].value().toString());
+         ol.transferSyntax =
+             type["TransferSyntax"].value().toString();
+         ol.length =
+             type["Length"].value().toInt();
+         ol.offset =
+             type["Offset"].value().toInt();
+         ol.URI =
+             type["URI"].value().toString();
+         return ol;
+     };
+};
+
+
+class ctkDicomSoapArrayOfObjectLocators : public QtSoapArray{
+    public:
+    ctkDicomSoapArrayOfObjectLocators ( const QString & name, const QList<ctkDicomWG23::ObjectLocator> &array):
+            QtSoapArray ( QtSoapQName(name),QtSoapType::String,
+                          array.size()){
+
+        for (QList<ctkDicomWG23::ObjectLocator>::ConstIterator it = array.constBegin();
+                it < array.constEnd(); it++){
+                    this->append(new ctkDicomSoapObjectLocator("objectLocator",(*it)));
+        }
+    };
+
+    static QList<ctkDicomWG23::ObjectLocator>* getArray(const QtSoapArray& array){
+        QList<ctkDicomWG23::ObjectLocator> * list = new QList<ctkDicomWG23::ObjectLocator>();
+
+        for (int i = 0; i < array.count() ; i++ ){
+            const ctkDicomWG23::ObjectLocator ol =
+                    ctkDicomSoapObjectLocator::getObjectLocator(array.at(i));
+            list->append(ol);
+        }
+        return list;
+    };
+
+};
+
 #endif

+ 108 - 0
Plugins/org.commontk.dicom.wg23.core/ctkExchangeSoapMessageProcessor.cpp

@@ -0,0 +1,108 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#include "ctkExchangeSoapMessageProcessor.h"
+
+#include <ctkDicomWG23TypesHelper.h>
+
+ctkExchangeSoapMessageProcessor::ctkExchangeSoapMessageProcessor(ctkDicomExchangeInterface* inter)
+: exchangeInterface(inter)
+{}
+
+bool ctkExchangeSoapMessageProcessor::process(
+	const QtSoapMessage& message,
+	QtSoapMessage* reply ) const
+{
+  // TODO check for NULL exchangeInterface?
+  
+  const QtSoapType& method = message.method();
+  QString methodName = method.name().name();
+
+  qDebug() << "ExchangeMessageProcessor: Received soap method request: " << methodName;
+
+  bool foundMethod = false;
+  
+  if (methodName == "notifyDataAvailable")
+  {
+    processNotifyDataAvailable(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "getData")
+  {
+    processGetData(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "releaseData")
+  {
+    processReleaseData(message, reply);
+    foundMethod = true;
+  }
+  
+  return foundMethod;
+}
+		
+void ctkExchangeSoapMessageProcessor::processNotifyDataAvailable(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["data"];
+  const ctkDicomWG23::AvailableData data = ctkDicomSoapAvailableData::getAvailableData(inputType);
+  const QtSoapType& inputType2 = message.method()["lastData"];
+  const bool lastData = ctkDicomSoapBool::getBool(inputType2);
+  // query interface
+  bool result = exchangeInterface->notifyDataAvailable(data, lastData);
+  // set reply message
+  reply->setMethod("notifyDataAvailable");
+  QtSoapType* resultType = new ctkDicomSoapBool("dataAvailable",result);
+  reply->addMethodArgument(resultType);
+}
+
+void ctkExchangeSoapMessageProcessor::processGetData(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["objectUUIDs"];
+  const QList<QUuid>* objectUUIDs = ctkDicomSoapArrayOfUUIDS::getArray(
+    dynamic_cast<const QtSoapArray&>(inputType));
+  const QtSoapType& inputType2 = message.method()["acceptableTransferSyntaxUIDs"];
+  const QStringList* acceptableTransferSyntaxUIDs = ctkDicomSoapArrayOfStringType::getArray(
+    dynamic_cast<const QtSoapArray&>(inputType2));
+  const QtSoapType& inputType3 = message.method()["includeBulkData"];
+  const bool includeBulkData = ctkDicomSoapBool::getBool(inputType3);
+  // query interface
+  const QList<ctkDicomWG23::ObjectLocator>* result = exchangeInterface->getData(
+    *objectUUIDs, *acceptableTransferSyntaxUIDs, includeBulkData);
+  // set reply message
+  reply->setMethod("getData");
+  QtSoapType* resultType = new ctkDicomSoapArrayOfObjectLocators("arrayOfObjectLocator", *result);
+  reply->addMethodArgument(resultType);
+}
+
+void ctkExchangeSoapMessageProcessor::processReleaseData(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["objectUUIDs"];
+  const QList<QUuid> objectUUIDs;
+  // query interface
+  exchangeInterface->releaseData(objectUUIDs);
+  // set reply message: nothing to be done
+}

+ 53 - 0
Plugins/org.commontk.dicom.wg23.core/ctkExchangeSoapMessageProcessor.h

@@ -0,0 +1,53 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#ifndef CTKEXCHANGESOAPMESSAGEPROCESSOR_H
+#define CTKEXCHANGESOAPMESSAGEPROCESSOR_H
+
+#include "ctkSoapMessageProcessor.h"
+#include "ctkDicomExchangeInterface.h"
+#include <org_commontk_dicom_wg23_core_Export.h>
+
+class org_commontk_dicom_wg23_core_EXPORT ctkExchangeSoapMessageProcessor : public ctkSoapMessageProcessor
+{
+
+public:
+
+  ctkExchangeSoapMessageProcessor( ctkDicomExchangeInterface* inter );
+
+  bool process(
+    const QtSoapMessage& message,
+    QtSoapMessage* reply) const;
+    
+private:
+
+  void processNotifyDataAvailable(const QtSoapMessage& message,
+                       QtSoapMessage* reply) const;
+  void processGetData(const QtSoapMessage& message,
+                       QtSoapMessage* reply) const;
+  void processReleaseData(const QtSoapMessage& message,
+                           QtSoapMessage* reply) const;
+               
+  ctkDicomExchangeInterface* exchangeInterface;
+
+};
+
+#endif // CTKEXCHANGESOAPMESSAGEPROCESSOR_H

+ 59 - 0
Plugins/org.commontk.dicom.wg23.core/ctkSoapMessageProcessor.h

@@ -0,0 +1,59 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#ifndef CTKSOAPMESSAGEPROCESSOR_H
+#define CTKSOAPMESSAGEPROCESSOR_H
+
+#include <qtsoap.h>
+
+#include <org_commontk_dicom_wg23_core_Export.h>
+
+class org_commontk_dicom_wg23_core_EXPORT ctkSoapMessageProcessor
+{
+
+public:
+
+	/**
+	* Process a Soap Message and set the input reply.
+	* @input message The message to process.
+	* @input reply The reply to the input message.
+	* @return True if the message could be processed.
+	*/
+	virtual bool process( 
+		const QtSoapMessage& message,
+    QtSoapMessage* reply) const
+  {
+    // to implement
+    return false;
+  }
+		
+	bool operator==( const ctkSoapMessageProcessor& rhs )
+	{
+		if( this == &rhs )
+		{
+			return true;
+		}
+		return false;
+	}
+
+};
+
+#endif // CTKSOAPMESSAGEPROCESSOR_H

+ 46 - 0
Plugins/org.commontk.dicom.wg23.core/ctkSoapMessageProcessorList.cpp

@@ -0,0 +1,46 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#include "ctkSoapMessageProcessorList.h"
+
+void ctkSoapMessageProcessorList::push_back( ctkSoapMessageProcessor* processor )
+{
+	processors.push_back( processor );
+}
+
+bool ctkSoapMessageProcessorList::process(
+	const QtSoapMessage& message,
+	QtSoapMessage* reply ) const
+{
+  for( std::list<ctkSoapMessageProcessor*>::const_iterator it = processors.begin(); 
+    it != processors.end(); it++)
+	{
+		if( (*it)->process( message, reply ) )
+		{
+			return true;
+		}
+	}
+	// if still here, no processor could process the message
+	reply->setFaultCode( QtSoapMessage::Server );
+    reply->setFaultString( "No processor found to process message." );
+	return false;
+}
+		

+ 47 - 0
Plugins/org.commontk.dicom.wg23.core/ctkSoapMessageProcessorList.h

@@ -0,0 +1,47 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#ifndef CTKSOAPMESSAGEPROCESSORLIST_H
+#define CTKSOAPMESSAGEPROCESSORLIST_H
+
+#include <list>
+#include "ctkSoapMessageProcessor.h"
+
+#include <org_commontk_dicom_wg23_core_Export.h>
+
+class org_commontk_dicom_wg23_core_EXPORT ctkSoapMessageProcessorList : public ctkSoapMessageProcessor
+{
+
+public:
+
+	void push_back( ctkSoapMessageProcessor* processor );
+
+	bool process(
+		const QtSoapMessage& message,
+		QtSoapMessage* reply) const;
+		
+private:
+
+	std::list<ctkSoapMessageProcessor*> processors;
+
+};
+
+#endif // CTKSOAPMESSAGEPROCESSORLIST_H

+ 1 - 0
Plugins/org.commontk.dicom.wg23.host/CMakeLists.txt

@@ -8,6 +8,7 @@ SET(PLUGIN_SRCS
   ctkDicomWG23HostPlugin.cpp
   ctkDicomAbstractHost.cpp
   ctkDicomAppService.cpp
+  ctkHostSoapMessageProcessor.cpp
 )
 
 # Files which should be processed by Qts moc

+ 26 - 6
Plugins/org.commontk.dicom.wg23.host/ctkDicomAppService.cpp

@@ -25,11 +25,11 @@
 
 #include "ctkDicomWG23TypesHelper.h"
 
-ctkDicomAppService::ctkDicomAppService(int port, QString path)
-  : d_ptr(new ctkDicomServicePrivate(port, path))
+ctkDicomAppService::ctkDicomAppService(ushort port, QString path):
+  service(port, path), d(new ctkDicomServicePrivate(port, path))
 {
-
 }
+
 ctkDicomAppService::~ctkDicomAppService()
 {
 }
@@ -37,14 +37,14 @@ ctkDicomAppService::~ctkDicomAppService()
 
 ctkDicomWG23::State ctkDicomAppService::getState()
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomService);
   const QtSoapType & result = d->askHost("getState", NULL);
   return ctkDicomSoapState::getState(result);
 }
 
 bool ctkDicomAppService::setState(ctkDicomWG23::State newState)
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomService);
   QtSoapType* input = new ctkDicomSoapState("newState", newState);
   const QtSoapType & result = d->askHost("setState", input);
   return ctkDicomSoapBool::getBool(result);
@@ -52,8 +52,28 @@ bool ctkDicomAppService::setState(ctkDicomWG23::State newState)
 
 bool ctkDicomAppService::bringToFront(const QRect& requestedScreenArea)
 {
-  Q_D(ctkDicomService);
+  //Q_D(ctkDicomService);
   QtSoapType* input = new ctkDicomSoapRectangle("requestedScreenArea", requestedScreenArea);
   const QtSoapType & result = d->askHost("bringToFront", input);
   return ctkDicomSoapBool::getBool(result);
 }
+
+// Exchange methods
+
+bool ctkDicomAppService::notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData)
+{
+  return service.notifyDataAvailable(data, lastData);
+}
+
+QList<ctkDicomWG23::ObjectLocator>* ctkDicomAppService::getData(
+  QList<QUuid> objectUUIDs, 
+  QList<QString> acceptableTransferSyntaxUIDs, 
+  bool includeBulkData)
+{
+  return service.getData(objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
+}
+
+void ctkDicomAppService::releaseData(QList<QUuid> objectUUIDs)
+{
+  service.releaseData(objectUUIDs);
+}

+ 15 - 9
Plugins/org.commontk.dicom.wg23.host/ctkDicomAppService.h

@@ -20,30 +20,36 @@
 =============================================================================*/
 
 
-#ifndef CTKDICOMHOSTSERVICE_H
-#define CTKDICOMHOSTSERVICE_H
+#ifndef CTKDICOMAPPSERVICE_H
+#define CTKDICOMAPPSERVICE_H
 
 #include <ctkDicomAppInterface.h>
-#include <QScopedPointer>
+#include <ctkDicomExchangeService.h>
 #include <org_commontk_dicom_wg23_host_Export.h>
 
-class ctkDicomServicePrivate;
-
 class org_commontk_dicom_wg23_host_EXPORT ctkDicomAppService : public ctkDicomAppInterface
 {
 
 public:
-  ctkDicomAppService(int port, QString path);
+  ctkDicomAppService(ushort port, QString path);
   ~ctkDicomAppService();
 
   ctkDicomWG23::State getState();
   bool setState(ctkDicomWG23::State newState);
   bool bringToFront(const QRect& requestedScreenArea);
 
+  // Exchange methods
+  bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData);
+  QList<ctkDicomWG23::ObjectLocator>* getData(
+    QList<QUuid> objectUUIDs, 
+    QList<QString> acceptableTransferSyntaxUIDs, 
+    bool includeBulkData);
+  void releaseData(QList<QUuid> objectUUIDs);
+
 private:
-  Q_DECLARE_PRIVATE(ctkDicomService)
+  ctkDicomServicePrivate * d;
 
-  const QScopedPointer<ctkDicomServicePrivate> d_ptr;
+  ctkDicomExchangeService service;
 };
 
-#endif // CTKDICOMHOSTSERVICE_H
+#endif // CTKDICOMAPPSERVICE_H

+ 10 - 82
Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.cpp

@@ -28,6 +28,10 @@
 #include <stdexcept>
 #include <ctkDicomWG23TypesHelper.h>
 
+#include <ctkExchangeSoapMessageProcessor.h>
+#include "ctkHostSoapMessageProcessor.h"
+
+
 ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port) :
     hostInterface(hostInterface), port(port)
 {
@@ -40,6 +44,11 @@ ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* host
   {
     qCritical() << "Listening to 127.0.0.1:" << port << " failed.";
   }
+
+  ctkHostSoapMessageProcessor* hostProcessor = new ctkHostSoapMessageProcessor( hostInterface );
+  processors.push_back(hostProcessor);
+  ctkExchangeSoapMessageProcessor* exchangeProcessor = new ctkExchangeSoapMessageProcessor( hostInterface );
+  processors.push_back(exchangeProcessor);
 }
 
 void ctkDicomHostServerPrivate::incomingWSDLMessage(
@@ -75,86 +84,5 @@ void ctkDicomHostServerPrivate::incomingWSDLMessage(
 void ctkDicomHostServerPrivate::incomingSoapMessage(
   const QtSoapMessage& message, QtSoapMessage* reply)
 {
-  const QtSoapType& method = message.method();
-  QString methodName = method.name().name();
-
-  qDebug() << "HostServer: Received soap method request: " << methodName;
-
-  if (methodName == "getAvailableScreen")
-  {
-    processGetAvailableScreen(message, reply);
-  }
-  else if (methodName == "notifyStateChanged")
-  {
-    processNotifyStateChanged(message, reply);
-  }
-  else if (methodName == "notifyStatus")
-  {
-    processNotifyStatus(message, reply);
-  }
-  else if (methodName == "generateUID")
-  {
-    processGenerateUID(message, reply);
-  }
-  else if (methodName == "getOutputLocation")
-  {
-    processGetOutputLocation(message, reply);
-  }
-  else
-  {
-    // error
-    reply->setFaultCode( QtSoapMessage::Server );
-    reply->setFaultString( "Unknown method." );
-  }
-}
-
-void ctkDicomHostServerPrivate::processGetAvailableScreen(
-    const QtSoapMessage &message, QtSoapMessage *reply) const
-{
-  const QtSoapType& preferredScreenType = message.method()["preferredScreen"];
-  const QRect preferredScreen = ctkDicomSoapRectangle::getQRect(preferredScreenType);
-
-  const QRect result = hostInterface->getAvailableScreen(preferredScreen);
-
-  reply->setMethod("getAvailableScreenResponse");
-  QtSoapStruct* availableScreenType = new ctkDicomSoapRectangle("availableScreen",result);
-  reply->addMethodArgument(availableScreenType);
-}
-
-void ctkDicomHostServerPrivate::processNotifyStateChanged(
-    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
-{
-  const QtSoapType& stateType = message.method()[0];//["state"]; java sends ["newState"];
-  hostInterface->notifyStateChanged(ctkDicomSoapState::getState(stateType));
-}
-
-void ctkDicomHostServerPrivate::processNotifyStatus(
-    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
-{
-  const QtSoapType& status = message.method()["status"];
-  hostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(status));
-}
-
-void ctkDicomHostServerPrivate::processGenerateUID(
-  const QtSoapMessage& message, QtSoapMessage* reply) const
-{
-  const QString uid = hostInterface->generateUID();
-
-  reply->setMethod("generateUID");
-  QtSoapType* type = new ctkDicomSoapUID("uid",uid);
-  reply->addMethodArgument(type);
-}
-
-void ctkDicomHostServerPrivate::processGetOutputLocation(
-  const QtSoapMessage& message, QtSoapMessage* reply) const
-{
-  const QtSoapType& inputType = message.method()["preferredProtocols"];
-  const QStringList* preferredProtocols = ctkDicomSoapArrayOfString::getArray(
-    dynamic_cast<const QtSoapArray&>(inputType));
-
-  const QString result = hostInterface->getOutputLocation(*preferredProtocols);
-
-  reply->setMethod("getOutputLocation");
-  QtSoapType* resultType = new QtSoapSimpleType ( QtSoapQName("preferredProtocols"), result );
-  reply->addMethodArgument(resultType);
+  processors.process(message, reply);
 }

+ 3 - 12
Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.h

@@ -19,7 +19,6 @@
 
 =============================================================================*/
 
-
 #ifndef CTKDICOMHOSTSERVERPRIVATE_H
 #define CTKDICOMHOSTSERVERPRIVATE_H
 
@@ -27,6 +26,7 @@
 #include <QtSoapMessage>
 
 #include <ctkSimpleSoapServer.h>
+#include <ctkSoapMessageProcessorList.h>
 
 class ctkDicomHostInterface;
 
@@ -38,7 +38,6 @@ public:
   ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port);
 
   ctkSimpleSoapServer server;
-  ctkDicomHostInterface* hostInterface;
   int port;
 
 public slots:
@@ -49,16 +48,8 @@ public slots:
 
 private:
 
-  void processGetAvailableScreen(const QtSoapMessage& message,
-                                 QtSoapMessage* reply) const;
-  void processNotifyStateChanged(const QtSoapMessage& message,
-                                 QtSoapMessage* reply) const;
-  void processNotifyStatus(const QtSoapMessage& message,
-                                 QtSoapMessage* reply) const;
-  void processGenerateUID(const QtSoapMessage& message,
-                                 QtSoapMessage* reply) const;
-  void processGetOutputLocation(const QtSoapMessage& message,
-                                 QtSoapMessage* reply) const;
+  ctkSoapMessageProcessorList processors;
+  ctkDicomHostInterface* hostInterface;
 
 };
 

+ 133 - 0
Plugins/org.commontk.dicom.wg23.host/ctkHostSoapMessageProcessor.cpp

@@ -0,0 +1,133 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#include "ctkHostSoapMessageProcessor.h"
+
+#include <ctkDicomWG23TypesHelper.h>
+#include "ctkPluginContext.h"
+#include "ctkDicomWG23HostPlugin_p.h"
+
+ctkHostSoapMessageProcessor::ctkHostSoapMessageProcessor( ctkDicomHostInterface* inter )
+: hostInterface(inter)
+{}
+
+bool ctkHostSoapMessageProcessor::process(
+	const QtSoapMessage& message,
+	QtSoapMessage* reply ) const
+{
+  // TODO check for NULL hostInterface?
+  
+  const QtSoapType& method = message.method();
+  QString methodName = method.name().name();
+
+  qDebug() << "HostMessageProcessor: Received soap method request: " << methodName;
+
+  bool foundMethod = false;
+  
+  if (methodName == "getAvailableScreen")
+  {
+    processGetAvailableScreen(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "notifyStateChanged")
+  {
+    processNotifyStateChanged(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "notifyStatus")
+  {
+    processNotifyStatus(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "generateUID")
+  {
+    processGenerateUID(message, reply);
+    foundMethod = true;
+  }
+  else if (methodName == "getOutputLocation")
+  {
+    processGetOutputLocation(message, reply);
+    foundMethod = true;
+  }
+  
+  return foundMethod;
+}
+		
+void ctkHostSoapMessageProcessor::processGetAvailableScreen(
+    const QtSoapMessage &message, QtSoapMessage *reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["preferredScreen"];
+  const QRect preferredScreen = ctkDicomSoapRectangle::getQRect(inputType);
+  // query interface
+  const QRect result = hostInterface->getAvailableScreen(preferredScreen);
+  // set reply message
+  reply->setMethod("getAvailableScreenResponse");
+  QtSoapStruct* returnType = new ctkDicomSoapRectangle("availableScreen",result);
+  reply->addMethodArgument(returnType);
+}
+
+void ctkHostSoapMessageProcessor::processNotifyStateChanged(
+    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()[0];//["state"]; java sends ["newState"]; FIX JAVA/STANDARD
+  // query interface
+  hostInterface->notifyStateChanged(ctkDicomSoapState::getState(inputType));
+  // set reply message: nothing to be done
+}
+
+void ctkHostSoapMessageProcessor::processNotifyStatus(
+    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["status"];
+  // query interface
+  hostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(inputType));
+  // set reply message: nothing to be done
+}
+
+void ctkHostSoapMessageProcessor::processGenerateUID(
+  const QtSoapMessage& message, QtSoapMessage* reply) const
+{
+  // extract arguments from input message: nothing to be done
+  // query interface
+  const QString uid = hostInterface->generateUID();
+  // set reply message
+  reply->setMethod("generateUID");
+  QtSoapType* resultType = new ctkDicomSoapUID("uid",uid);
+  reply->addMethodArgument(resultType);
+}
+
+void ctkHostSoapMessageProcessor::processGetOutputLocation(
+  const QtSoapMessage& message, QtSoapMessage* reply) const
+{
+  // extract arguments from input message
+  const QtSoapType& inputType = message.method()["preferredProtocols"];
+  const QStringList* preferredProtocols = ctkDicomSoapArrayOfStringType::getArray(
+    dynamic_cast<const QtSoapArray&>(inputType));
+  // query interface
+  const QString result = hostInterface->getOutputLocation(*preferredProtocols);
+  // set reply message
+  reply->setMethod("getOutputLocation");
+  QtSoapType* resultType = new QtSoapSimpleType( QtSoapQName("preferredProtocols"), result );
+  reply->addMethodArgument(resultType);
+}

+ 56 - 0
Plugins/org.commontk.dicom.wg23.host/ctkHostSoapMessageProcessor.h

@@ -0,0 +1,56 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) 2010 German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#ifndef ctkHostSoapMessageProcessor_H
+#define ctkHostSoapMessageProcessor_H
+
+#include "ctkSoapMessageProcessor.h"
+#include "ctkDicomHostInterface.h"
+
+class ctkHostSoapMessageProcessor : public ctkSoapMessageProcessor
+{
+
+public:
+
+  ctkHostSoapMessageProcessor( ctkDicomHostInterface* inter );
+
+  bool process(
+    const QtSoapMessage& message,
+    QtSoapMessage* reply) const;
+    
+private:
+
+  void processGetAvailableScreen(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
+  void processNotifyStateChanged(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
+  void processNotifyStatus(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
+  void processGenerateUID(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
+  void processGetOutputLocation(const QtSoapMessage& message,
+                                 QtSoapMessage* reply) const;
+               
+  ctkDicomHostInterface* hostInterface;
+
+};
+
+#endif // CTKSOAPMESSAGEPROCESSORLIST_H

+ 19 - 3
Plugins/org.commontk.example.dicomapp/ctkExampleDicomAppLogic.cpp

@@ -49,7 +49,7 @@ bool ctkExampleDicomAppLogic::setState(ctkDicomWG23::State newState)
   return true;
 }
 
-bool ctkExampleDicomAppLogic::bringToFront(const QRect& requestedScreenArea)
+bool ctkExampleDicomAppLogic::bringToFront(const QRect& /*requestedScreenArea*/)
 {
   return false;
 }
@@ -75,7 +75,7 @@ void ctkExampleDicomAppLogic::do_something()
 
 void ctkExampleDicomAppLogic::changeState(int anewstate)
 {
-  ctkDicomWG23::State newstate = (ctkDicomWG23::State)anewstate;
+  ctkDicomWG23::State newstate = static_cast<ctkDicomWG23::State>(anewstate);
   try
   {
     host->notifyStateChanged(newstate);
@@ -89,4 +89,20 @@ void ctkExampleDicomAppLogic::changeState(int anewstate)
   {
     do_something();
   }
-}
+}
+
+bool ctkExampleDicomAppLogic::notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData)
+{
+  return false;
+}
+
+QList<ctkDicomWG23::ObjectLocator>* ctkExampleDicomAppLogic::getData(
+  QList<QUuid> objectUUIDs, 
+  QList<QString> acceptableTransferSyntaxUIDs, 
+  bool includeBulkData)
+{
+  return NULL;
+}
+void ctkExampleDicomAppLogic::releaseData(QList<QUuid> objectUUIDs)
+{
+}

+ 6 - 0
Plugins/org.commontk.example.dicomapp/ctkExampleDicomAppLogic_p.h

@@ -70,6 +70,12 @@ public:
   bool bringToFront(const QRect& requestedScreenArea);
 
   // ctkDicomExchangeInterface
+  bool notifyDataAvailable(ctkDicomWG23::AvailableData data, bool lastData);
+  QList<ctkDicomWG23::ObjectLocator>* getData(
+    QList<QUuid> objectUUIDs, 
+    QList<QString> acceptableTransferSyntaxUIDs, 
+    bool includeBulkData);
+  void releaseData(QList<QUuid> objectUUIDs);
 
   // some logic
   void do_something();