Changeset 481 for trunk


Ignore:
Timestamp:
May 29, 2014, 8:16:48 PM (10 years ago)
Author:
djay
Message:

Fix ExceptionReport? nodes

Location:
trunk/zoo-project/zoo-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r478 r481  
    20922092  int nsid=zooXmlAddNs(NULL,"http://www.opengis.net/ows","ows");
    20932093  ns=usedNs[nsid];
     2094  if(use_ns==1){
     2095    ns=NULL;
     2096  }
    20942097  n = xmlNewNode(ns, BAD_CAST "ExceptionReport");
    2095 
    20962098  if(use_ns==1){
    2097     ns_ows=xmlNewNs(n,BAD_CAST "http://www.opengis.net/ows/1.1.0",BAD_CAST "ows");
     2099    ns_ows=xmlNewNs(n,BAD_CAST "http://www.opengis.net/ows/1.1",NULL);
    20982100    int xsiId=zooXmlAddNs(n,"http://www.w3.org/2001/XMLSchema-instance","xsi");
    20992101    ns_xsi=usedNs[xsiId];
    2100     ns_xsi=xmlNewNs(n,BAD_CAST "http://www.w3.org/2001/XMLSchema-instance",BAD_CAST "xsi");
    21012102    xmlNewNsProp(n,ns_xsi,BAD_CAST "schemaLocation",BAD_CAST "http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd");
    2102     int xlinkId=zooXmlAddNs(n,"http://www.w3.org/1999/xlink","xlink");
    2103     ns_xlink=usedNs[xlinkId];
    2104   }
     2103  }
     2104
     2105
    21052106  addLangAttr(n,m);
    21062107  xmlNewProp(n,BAD_CAST "version",BAD_CAST "1.1.0");
     
    21942195  }
    21952196 
    2196   if(res==SERVICE_FAILED){
    2197     map * errormap;
    2198     map *lenv;
    2199     lenv=getMapFromMaps(m,"lenv","message");
    2200     char *tmp0;
    2201     if(lenv!=NULL){
    2202       tmp0=(char*)malloc((strlen(lenv->value)+strlen(_("Unable to run the Service. The message returned back by the Service was the following: "))+1)*sizeof(char));
    2203       sprintf(tmp0,_("Unable to run the Service. The message returned back by the Service was the following: %s"),lenv->value);
    2204     }
    2205     else{
    2206       tmp0=(char*)malloc((strlen(_("Unable to run the Service. No more information was returned back by the Service."))+1)*sizeof(char));
    2207       sprintf(tmp0,_("Unable to run the Service. No more information was returned back by the Service."));
    2208     }
    2209     errormap = createMap("text",tmp0);
    2210     free(tmp0);
    2211     addToMap(errormap,"code", "InternalError");
    2212     printExceptionReportResponse(m,errormap);
    2213     freeMap(&errormap);
    2214     free(errormap);
    2215     return;
    2216   }
    22172197
    22182198  if(asRaw==0){
     
    23422322    }
    23432323    else{
     2324      if(res==SERVICE_FAILED){
     2325        map * errormap;
     2326        map *lenv;
     2327        lenv=getMapFromMaps(m,"lenv","message");
     2328        char *tmp0;
     2329        if(lenv!=NULL){
     2330          tmp0=(char*)malloc((strlen(lenv->value)+strlen(_("Unable to run the Service. The message returned back by the Service was the following: "))+1)*sizeof(char));
     2331          sprintf(tmp0,_("Unable to run the Service. The message returned back by the Service was the following: %s"),lenv->value);
     2332        }
     2333        else{
     2334          tmp0=(char*)malloc((strlen(_("Unable to run the Service. No more information was returned back by the Service."))+1)*sizeof(char));
     2335          sprintf(tmp0,_("Unable to run the Service. No more information was returned back by the Service."));
     2336        }
     2337        errormap = createMap("text",tmp0);
     2338        free(tmp0);
     2339        addToMap(errormap,"code", "InternalError");
     2340        printExceptionReportResponse(m,errormap);
     2341        freeMap(&errormap);
     2342        free(errormap);
     2343        return;
     2344      }
    23442345      /**
    23452346       * We get the requested output or fallback to the first one if the
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r478 r481  
    791791    freeMaps(&m);
    792792    free(m);
    793     if(request_inputs!=NULL){
    794       freeMap(&request_inputs);
    795       free(request_inputs);
    796     }
    797793    return 1;
    798794  }
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png