Bladeren bron

ENH: implemented missing server methods.

Yves 14 jaren geleden
bovenliggende
commit
04e5f26e2b
1 gewijzigde bestanden met toevoegingen van 14 en 4 verwijderingen
  1. 14 4
      Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.cpp

+ 14 - 4
Plugins/org.commontk.dicom.wg23.host/ctkDicomHostServerPrivate.cpp

@@ -106,13 +106,23 @@ void ctkDicomHostServerPrivate::processNotifyStatus(
 void ctkDicomHostServerPrivate::processGenerateUID(
   const QtSoapMessage& message, QtSoapMessage* reply) const
 {
-  Q_UNUSED(message)
-  Q_UNUSED(reply)
+  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
 {
-  Q_UNUSED(message)
-  Q_UNUSED(reply)
+  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);
 }