Bladeren bron

Adapted to the newer version of WSDL.

Anthony Dass 14 jaren geleden
bovenliggende
commit
fa3fe3f93e
24 gewijzigde bestanden met toevoegingen van 377 en 175 verwijderingen
  1. 11 11
      Plugins/org.commontk.dah.app/ctkAppSoapMessageProcessor.cpp
  2. 4 0
      Plugins/org.commontk.dah.app/ctkDicomAbstractApp.cpp
  3. 2 2
      Plugins/org.commontk.dah.app/ctkDicomAppPlugin.cpp
  4. 11 10
      Plugins/org.commontk.dah.app/ctkDicomAppServer.cpp
  5. 2 1
      Plugins/org.commontk.dah.app/ctkDicomAppServer_p.h
  6. 7 7
      Plugins/org.commontk.dah.app/ctkDicomHostService.cpp
  7. 151 68
      Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.cpp
  8. 4 2
      Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.h
  9. 1 0
      Plugins/org.commontk.dah.core/ctkDicomAppInterface.h
  10. 71 4
      Plugins/org.commontk.dah.core/ctkDicomAvailableDataHelper.cpp
  11. 8 0
      Plugins/org.commontk.dah.core/ctkDicomAvailableDataHelper.h
  12. 6 6
      Plugins/org.commontk.dah.core/ctkDicomExchangeService.cpp
  13. 14 10
      Plugins/org.commontk.dah.core/ctkExchangeSoapMessageProcessor.cpp
  14. 7 2
      Plugins/org.commontk.dah.core/ctkSimpleSoapClient.cpp
  15. 12 6
      Plugins/org.commontk.dah.core/ctkSoapLog.h
  16. 1 1
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp
  17. 10 10
      Plugins/org.commontk.dah.host/ctkDicomAbstractHost.cpp
  18. 3 3
      Plugins/org.commontk.dah.host/ctkDicomAbstractHost.h
  19. 7 6
      Plugins/org.commontk.dah.host/ctkDicomAppService.cpp
  20. 2 2
      Plugins/org.commontk.dah.host/ctkDicomHostServer.cpp
  21. 1 1
      Plugins/org.commontk.dah.host/ctkDicomHostServer.h
  22. 9 8
      Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.cpp
  23. 2 1
      Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.h
  24. 31 14
      Plugins/org.commontk.dah.host/ctkHostSoapMessageProcessor.cpp

+ 11 - 11
Plugins/org.commontk.dah.app/ctkAppSoapMessageProcessor.cpp

