better separation of PS and IS soaps (still not nice)
authorMiloš Mulač <mulac@civ.zcu.cz>
Tue, 4 Oct 2005 15:01:08 +0000 (15:01 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Tue, 4 Oct 2005 15:01:08 +0000 (15:01 +0000)
org.glite.jp.index/Makefile
org.glite.jp.index/src/soap_ops.c
org.glite.jp.index/src/soap_ps_calls.c
org.glite.jp.index/src/ws_is_typeref.c
org.glite.jp.index/src/ws_ps_typeref.c [moved from org.glite.jp.index/src/ws_typeref.c with 99% similarity]
org.glite.jp.index/src/ws_ps_typeref.h [moved from org.glite.jp.index/src/ws_typeref.h with 100% similarity]

index ff410f7..78e3d53 100644 (file)
@@ -47,7 +47,8 @@ example:=jpis-test
 is_prefix:=jpis_
 ps_prefix:=jpps_
 
-SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c ws_typeref.c db_ops.c\
+SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c \
+       ws_ps_typeref.c ws_is_typeref.c db_ops.c \
        ${is_prefix}ServerLib.c \
        ${ps_prefix}ClientLib.c ${ps_prefix}C.c \
 
index 9d6f407..bf4da3c 100644 (file)
@@ -9,7 +9,10 @@
 #include "jpis_.nsmap"
 #include "soap_version.h"
 #include "db_ops.h"
-#include "ws_typeref.h"
+// XXX: avoid 2 wsdl collisions - work only because ws_ps_typeref.h 
+// uses common types from jpis_H.h (awful)
+#include "ws_ps_typeref.h"
+#include "ws_is_typeref.h"
 
 
 
index dc61eb0..b6ca2b5 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "conf.h"
 #include "db_ops.h"
-#include "ws_typeref.h"
+#include "ws_ps_typeref.h"
 
 #include "stdsoap2.h"
 
index da4ed16..866ed20 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "jpis_H.h"
 #include "ws_typemap.h"
-#include "ws_typeref.h"
+#include "ws_ps_typeref.h"
 
 
 static void SoapToQueryOp(const enum jptype__queryOp in, glite_jp_queryop_t *out)
@@ -26,10 +26,17 @@ static void SoapToQueryOp(const enum jptype__queryOp in, glite_jp_queryop_t *out
 
 static void SoapToAttrOrig(struct soap *soap, const enum jptype__attrOrig *in, glite_jp_attr_orig_t *out)
 {
+       assert(out);
 
-        switch ( in )
+       // XXX: shlouldn't be ANY in WSDL??
+       if (!in) {
+               *out = GLITE_JP_ATTR_ORIG_ANY;
+               return;
+       }
+
+        switch ( *in )
         {
-        case NULL: *out = GLITE_JP_ATTR_ORIG_ANY; break;
+//        case NULL: *out = GLITE_JP_ATTR_ORIG_ANY; break;
         case SYSTEM: *out = GLITE_JP_ATTR_ORIG_SYSTEM; break;
         case USER: *out = GLITE_JP_ATTR_ORIG_USER; break;
         case FILE_: *out = GLITE_JP_ATTR_ORIG_FILE; break;
@@ -46,17 +53,17 @@ static int SoapToQueryRecordVal(
 {
        
         assert(in);
-       if (value->string) {
+       if (in->string) {
                *binary = 0;
                *size = 0;
-               *value = strdup(value->string);
+               *value = strdup(in->string);
 
                return 0;
        }
-       else if (value->blob) {
+       else if (in->blob) {
                *binary = 1;
-               *size = value->blob->__size;
-               memcpy(*value, value->blob->__ptr, value->blob->__size);
+               *size = in->blob->__size;
+               memcpy(*value, in->blob->__ptr, in->blob->__size);
                // XXX how to handle id, type, option?
 
                return 0;
@@ -85,21 +92,21 @@ int glite_jpis_SoapToQueryCond(
        assert(in); assert(out);
        qr = calloc(in->__sizerecord, sizeof(*qr));     
 
-       for (i=0; i < __sizerecord; i++) {
+       for (i=0; i < in->__sizerecord; i++) {
                qr[i].attr = strdup(in->attr);
-               SoapToQueryOpTo(in->record[i]->op, &(qr[i].op));
+               SoapToQueryOp(in->record[i]->op, &(qr[i].op));
 
                switch (qr[i].op) {
                case GLITE_JP_QUERYOP_EXISTS:
                        break;
 
                case GLITE_JP_QUERYOP_WITHIN:
-                       SoapToQueryRecordVal(in->record[i]->value2, *(qr[i].binary), 
-                               *(qr[i].size2), *(qr[i].value2));
+                       SoapToQueryRecordVal(soap, in->record[i]->value2, &(qr[i].binary), 
+                               &(qr[i].size2), &(qr[i].value2));
                        // fall through
                default:
-                       SoapToQueryRecordVal(in->record[i]->value, *(qr[i].binary), 
-                               *(qr[i].size),  *(qr[i].value));
+                       SoapToQueryRecordVal(soap, in->record[i]->value, &(qr[i].binary), 
+                               &(qr[i].size),  &(qr[i].value));
                        break;
                }
                
similarity index 99%
rename from org.glite.jp.index/src/ws_typeref.c
rename to org.glite.jp.index/src/ws_ps_typeref.c
index 4924ee6..0c1f926 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "jpps_H.h"
 #include "ws_typemap.h"
-#include "ws_typeref.h"
+#include "ws_ps_typeref.h"
 
 
 static void QueryOpToSoap(const glite_jp_queryop_t in, enum jptype__queryOp *out)