@@ -41,17 +41,17 @@ bool ctkAppSoapMessageProcessor::process(
 
   bool foundMethod = false;
   
-  if (methodName == "getState")
+  if (methodName == "GetState")
     {
     processGetState(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "setState")
+  else if (methodName == "SetState")
     {
     processSetState(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "bringToFront")
+  else if (methodName == "BringToFront")
     {
     processBringToFront(message, reply);
     foundMethod = true;
@@ -70,8 +70,8 @@ void ctkAppSoapMessageProcessor::processGetState(
   // query interface
   const ctkDicomAppHosting::State result = this->AppInterface->getState();
   // set reply message
-  reply->setMethod("getState");
-  QtSoapSimpleType* resultType = new ctkDicomSoapState("getStateResponse",result);
+  reply->setMethod("GetStateResponse");
+  QtSoapSimpleType* resultType = new ctkDicomSoapState("GetStateResult",result);
   reply->addMethodArgument(resultType);
 }
 
@@ -80,12 +80,12 @@ void ctkAppSoapMessageProcessor::processSetState(
   const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
-  const QtSoapType& inputType = message.method()["newState"];
+  const QtSoapType& inputType = message.method()["state"];
   // query interface
   bool result = this->AppInterface->setState(ctkDicomSoapState::getState(inputType));
   // set reply message
-  reply->setMethod("setState");
-  QtSoapType* resultType = new ctkDicomSoapBool("setStateResponse",result);
+  reply->setMethod("SetStateResponse");
+  QtSoapType* resultType = new ctkDicomSoapBool("SetStateResult",result);
   reply->addMethodArgument(resultType);
 }
 
@@ -94,12 +94,12 @@ void ctkAppSoapMessageProcessor::processBringToFront(
   const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
-  const QtSoapType& inputType = message.method()["requestedScreenArea"];
+  const QtSoapType& inputType = message.method()["RequestedScreenArea"];
   const QRect requestedScreenArea = ctkDicomSoapRectangle::getQRect(inputType);
   // query interface
   bool result = this->AppInterface->bringToFront(requestedScreenArea);
   // set reply message
-  reply->setMethod("bringToFront");
-  QtSoapType* resultType = new ctkDicomSoapBool("bringToFrontResponse",result);
+  reply->setMethod("BringToFrontResponse");
+  QtSoapType* resultType = new ctkDicomSoapBool("BringToFrontResult",result);
   reply->addMethodArgument(resultType);
 }

+ 4 - 0
Plugins/org.commontk.dah.app/ctkDicomAbstractApp.cpp

@@ -74,6 +74,10 @@ bool ctkDicomAbstractApp::setState(ctkDicomAppHosting::State newState)
     if (d_ptr->currentState == ctkDicomAppHosting::COMPLETED)
     {
       emit releaseResources();
+	  //inform the host that now the app is idle
+	  getHostInterface()->notifyStateChanged(ctkDicomAppHosting::IDLE);
+	  //also change the internal state
+	  d_ptr->currentState = ctkDicomAppHosting::IDLE;
       result = true;
     }
     break;

+ 2 - 2
Plugins/org.commontk.dah.app/ctkDicomAppPlugin.cpp

@@ -68,10 +68,10 @@ void ctkDicomAppPlugin::start(ctkPluginContext* context)
     }
 
   // start the application server
-  this->AppServer = new ctkDicomAppServer(appURL.port());
+  this->AppServer = new ctkDicomAppServer(appURL.port(), appURL.path());
 
   // register the host service, providing callbacks to the hosting application
-  this->HostInterface = new ctkDicomHostService(QUrl(hostURL).port(), "/HostInterface");
+  this->HostInterface = new ctkDicomHostService(QUrl(hostURL).port(), hostURL.path());
   context->registerService<ctkDicomHostInterface>(HostInterface);
 }
 

+ 11 - 10
Plugins/org.commontk.dah.app/ctkDicomAppServer.cpp

@@ -37,8 +37,8 @@
 #include <stdexcept>
 
 //----------------------------------------------------------------------------
-ctkDicomAppServer::ctkDicomAppServer(int port)
-  : AppInterfaceRegistered(false), Port(port),
+ctkDicomAppServer::ctkDicomAppServer(int port, QString path)
+  : AppInterfaceRegistered(false), Port(port), Path(path),
     AppInterfaceTracker(ctkDicomAppPlugin::getPluginContext(), this)
 {
   this->AppInterfaceTracker.open();
@@ -65,30 +65,31 @@ void ctkDicomAppServer::incomingWSDLMessage(
   const QString& message, QString* reply)
 {
   if (message == "?wsdl")
-    {
-    QFile wsdlfile(":/dah/ApplicationService.wsdl");
+  {
+    QFile wsdlfile(":/dah/ApplicationService-20100825.wsdl");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
       {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
       QString actualURL="http://localhost:";
-      actualURL+=QString::number(Port)+"/ApplicationInterface"; // FIXME: has to be replaced by url provided by host
+      //actualURL+=QString::number(Port)+"/ApplicationInterface"; // FIXME: has to be replaced by url provided by host
+	  actualURL+=QString::number(Port)+Path; 
       reply->replace("REPLACE_WITH_ACTUAL_URL",actualURL);
-      reply->replace("ApplicationService_schema1.xsd",actualURL+"?xsd=1");
+      reply->replace("ApplicationService-20100825.xsd",actualURL+"?xsd=1");
       //reply->replace("<soap:body use=\"literal\"/>","<soap:body use=\"literal\"></soap:body>");
       }
-    }
+  }
   else if (message == "?xsd=1")
-    {
-    QFile wsdlfile(":/dah/HostService_schema1.xsd");
+  {
+    QFile wsdlfile(":/dah/HostService-20100825.xsd");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
       {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
       }
-    }
+  }
 }
 
 //----------------------------------------------------------------------------

+ 2 - 1
Plugins/org.commontk.dah.app/ctkDicomAppServer_p.h

@@ -45,7 +45,7 @@ class ctkDicomAppServer : public QObject, ctkServiceTrackerCustomizer<ctkDicomAp
   Q_OBJECT
 
 public:
-  ctkDicomAppServer(int port);
+  ctkDicomAppServer(int port, QString path);
   ~ctkDicomAppServer();
 public slots:
 
@@ -67,6 +67,7 @@ private:
   ctkSoapMessageProcessorList Processors;
   ctkSimpleSoapServer Server;
   int Port;
+  QString Path;
 
   ctkServiceTracker<ctkDicomAppInterface*> AppInterfaceTracker;
 };

+ 7 - 7
Plugins/org.commontk.dah.app/ctkDicomHostService.cpp

@@ -37,7 +37,7 @@ ctkDicomHostService::~ctkDicomHostService()
 //----------------------------------------------------------------------------
 QString ctkDicomHostService::generateUID()
 {
-  const QtSoapType& result = submitSoapRequest("generateUID", NULL);
+  const QtSoapType& result = submitSoapRequest("GenerateUID", NULL);
   QString resultUID = ctkDicomSoapUID::getUID(result);
   return resultUID;
 }
@@ -46,8 +46,8 @@ QString ctkDicomHostService::generateUID()
 QString ctkDicomHostService::getOutputLocation(const QStringList& preferredProtocols)
 {
   QtSoapStruct* input = dynamic_cast<QtSoapStruct*>(
-    new ctkDicomSoapArrayOfStringType("string","preferredProtocols", preferredProtocols));
-  const QtSoapType& result = submitSoapRequest("getOutputLocation", input);
+   new ctkDicomSoapArrayOfStringType("string","preferredProtocols", preferredProtocols));
+  const QtSoapType& result = submitSoapRequest("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)
 {
   QtSoapStruct* input = new ctkDicomSoapRectangle("preferredScreen", preferredScreen);
-  const QtSoapType& result = submitSoapRequest("getAvailableScreen", input);
+  const QtSoapType& result = submitSoapRequest("GetAvailableScreen", input);
   QRect resultRect = ctkDicomSoapRectangle::getQRect(result);
   qDebug() << "x:" << resultRect.x() << " y:" << resultRect.y();
   return resultRect;
@@ -65,8 +65,8 @@ QRect ctkDicomHostService::getAvailableScreen(const QRect& preferredScreen)
 //----------------------------------------------------------------------------
 void ctkDicomHostService::notifyStateChanged(ctkDicomAppHosting::State state)
 {
-  QtSoapType* input = new ctkDicomSoapState("newState", state); // spec would be "state", java has "newState" FIX JAVA/STANDARD
-  submitSoapRequest("notifyStateChanged", input);
+  QtSoapType* input = new ctkDicomSoapState("state", state); // spec would be "state", java has "newState" FIX JAVA/STANDARD
+  submitSoapRequest("NotifyStateChanged", input);
 }
 
 //----------------------------------------------------------------------------
@@ -74,7 +74,7 @@ void ctkDicomHostService::notifyStatus(const ctkDicomAppHosting::Status& status)
 {
   //Q_D(ctkDicomService);
   QtSoapStruct* input = new ctkDicomSoapStatus("status", status);
-  submitSoapRequest("notifyStatus", input);
+  submitSoapRequest("NotifyStatus", input);
 }
 
 //----------------------------------------------------------------------------

+ 151 - 68
Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.cpp

@@ -159,13 +159,24 @@ ctkDicomAppHosting::Status ctkDicomSoapStatus::getStatus(const QtSoapType& type)
 
 //----------------------------------------------------------------------------
 ctkDicomSoapUID::ctkDicomSoapUID(const QString& name, const QString& uid)
-  : QtSoapSimpleType(QtSoapQName(name), uid)
-{}
+  //: QtSoapSimpleType(QtSoapQName(name), uid)
+  : QtSoapStruct(QtSoapQName(name))
+{
+  this->insert(new QtSoapSimpleType(QtSoapQName("Uid"),uid));
+}
+
 
 //----------------------------------------------------------------------------
 QString ctkDicomSoapUID::getUID(const QtSoapType& type)
 {
-  return type.value().toString();
+  //return type.value().toString();
+  QString uid;
+  if(type.type()==QtSoapType::Struct)
+    uid = type[0].value().toString();
+  else
+    uid = type.value().toString();
+  return uid;
+
 }
 
 //----------------------------------------------------------------------------
@@ -185,12 +196,15 @@ ctkDicomSoapArrayOfStringType::ctkDicomSoapArrayOfStringType(const QString& type
 //  : QtSoapArray(QtSoapQName(name), QtSoapType::String, array.size())
   : QtSoapStruct(QtSoapQName(name))
 {
+	 QtSoapStruct *simpleStruct = new QtSoapStruct(QtSoapQName(typeName));
   for (QStringList::ConstIterator it = array.constBegin();
        it < array.constEnd(); it++)
     {
-    this->insert(new QtSoapSimpleType(QtSoapQName(typeName),*it));
+
+    simpleStruct->insert(new QtSoapSimpleType(QtSoapQName("Uid"),*it));
 //    this->append(new QtSoapSimpleType(QtSoapQName(typeName),*it));
     }
+  this->insert(simpleStruct);
 }
 
 //----------------------------------------------------------------------------
@@ -211,7 +225,7 @@ ctkDicomSoapUUID::ctkDicomSoapUUID(const QString& name, const QUuid& uuid)
 {
   QString uuidstring(uuid.toString());
   uuidstring.remove(0,1).chop(1);
-  this->insert(new QtSoapSimpleType(QtSoapQName("uuid"),uuidstring));
+  this->insert(new QtSoapSimpleType(QtSoapQName("Uuid"),uuidstring));
 }
 
 //----------------------------------------------------------------------------
@@ -235,7 +249,7 @@ ctkDicomSoapArrayOfUUIDS::ctkDicomSoapArrayOfUUIDS(const QString& name, const QL
     {
     QString uuidstring((*it).toString());
     uuidstring.remove(0,1).chop(1);
-    this->insert(new ctkDicomSoapUUID("uuid",uuidstring));
+    this->insert(new ctkDicomSoapUUID("UUID",uuidstring));
     }
 }
 
@@ -255,35 +269,69 @@ ctkDicomSoapObjectDescriptor::ctkDicomSoapObjectDescriptor(const QString& name,
                                                            const ctkDicomAppHosting::ObjectDescriptor& od)
   : QtSoapStruct(QtSoapQName(name))
 {
-  this->insert(new ctkDicomSoapUUID("uuid",
+  this->insert(new ctkDicomSoapUUID("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) );
+
+  /*this->insert(new QtSoapSimpleType(
+                 QtSoapQName("MimeType"),
+                 od.mimeType) );*/
+
+  /*QStringList mimeType;
+  mimeType.append(od.mimeType); 
+  this->insert(new ctkDicomSoapArrayOfStringType("MimeType",
+				"MimeType", 
+				mimeType) );*/
+
+	QtSoapStruct *stMimeType = new QtSoapStruct(QtSoapQName("MimeType"));
+	stMimeType->insert(new QtSoapSimpleType(QtSoapQName("Type"),od.mimeType));
+	this->insert(stMimeType);
+
+  /*this->insert(new QtSoapSimpleType(
+                 QtSoapQName("ClassUID"),
+                 od.classUID) );*/
+
+  this->insert(new ctkDicomSoapUID("ClassUID", od.classUID) );
+
+  /*this->insert(new QtSoapSimpleType(
+                 QtSoapQName("TransferSyntaxUID"),
+                 od.transferSyntaxUID) );*/
+  this->insert(new ctkDicomSoapUID("TransferSyntaxUID", od.transferSyntaxUID) );
+
+  /*this->insert(new QtSoapSimpleType(
+                 QtSoapQName("Modality"),
+                 od.modality) );*/
+	/*QStringList modality;
+	  modality.append(od.modality); 
+	  this->insert(new ctkDicomSoapArrayOfStringType("Modality",
+					"Modality", 
+					modality) );*/
+
+	QtSoapStruct *structModality = new QtSoapStruct(QtSoapQName("Modality"));
+	structModality->insert(new QtSoapSimpleType(QtSoapQName("Modality"),od.modality));
+	this->insert(structModality);
 }
 
 //----------------------------------------------------------------------------
 ctkDicomAppHosting::ObjectDescriptor ctkDicomSoapObjectDescriptor::getObjectDescriptor(const QtSoapType& type)
 {
   ctkDicomAppHosting::ObjectDescriptor od;
-  od.descriptorUUID = ctkDicomSoapUUID::getUuid(type["uuid"]);
-  od.mimeType =
-      type["mimeType"].value().toString();
-  od.classUID =
-      type["classUID"].value().toString();
-  od.transferSyntaxUID =
-      type["transferSyntaxUID"].value().toString();
+  od.descriptorUUID = ctkDicomSoapUUID::getUuid(type["DescriptorUuid"]);
+  od.mimeType = 
+      type["Type"].value().toString();
+  //const QStringList mimeType = ctkDicomSoapArrayOfStringType::getArray(type["MimeType"]);
+  //od.mimeType = mimeType[0];
+
+  /*od.classUID =
+      type["ClassUID"].value().toString();*/
+  od.classUID = 
+	  ctkDicomSoapUID::getUID(type["ClassUID"]);
+  /*od.transferSyntaxUID =
+      type["TransferSyntaxUID"].value().toString();*/
+  od.transferSyntaxUID = 
+	  ctkDicomSoapUID::getUID(type["TransferSyntaxUID"]);
+
   od.modality =
-      type["modality"].value().toString();
+      type["Modality"].value().toString();
   return od;
 }
 
@@ -315,11 +363,11 @@ ctkDicomAppHosting::ArrayOfObjectDescriptors ctkDicomSoapArrayOfObjectDescriptor
 {
   ctkDicomAppHosting::ArrayOfObjectDescriptors list;
   for (int i = 0; i < type.count() ; i++)
-    {
+  {
     const ctkDicomAppHosting::ObjectDescriptor od =
       ctkDicomSoapObjectDescriptor::getObjectDescriptor(type[i]);
     list.append(od);
-    }
+  }
   return list;
 }
 
@@ -328,15 +376,18 @@ ctkDicomSoapSeries::ctkDicomSoapSeries(const QString& name,
                                        const ctkDicomAppHosting::Series& s)
   : QtSoapStruct(QtSoapQName(name))
 {
-  this->insert(new QtSoapSimpleType(QtSoapQName("seriesUID"),
-                                    s.seriesUID) );
-  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("objectDescriptors"), QtSoapType::Other,
+  /*this->insert(new QtSoapSimpleType(QtSoapQName("SeriesUID"),
+                                    s.seriesUID) );*/
+
+  this->insert(new ctkDicomSoapUID("SeriesUID", s.seriesUID) );
+
+  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("ObjectDescriptors"), QtSoapType::Other,
                                               s.objectDescriptors.size());
 
   for (ctkDicomAppHosting::ArrayOfObjectDescriptors::ConstIterator it = s.objectDescriptors.constBegin();
        it < s.objectDescriptors.constEnd(); it++)
     {
-    odescriptors->append(new ctkDicomSoapObjectDescriptor("objectDescriptor",*it));
+    odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
     }
   this->insert(odescriptors);
 }
@@ -346,8 +397,9 @@ ctkDicomAppHosting::Series ctkDicomSoapSeries::getSeries(const QtSoapType& type)
 {
   ctkDicomAppHosting::Series s;
 
-  s.seriesUID = type["seriesUID"].value().toString();
-  s.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["objectDescriptors"]);
+  //s.seriesUID = type["SeriesUID"].value().toString();
+  s.seriesUID = ctkDicomSoapUID::getUID(type["SeriesUID"]);
+  s.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["ObjectDescriptors"]);
   return s;
 }
 
@@ -356,9 +408,10 @@ ctkDicomSoapStudy::ctkDicomSoapStudy(const QString& name,
                                      const ctkDicomAppHosting::Study& s)
   : QtSoapStruct(QtSoapQName(name))
 {
-  this->insert(new QtSoapSimpleType(QtSoapQName("StudyUID"),
-                                    s.studyUID) );
-  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("objectDescriptors"), QtSoapType::Other,
+  //this->insert(new QtSoapSimpleType(QtSoapQName("StudyUID"),s.studyUID) );
+  this->insert(new ctkDicomSoapUID("StudyUID", s.studyUID));
+
+  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("ObjectDescriptors"), QtSoapType::Other,
                                               s.objectDescriptors.size());
 
   for (ctkDicomAppHosting::ArrayOfObjectDescriptors::ConstIterator it = s.objectDescriptors.constBegin();
@@ -384,8 +437,10 @@ ctkDicomAppHosting::Study ctkDicomSoapStudy::getStudy(const QtSoapType& type)
 {
   ctkDicomAppHosting::Study s;
  
-  s.studyUID = type["StudyUID"].value().toString();
-  s.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["objectDescriptors"]);
+  //s.studyUID = type["StudyUID"].value().toString();
+  s.studyUID = ctkDicomSoapUID::getUID(type["StudyUID"]);
+
+  s.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["ObjectDescriptors"]);
 
   QList<ctkDicomAppHosting::Series> listSeries;
   const QtSoapType& seriesArray = type["Series"];
@@ -405,6 +460,7 @@ ctkDicomSoapPatient::ctkDicomSoapPatient(const QString& name,
                                          const ctkDicomAppHosting::Patient& p)
   : QtSoapStruct(QtSoapQName(name))
 {
+
   this->insert(new QtSoapSimpleType(QtSoapQName("Name"),
                                     p.name) );
   this->insert(new QtSoapSimpleType(QtSoapQName("ID"),
@@ -413,9 +469,9 @@ ctkDicomSoapPatient::ctkDicomSoapPatient(const QString& name,
                                     p.assigningAuthority) );
   this->insert(new QtSoapSimpleType(QtSoapQName("Sex"),
                                     p.sex) );
-  this->insert(new QtSoapSimpleType(QtSoapQName("BirthDate"),
+  this->insert(new QtSoapSimpleType(QtSoapQName("DateOfBirth"),
                                     p.birthDate) );
-  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("objectDescriptors"), QtSoapType::Other,
+  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("ObjectDescriptors"), QtSoapType::Other,
                                               p.objectDescriptors.size());
 
   for (ctkDicomAppHosting::ArrayOfObjectDescriptors::ConstIterator it = p.objectDescriptors.constBegin();
@@ -430,9 +486,9 @@ ctkDicomSoapPatient::ctkDicomSoapPatient(const QString& name,
 
   for (QList<ctkDicomAppHosting::Study>::ConstIterator it = p.studies.constBegin();
        it < p.studies.constEnd(); it++)
-    {
+  {
     study->append(new ctkDicomSoapStudy("Study",*it));
-    }
+  }
   this->insert(study);
 }
 
@@ -445,9 +501,9 @@ ctkDicomAppHosting::Patient ctkDicomSoapPatient::getPatient(const QtSoapType& ty
   p.id = type["ID"].value().toString();
   p.assigningAuthority = type["AssigningAuthority"].value().toString();
   p.sex = type["Sex"].value().toString();
-  p.birthDate = type["Birthdate"].value().toString();
+  p.birthDate = type["DateOfBirth"].value().toString();
 
-  p.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["objectDescriptors"]);
+  p.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["ObjectDescriptors"]);
 
   QList<ctkDicomAppHosting::Study> listPatient;
   const QtSoapType& studiesArray = type["Studies"];
@@ -466,25 +522,25 @@ ctkDicomSoapAvailableData::ctkDicomSoapAvailableData(const QString& name,
                                                      const ctkDicomAppHosting::AvailableData& ad)
   : QtSoapStruct(QtSoapQName(name))
 {
-  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("objectDescriptors"), QtSoapType::Other,
+  QtSoapArray* odescriptors = new QtSoapArray(QtSoapQName("ObjectDescriptors"), QtSoapType::Other,
                                               ad.objectDescriptors.size());
 
   for (ctkDicomAppHosting::ArrayOfObjectDescriptors::ConstIterator it = ad.objectDescriptors.constBegin();
        it < ad.objectDescriptors.constEnd(); it++)
     {
-    odescriptors->append(new ctkDicomSoapObjectDescriptor("objectDescriptor",*it));
+    odescriptors->append(new ctkDicomSoapObjectDescriptor("ObjectDescriptor",*it));
     }
   this->insert(odescriptors);
 
-  QtSoapArray* patient = new QtSoapArray(QtSoapQName("patients") ,QtSoapType::Other,
+  QtSoapArray* patients = new QtSoapArray(QtSoapQName("Patients") ,QtSoapType::Other,
                                          ad.patients.size());
 
   for (QList<ctkDicomAppHosting::Patient>::ConstIterator it = ad.patients.constBegin();
        it < ad.patients.constEnd(); it++)
-    {
-    patient->append(new ctkDicomSoapPatient("patient",*it));
-    }
-  this->insert(patient);
+  {
+	     patients->append(new ctkDicomSoapPatient("Patient",*it));
+  }
+  this->insert(patients);
 }
 
 //----------------------------------------------------------------------------
@@ -507,10 +563,10 @@ ctkDicomAppHosting::AvailableData ctkDicomSoapAvailableData::getAvailableData (c
   //  }
   //qDebug() << inputType.typeName() << "  " << inputType.name().name();
 
-  ad.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["objectDescriptors"]);
+  ad.objectDescriptors = ctkDicomSoapArrayOfObjectDescriptors::getArrayOfObjectDescriptors(type["ObjectDescriptors"]);
 
   QList<ctkDicomAppHosting::Patient> listPatients;
-  const QtSoapType& patientsArray = type["patients"];
+  const QtSoapType& patientsArray = type["Patients"];
   for (int i = 0; i < patientsArray.count() ; i++)
     {
       const ctkDicomAppHosting::Patient patient =
@@ -527,23 +583,38 @@ ctkDicomSoapObjectLocator::ctkDicomSoapObjectLocator(const QString& name,
                                                      const ctkDicomAppHosting::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("Locator"),
+                                    ol.locator) );*/
+
   this->insert(new QtSoapSimpleType(
                  QtSoapQName("Length"),
                  ol.length) );
+
   this->insert(new QtSoapSimpleType(
                  QtSoapQName("Offset"),
                  ol.offset) );
+
+  this->insert(new ctkDicomSoapUID("TransferSyntax", ol.transferSyntax) );
+  
   this->insert(new QtSoapSimpleType(
                  QtSoapQName("URI"),
                  ol.URI) );
+
+  this->insert(new ctkDicomSoapUUID("Locator",
+                                    ol.locator) );
+
+   this->insert(new ctkDicomSoapUUID("Source",
+                                    ol.source) );
+
+  /*this->insert(new QtSoapSimpleType(
+                 QtSoapQName("Source"),
+                 ol.source) );*/
+
+  /*this->insert(new QtSoapSimpleType(
+                 QtSoapQName("TransferSyntax"),
+                 ol.transferSyntax) );*/
+
+  
 }
 
 //----------------------------------------------------------------------------
@@ -551,16 +622,28 @@ ctkDicomAppHosting::ObjectLocator ctkDicomSoapObjectLocator::getObjectLocator(co
 {
   ctkDicomAppHosting::ObjectLocator ol;
 
-  ol.locator = type["Locator"].value().toString();
-  ol.source = type["Source"].value().toString();
-  ol.transferSyntax =
-      type["TransferSyntax"].value().toString();
   ol.length =
       type["Length"].value().toInt();
   ol.offset =
       type["Offset"].value().toInt();
+
+  //ol.transferSyntax =
+    //  type["TransferSyntax"].value().toString();
+  ol.transferSyntax = 
+	  ctkDicomSoapUID::getUID(type["TransferSyntax"]);
+
   ol.URI =
       type["URI"].value().toString();
+
+  //ol.locator = type["Locator"].value().toString();
+  ol.locator = ctkDicomSoapUUID::getUuid(type["Locator"]);
+
+  //ol.source = type["Source"].value().toString();
+  ol.source = ctkDicomSoapUUID::getUuid(type["Source"]);
+  //type["Source"].value().toString();
+
+ 
+
   return ol;
 }
 
@@ -572,7 +655,7 @@ ctkDicomSoapArrayOfObjectLocators::ctkDicomSoapArrayOfObjectLocators(
   for (QList<ctkDicomAppHosting::ObjectLocator>::ConstIterator it = array.constBegin();
        it < array.constEnd(); it++)
     {
-    this->append(new ctkDicomSoapObjectLocator("objectLocator",(*it)));
+    this->append(new ctkDicomSoapObjectLocator("ObjectLocator",(*it)));
     }
 }
 

+ 4 - 2
Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.h

@@ -61,11 +61,13 @@ struct org_commontk_dah_core_EXPORT ctkDicomSoapStatus : public QtSoapStruct
 };
 
 //----------------------------------------------------------------------------
-struct org_commontk_dah_core_EXPORT ctkDicomSoapUID : public QtSoapSimpleType
+//struct org_commontk_dah_core_EXPORT ctkDicomSoapUID : public QtSoapSimpleType
+struct org_commontk_dah_core_EXPORT ctkDicomSoapUID : public QtSoapStruct
 {
   ctkDicomSoapUID(const QString& name, const QString& uid);
 
-  static QString getUID(const QtSoapType& type);
+  //static QString getUID(const QtSoapType& type);
+  static QString getUID(const QtSoapType& array);
 };
 
 //----------------------------------------------------------------------------

+ 1 - 0
Plugins/org.commontk.dah.core/ctkDicomAppInterface.h

@@ -24,6 +24,7 @@
 #define CTKDICOMAPPINTERFACE_H
 
 #include "ctkDicomExchangeInterface.h"
+#include <ctkDicomAppHostingTypesHelper.h>
 
 struct ctkDicomAppInterface : public ctkDicomExchangeInterface
 {

+ 71 - 4
Plugins/org.commontk.dah.core/ctkDicomAvailableDataHelper.cpp

@@ -148,6 +148,62 @@ void ctkDicomAvailableDataAccessor::find(const ctkDicomAppHosting::Patient& pati
 }
 
 //----------------------------------------------------------------------------
+bool addNonDICOMToAvailableData(ctkDicomAppHosting::AvailableData& data, 
+                        ctkDicomObjectLocatorCache* objectLocatorCache, 
+                        long length, 
+                        long offset, 
+                        const QString& uri)
+{
+  if(objectLocatorCache == NULL)
+    return false;
+  
+  ctkDicomAppHosting::ObjectDescriptor objectDescriptor;
+  ctkDicomAppHosting::Study study;
+  ctkDicomAppHosting::Series series;
+  ctkDicomAppHosting::Patient patient;
+ 
+
+  QFileInfo fileinfo(uri);
+  QString ext = fileinfo.suffix();
+
+  QString uuid = QUuid::createUuid().toString();
+  objectDescriptor.descriptorUUID = uuid;
+  //objectDescriptor.mimeType = "text/plain";
+  objectDescriptor.classUID = "";
+  objectDescriptor.transferSyntaxUID = "";
+  objectDescriptor.modality = "";
+  
+  //the default mime type is set to plain text
+  if ( ext.compare("xml") == 0)
+	  objectDescriptor.mimeType = "text/xml";
+  else if ( ext.compare("txt") == 0)
+	  objectDescriptor.mimeType = "text/plain";
+  else if ( (ext.compare("jpg") == 0) || (ext.compare("jpeg") == 0))
+	  objectDescriptor.mimeType = "image/jpeg";
+  else if ( ext.compare("bmp") == 0)
+	  objectDescriptor.mimeType = "image/bmp";
+  else
+	   objectDescriptor.mimeType = "text/plain"; //default
+
+  ctkDicomAppHosting::Patient* ppatient;
+  ctkDicomAppHosting::Study* pstudy;
+  ctkDicomAppHosting::Series* pseries;
+
+  data.objectDescriptors.append(objectDescriptor);
+
+  ctkDicomAppHosting::ObjectLocator locator;
+  locator.locator = objectDescriptor.descriptorUUID;
+  locator.source = objectDescriptor.descriptorUUID;
+  locator.offset = offset;
+  locator.length = length;
+  locator.transferSyntax = objectDescriptor.transferSyntaxUID;
+  locator.URI = uri;
+
+  objectLocatorCache->insert(objectDescriptor.descriptorUUID, locator);
+  return true;
+}
+
+
 bool addToAvailableData(ctkDicomAppHosting::AvailableData& data, 
                         ctkDicomObjectLocatorCache* objectLocatorCache, 
                         const ctkDICOMDataset& dataset, 
@@ -157,12 +213,13 @@ bool addToAvailableData(ctkDicomAppHosting::AvailableData& data,
 {
   if(objectLocatorCache == NULL)
     return false;
+  
   ctkDicomAppHosting::ObjectDescriptor objectDescriptor;
   ctkDicomAppHosting::Study study;
   ctkDicomAppHosting::Series series;
   ctkDicomAppHosting::Patient patient;
   patient.name = dataset.GetElementAsString(DCM_PatientName);
-qDebug()<<"Patient:  " << patient.name;
+  qDebug()<<"Patient:  " << patient.name;
   patient.id = dataset.GetElementAsString(DCM_PatientID);
   patient.assigningAuthority = dataset.GetElementAsString(DCM_IssuerOfPatientID);
   patient.sex = dataset.GetElementAsString(DCM_PatientSex);
@@ -233,13 +290,23 @@ bool addToAvailableData(ctkDicomAppHosting::AvailableData& data,
 {
   QFileInfo fileinfo(filename);
   qDebug() << filename << " " << fileinfo.exists();
+  
+  
+  QString uri("file:///");
+  uri.append(fileinfo.absoluteFilePath());
 
+  //first check if its a non-DICOM file, if so add it first.
+  QString ext = fileinfo.suffix();
+  if ( (ext.compare("txt") == 0) || (ext.compare("xml") ==0) || (ext.compare("jpg") ==0) || (ext.compare("bmp") ==0) || (ext.compare("csv") ==0)|| (ext.compare("nii") ==0))
+  {
+  	  qDebug() << "adding Non DICOM File";
+      return addNonDICOMToAvailableData(data, objectLocatorCache, fileinfo.size(), 0, uri);
+  }
+  //this could be a DICOM file then
   ctkDICOMDataset ctkdataset;
   ctkdataset.InitializeFromFile(filename, EXS_Unknown, EGL_noChange, 400);
 
-  QString uri("file:/");
-  uri.append(fileinfo.absoluteFilePath());
   return addToAvailableData(data, objectLocatorCache, ctkdataset, fileinfo.size(), 0, uri);
-}
 
 }
+}

+ 8 - 0
Plugins/org.commontk.dah.core/ctkDicomAvailableDataHelper.h

@@ -79,4 +79,12 @@ bool org_commontk_dah_core_EXPORT addToAvailableData(ctkDicomAppHosting::Availab
 
 }
 
+//----------------------------------------------------------------------------
+bool org_commontk_dah_core_EXPORT addNonDICOMToAvailableData(ctkDicomAppHosting::AvailableData& data, 
+                        ctkDicomObjectLocatorCache* objectLocatorCache, 
+                        const ctkDICOMDataset& dataset, 
+                        long length, 
+                        long offset, 
+                        const QString& uri);
+
 #endif // CTKDICOMAVAILABLEDATAHELPER_H

+ 6 - 6
Plugins/org.commontk.dah.core/ctkDicomExchangeService.cpp

@@ -45,7 +45,7 @@ bool ctkDicomExchangeService::notifyDataAvailable(
   QList<QtSoapType*> list;
   list << new ctkDicomSoapAvailableData("data", data);
   list << new ctkDicomSoapBool("lastData", lastData);
-  const QtSoapType & result = submitSoapRequest("notifyDataAvailable",list);
+  const QtSoapType & result = submitSoapRequest("NotifyDataAvailable",list);
   return ctkDicomSoapBool::getBool(result);
 }
 
@@ -57,10 +57,10 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkDicomExchangeService::getData(
   //Q_D(ctkDicomService);
   QList<QtSoapType*> list;
 
-  list << new ctkDicomSoapArrayOfUUIDS("objectUUIDS",objectUUIDs);
-  list << new ctkDicomSoapArrayOfStringType("UID","acceptableTransferSyntaxUIDs", acceptableTransferSyntaxUIDs);
+  list << new ctkDicomSoapArrayOfUUIDS("objects",objectUUIDs);
+  list << new ctkDicomSoapArrayOfStringType("UID","acceptableTransferSyntaxes", acceptableTransferSyntaxUIDs);
   list << new ctkDicomSoapBool("includeBulkData", includeBulkData);
-  const QtSoapType & result = submitSoapRequest("getData",list);
+  const QtSoapType & result = submitSoapRequest("GetData",list);
 //QtSoapType *tt;
 //  list << (tt=new ctkDicomSoapArrayOfUUIDS("uuids",objectUUIDs));
 extern void DumpAll(const QtSoapType& type, int indent=0);
@@ -78,7 +78,7 @@ void ctkDicomExchangeService::releaseData(const QList<QUuid>& objectUUIDs)
 {
   QList<QtSoapType*> list;
 
-  list << new ctkDicomSoapArrayOfUUIDS("objectUUIDS",objectUUIDs);
-   submitSoapRequest("releaseData",list);
+  list << new ctkDicomSoapArrayOfUUIDS("objects",objectUUIDs);
+   submitSoapRequest("ReleaseData",list);
   return;
 }

+ 14 - 10
Plugins/org.commontk.dah.core/ctkExchangeSoapMessageProcessor.cpp

@@ -24,6 +24,9 @@
 
 #include <ctkDicomAppHostingTypesHelper.h>
 
+#include <QFile>
+#include <QTextStream>
+
 //----------------------------------------------------------------------------
 ctkExchangeSoapMessageProcessor::ctkExchangeSoapMessageProcessor(ctkDicomExchangeInterface* inter)
 : exchangeInterface(inter)
@@ -42,17 +45,17 @@ bool ctkExchangeSoapMessageProcessor::process(
 
   bool foundMethod = false;
 
-  if (methodName == "notifyDataAvailable")
+  if (methodName == "NotifyDataAvailable")
     {
     processNotifyDataAvailable(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "getData")
+  else if (methodName == "GetData")
     {
     processGetData(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "releaseData")
+  else if (methodName == "ReleaseData")
     {
     processReleaseData(message, reply);
     foundMethod = true;
@@ -80,8 +83,8 @@ void ctkExchangeSoapMessageProcessor::processNotifyDataAvailable(
   // query interface
   bool result = exchangeInterface->notifyDataAvailable(data, lastData);
   // set reply message
-  reply->setMethod("notifyDataAvailable");
-  QtSoapType* resultType = new ctkDicomSoapBool("dataAvailable",result);
+  reply->setMethod("NotifyDataAvailableResponse");
+  QtSoapType* resultType = new ctkDicomSoapBool("NotifyDataAvailableResult",result);
   reply->addMethodArgument(resultType);
 }
 
@@ -90,9 +93,9 @@ void ctkExchangeSoapMessageProcessor::processGetData(
     const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
-  const QtSoapType& inputType = message.method()["objectUUIDs"];
+  const QtSoapType& inputType = message.method()["objects"];
   const QList<QUuid> objectUUIDs = ctkDicomSoapArrayOfUUIDS::getArray(inputType);
-  const QtSoapType& inputType2 = message.method()["acceptableTransferSyntaxUIDs"];
+  const QtSoapType& inputType2 = message.method()["acceptableTransferSyntaxes"];
   const QStringList acceptableTransferSyntaxUIDs = ctkDicomSoapArrayOfStringType::getArray(inputType2);
   const QtSoapType& inputType3 = message.method()["includeBulkData"];
   const bool includeBulkData = ctkDicomSoapBool::getBool(inputType3);
@@ -100,8 +103,9 @@ void ctkExchangeSoapMessageProcessor::processGetData(
   const QList<ctkDicomAppHosting::ObjectLocator> result = exchangeInterface->getData(
     objectUUIDs, acceptableTransferSyntaxUIDs, includeBulkData);
   // set reply message
-  reply->setMethod("getData");
-  QtSoapType* resultType = new ctkDicomSoapArrayOfObjectLocators("arrayOfObjectLocator", result);
+  reply->setMethod(QtSoapQName("GetDataResponse","http://dicom.nema.org/PS3.19/ApplicationService-20100825"));
+  //reply->setMethod(QtSoapQName("GetDataResponse","http://dicom.nema.org/PS3.19/HostService-20100825"));
+  QtSoapType* resultType = new ctkDicomSoapArrayOfObjectLocators("GetDataResult", result);
   reply->addMethodArgument(resultType);
 }
 
@@ -110,7 +114,7 @@ void ctkExchangeSoapMessageProcessor::processReleaseData(
     const QtSoapMessage &message, QtSoapMessage * /*reply*/) const
 {
   // extract arguments from input message
-  const QtSoapType& inputType = message.method()["objectUUIDs"];
+  const QtSoapType& inputType = message.method()["objects"];
   const QList<QUuid> objectUUIDs = ctkDicomSoapArrayOfUUIDS::getArray(
     dynamic_cast<const QtSoapArray&>(inputType));
   // query interface

+ 7 - 2
Plugins/org.commontk.dah.core/ctkSimpleSoapClient.cpp

@@ -82,9 +82,12 @@ const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodN
 {
   Q_D(ctkSimpleSoapClient);
 
-  QString action="\"";
+  /*QString action="\"";
   //action.append(methodName);
   action.append("\"");
+  d->Http.setAction(action);*/
+  QString action = "http://dicom.nema.org/PS3.19/IHostService/" + methodName;
+
   d->Http.setAction(action);
 
   CTK_SOAP_LOG( << "Submitting action " << action
@@ -92,7 +95,8 @@ const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodN
                 << " to path " << d->Path );
 
   QtSoapMessage request;
-  request.setMethod(QtSoapQName(methodName,"http://wg23.dicom.nema.org/"));
+  //request.setMethod(QtSoapQName(methodName,"http://wg23.dicom.nema.org/"));
+  request.setMethod(QtSoapQName(methodName,"http://dicom.nema.org/PS3.19" + d->Path ));
   if(!soapTypes.isEmpty())
     {
     for (QList<QtSoapType*>::ConstIterator it = soapTypes.begin();
@@ -103,6 +107,7 @@ const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodN
                     << " Argument name is " << (*it)->name().name() );
       }
     }
+  CTK_SOAP_LOG_LOWLEVEL( << "Submitting request " << methodName);
   CTK_SOAP_LOG_LOWLEVEL( << request.toXmlString());
 
   d->Http.submitRequest(request, d->Path);;

+ 12 - 6
Plugins/org.commontk.dah.core/ctkSoapLog.h

@@ -22,13 +22,19 @@
 #ifndef CTKSOAPLOG_H
 #define CTKSOAPLOG_H
 
-//#define CTK_SOAP_LOG_LOWLEVEL(msg) qDebug() msg;
-#define CTK_SOAP_LOG_LOWLEVEL(msg)
+#define CTK_SOAP_LOG_LOWLEVEL(msg) qDebug() msg;
+//#define CTK_SOAP_LOG_LOWLEVEL(msg)
 
-//#define CTK_SOAP_LOG(msg) qDebug() msg;
-#define CTK_SOAP_LOG(msg)
+#define CTK_SOAP_LOG(msg) qDebug() msg;
+//#define CTK_SOAP_LOG(msg)
 
-//#define CTK_SOAP_LOG_HIGHLEVEL(msg) qDebug() msg;
-#define CTK_SOAP_LOG_HIGHLEVEL(msg)
+#define CTK_SOAP_LOG_HIGHLEVEL(msg) qDebug() msg;
+//#define CTK_SOAP_LOG_HIGHLEVEL(msg)
+
+//#define CTK_SOAP_LOG_REQUEST(msg) 
+#define CTK_SOAP_LOG_REQUEST(msg) qDebug() msg;
+
+#define CTK_SOAP_LOG_RECEPTION(msg) qDebug() msg;
+//#define CTK_SOAP_LOG_RECEPTION(msg)
 
 #endif // CTKSOAPLOG_H

+ 1 - 1
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -228,7 +228,7 @@ void ctkExampleDicomAppLogic::buttonClicked()
     qDebug() << "URI: " << locators.begin()->URI;
     QString filename = locators.begin()->URI;
     if(filename.startsWith("file:/",Qt::CaseInsensitive))
-      filename=filename.remove(0,6);
+      filename=filename.remove(0,8);
     qDebug()<<filename;
     DicomImage dcmtkImage(filename.toLatin1().data());
     ctkDICOMImage ctkImage(&dcmtkImage);

+ 10 - 10
Plugins/org.commontk.dah.host/ctkDicomAbstractHost.cpp

@@ -53,16 +53,16 @@ ctkDicomAbstractHostPrivate::ctkDicomAbstractHostPrivate(
 {
   // start server
   if (this->HostPort == 0)
-    {
+  {
     this->HostPort = 8080;
-    }
+  }
   if (this->AppPort == 0)
-    {
+  {
     this->AppPort = 8081;
-    }
+  }
 
-  this->Server = new ctkDicomHostServer(hostInterface,hostPort);
-  this->AppService = new ctkDicomAppService(appPort, "/ApplicationInterface");
+  this->Server = new ctkDicomHostServer(hostInterface, hostPort, "/HostService-20100825");
+  this->AppService = new ctkDicomAppService(appPort, "/ApplicationService-20100825"); //ApplicationInterface
 }
 
 //----------------------------------------------------------------------------
@@ -133,14 +133,14 @@ ctkDicomObjectLocatorCache* ctkDicomAbstractHost::objectLocatorCache()const
 bool ctkDicomAbstractHost::publishData(const ctkDicomAppHosting::AvailableData& availableData, bool lastData)
 {
   if (!this->objectLocatorCache()->isCached(availableData))
-    {
+  {
     return false;
-    }
+  }
   bool success = this->getDicomAppService()->notifyDataAvailable(availableData, lastData);
   if(!success)
-    {
+  {
     return false;
-    }
+  }
   return true;
 }
 

+ 3 - 3
Plugins/org.commontk.dah.host/ctkDicomAbstractHost.h

@@ -48,7 +48,7 @@ class org_commontk_dah_host_EXPORT ctkDicomAbstractHost : public QObject, public
 public:
 
   /**
-   * @brief Starts the soap sever on the specified port or choose port automatically.
+   * @brief Starts the soap server on the specified port or choose port automatically.
    *
    * @param hostPort
    * @param appPort
@@ -93,7 +93,7 @@ public:
    *
    * @return ctkDicomAppHosting::State
   */
-  ctkDicomAppHosting::State getApplicationState()const;
+  ctkDicomAppHosting::State getApplicationState() const;
 
   /**
    * @brief Gets the application service in order to call methods on the hosted app.
@@ -120,7 +120,7 @@ public:
    *
    * @return ctkDicomObjectLocatorCache *
   */
-  ctkDicomObjectLocatorCache* objectLocatorCache()const;
+  ctkDicomObjectLocatorCache* objectLocatorCache() const;
 
   /**
    * @brief

+ 7 - 6
Plugins/org.commontk.dah.host/ctkDicomAppService.cpp

@@ -39,24 +39,25 @@ ctkDicomAppService::~ctkDicomAppService()
 //----------------------------------------------------------------------------
 ctkDicomAppHosting::State ctkDicomAppService::getState()
 {
-  const QtSoapType & result = submitSoapRequest("getState", NULL);
+  const QtSoapType & result = submitSoapRequest("GetState", NULL);
   return ctkDicomSoapState::getState(result);
 }
 
 //----------------------------------------------------------------------------
 bool ctkDicomAppService::setState(ctkDicomAppHosting::State newState)
 {
-  QtSoapType* input = new ctkDicomSoapState("newState", newState);
-  const QtSoapType & result = submitSoapRequest("setState", input);
+  QtSoapType* input = new ctkDicomSoapState("state", newState);
+  const QtSoapType & result = submitSoapRequest("SetState", input);
   return ctkDicomSoapBool::getBool(result);
+
 }
 
 //----------------------------------------------------------------------------
 bool ctkDicomAppService::bringToFront(const QRect& requestedScreenArea)
 {
-  QtSoapType* input = new ctkDicomSoapRectangle("requestedScreenArea", requestedScreenArea);
-  const QtSoapType & result = submitSoapRequest("bringToFront", input);
-  return ctkDicomSoapBool::getBool(result);
+  QtSoapType* input = new ctkDicomSoapRectangle("RequestedScreenArea", requestedScreenArea);
+  const QtSoapType & result = submitSoapRequest("BringToFront", input);
+  return ctkDicomSoapBool::getBool(result);	
 }
 
 //----------------------------------------------------------------------------

+ 2 - 2
Plugins/org.commontk.dah.host/ctkDicomHostServer.cpp

@@ -24,8 +24,8 @@
 #include "ctkDicomHostServerPrivate.h"
 
 //----------------------------------------------------------------------------
-ctkDicomHostServer::ctkDicomHostServer(ctkDicomHostInterface* hostInterface, int port)
-  : d_ptr(new ctkDicomHostServerPrivate(hostInterface, port))
+ctkDicomHostServer::ctkDicomHostServer(ctkDicomHostInterface* hostInterface, int port, QString path)
+  : d_ptr(new ctkDicomHostServerPrivate(hostInterface, port, path))
 {
 
 }

+ 1 - 1
Plugins/org.commontk.dah.host/ctkDicomHostServer.h

@@ -35,7 +35,7 @@ class org_commontk_dah_host_EXPORT ctkDicomHostServer
 
 public:
 
-  ctkDicomHostServer(ctkDicomHostInterface* hostInterface, int port);
+  ctkDicomHostServer(ctkDicomHostInterface* hostInterface, int port, QString path);
   virtual ~ctkDicomHostServer();
 
 private:

+ 9 - 8
Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.cpp

@@ -34,8 +34,8 @@
 #include <stdexcept>
 
 //----------------------------------------------------------------------------
-ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port) :
-    Port(port), HostInterface(hostInterface)
+ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port, QString path) :
+    Port(port), Path(path), HostInterface(hostInterface)
 {
   connect(&this->Server, SIGNAL(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)),
           this, SLOT(incomingSoapMessage(QtSoapMessage,QtSoapMessage*)));
@@ -43,9 +43,9 @@ ctkDicomHostServerPrivate::ctkDicomHostServerPrivate(ctkDicomHostInterface* host
           this, SLOT(incomingWSDLMessage(QString,QString*)));
 
   if (!this->Server.listen(QHostAddress::LocalHost, this->Port))
-    {
+  {
     qCritical() << "Listening to 127.0.0.1:" << this->Port << " failed.";
-    }
+  }
 
   ctkHostSoapMessageProcessor* hostProcessor = new ctkHostSoapMessageProcessor( hostInterface );
   this->Processors.push_back(hostProcessor);
@@ -59,22 +59,23 @@ void ctkDicomHostServerPrivate::incomingWSDLMessage(
 {
   if (message == "?wsdl")
     {
-    QFile wsdlfile(":/dah/HostService.wsdl");
+    QFile wsdlfile(":/dah/HostService-20100825.wsdl");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
       {
       QTextStream textstream(&wsdlfile);
       *reply = textstream.readAll();
       QString actualURL="http://localhost:";
-      actualURL+=QString::number(this->Port)+"/HostInterface"; // FIXME: has to be replaced by url provided by host
+      //actualURL+=QString::number(this->Port)+"/HostInterface"; // FIXME: has to be replaced by url provided by host
+	  actualURL+=QString::number(this->Port)+Path; 
       reply->replace("REPLACE_WITH_ACTUAL_URL",actualURL);
-      reply->replace("HostService_schema1.xsd",actualURL+"?xsd=1");
+      reply->replace("HostService-20100825.xsd",actualURL+"?xsd=1");
       //reply->replace("<soap:body use=\"literal\"/>","<soap:body use=\"literal\"></soap:body>");
       }
     }
   else if (message == "?xsd=1")
     {
-    QFile wsdlfile(":/dah/HostService_schema1.xsd");
+    QFile wsdlfile(":/dah/HostService-20100825.xsd");
     wsdlfile.open(QFile::ReadOnly | QFile::Text);
     if(wsdlfile.isOpen())
       {

+ 2 - 1
Plugins/org.commontk.dah.host/ctkDicomHostServerPrivate.h

@@ -35,10 +35,11 @@ class ctkDicomHostServerPrivate : public QObject
   Q_OBJECT
 
 public:
-  ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port);
+  ctkDicomHostServerPrivate(ctkDicomHostInterface* hostInterface, int port, QString path);
 
   ctkSimpleSoapServer Server;
   int Port;
+  QString Path;
 
 public slots:
 

+ 31 - 14
Plugins/org.commontk.dah.host/ctkHostSoapMessageProcessor.cpp

@@ -41,27 +41,27 @@ bool ctkHostSoapMessageProcessor::process(
 
   bool foundMethod = false;
   
-  if (methodName == "getAvailableScreen")
+  if (methodName == "GetAvailableScreen")
     {
     processGetAvailableScreen(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "notifyStateChanged")
+  else if (methodName == "NotifyStateChanged")
     {
     processNotifyStateChanged(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "notifyStatus")
+  else if (methodName == "NotifyStatus")
     {
     processNotifyStatus(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "generateUID")
+  else if (methodName == "GenerateUID")
     {
     processGenerateUID(message, reply);
     foundMethod = true;
     }
-  else if (methodName == "getOutputLocation")
+  else if (methodName == "GetOutputLocation")
     {
     processGetOutputLocation(message, reply);
     foundMethod = true;
@@ -75,36 +75,48 @@ void ctkHostSoapMessageProcessor::processGetAvailableScreen(
     const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
-  const QtSoapType& inputType = message.method()["preferredScreen"];
+  const QtSoapType& inputType = message.method()["PreferredScreen"];
   const QRect preferredScreen = ctkDicomSoapRectangle::getQRect(inputType);
   // query interface
   const QRect result = this->HostInterface->getAvailableScreen(preferredScreen);
   // set reply message
-  reply->setMethod("getAvailableScreenResponse");
-  QtSoapStruct* returnType = new ctkDicomSoapRectangle("availableScreen",result);
+  reply->setMethod("GetAvailableScreenResponse");
+  QtSoapStruct* returnType = new ctkDicomSoapRectangle("AvailableScreen",result);
   reply->addMethodArgument(returnType);
 }
 
 //----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processNotifyStateChanged(
-    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
+    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
   this->HostInterface->notifyStateChanged(ctkDicomSoapState::getState(inputType));
   // set reply message: nothing to be done
+
+  /*bool result = true;
+  reply->setMethod("NotifyStateChanged");
+  QtSoapType* resultType = new ctkDicomSoapBool("NotifyStateChangedResponse",result);
+  reply->addMethodArgument(resultType);*/
+
 }
 
 //----------------------------------------------------------------------------
 void ctkHostSoapMessageProcessor::processNotifyStatus(
-    const QtSoapMessage &message, QtSoapMessage * /* reply */) const
+    const QtSoapMessage &message, QtSoapMessage *reply) const
 {
   // extract arguments from input message
   const QtSoapType& inputType = message.method()["status"];
   // query interface
   this->HostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(inputType));
   // set reply message: nothing to be done
+	
+  /*bool result = true;
+  reply->setMethod("NotifyStatus");
+  QtSoapType* resultType = new ctkDicomSoapBool("NotifyStatusResponse",result);
+  reply->addMethodArgument(resultType);*/
+
 }
 
 //----------------------------------------------------------------------------
@@ -116,7 +128,7 @@ void ctkHostSoapMessageProcessor::processGenerateUID(
   // query interface
   const QString uid = this->HostInterface->generateUID();
   // set reply message
-  reply->setMethod("generateUID");
+  reply->setMethod("GenerateUID");
   QtSoapType* resultType = new ctkDicomSoapUID("uid",uid);
   reply->addMethodArgument(resultType);
 }
@@ -126,13 +138,18 @@ 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));
+
   const QtSoapType& inputType = message.method()["preferredProtocols"];
-  const QStringList preferredProtocols = ctkDicomSoapArrayOfStringType::getArray(
-    dynamic_cast<const QtSoapArray&>(inputType));
+  const QStringList preferredProtocols = ctkDicomSoapArrayOfStringType::getArray(inputType);
+
+
   // query interface
   const QString result = this->HostInterface->getOutputLocation(preferredProtocols);
   // set reply message
-  reply->setMethod("getOutputLocation");
+  reply->setMethod("GetOutputLocation");
   QtSoapType* resultType = new QtSoapSimpleType( QtSoapQName("preferredProtocols"), result );
   reply->addMethodArgument(resultType);
 }