Changeset 297 for trunk/zoo-kernel/service_internal.c
- Timestamp:
- Aug 4, 2011, 2:16:11 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_internal.c
r296 r297 1534 1534 } 1535 1535 tmp=m->content; 1536 #ifdef USE_MS 1537 map* testMap=getMap(tmp,"requestedMimeType"); 1538 #endif 1536 1539 while(tmp!=NULL){ 1537 1540 if(strcasecmp(tmp->name,"mimeType")==0 || … … 1540 1543 strcasecmp(tmp->name,"datatype")==0 || 1541 1544 strcasecmp(tmp->name,"uom")==0) 1545 #ifdef USE_MS 1546 if(testMap==NULL || (testMap!=NULL && strncasecmp(testMap->value,"text/xml",8)==0)) 1547 #endif 1542 1548 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1549 #ifdef USE_MS 1550 if(strcasecmp(tmp->name,"mimeType")==0) 1551 if(testMap!=NULL) 1552 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST testMap->value); 1553 else 1554 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1555 #endif 1543 1556 tmp=tmp->next; 1544 1557 xmlAddChild(nc2,nc3); … … 1557 1570 else 1558 1571 tmp=NULL; 1572 #ifdef USE_MS 1573 /** 1574 * In case of OGC WebServices output use, as the data was requested 1575 * with asReference=false we have to download the resulting OWS request 1576 * stored in the Reference map value. 1577 */ 1578 map* testMap=getMap(m->content,"requestedMimeType"); 1579 if(testMap!=NULL){ 1580 HINTERNET hInternet; 1581 hInternet=InternetOpen( 1582 #ifndef WIN32 1583 (LPCTSTR) 1584 #endif 1585 "ZooWPSClient\0", 1586 INTERNET_OPEN_TYPE_PRECONFIG, 1587 NULL,NULL, 0); 1588 testMap=getMap(m->content,"Reference"); 1589 loadRemoteFile(m,m->content,hInternet,testMap->value); 1590 InternetCloseHandle(hInternet); 1591 } 1592 #endif 1559 1593 map* tmp1=getMap(m->content,"encoding"); 1560 1594 map* tmp2=getMap(m->content,"mimeType"); … … 1603 1637 } 1604 1638 else{ 1639 tmpMap=getMap(m->content,"Reference"); 1605 1640 nc3=nc2=xmlNewNode(ns_wps, BAD_CAST "Reference"); 1606 1641 if(strcasecmp(type,"Output")==0) … … 1609 1644 xmlNewNsProp(nc3,ns_xlink,BAD_CAST "href",BAD_CAST tmpMap->value); 1610 1645 tmp=m->content; 1646 #ifdef USE_MS 1647 map* testMap=getMap(tmp,"requestedMimeType"); 1648 #endif 1611 1649 while(tmp!=NULL){ 1612 1650 if(strcasecmp(tmp->name,"mimeType")==0 || … … 1615 1653 strcasecmp(tmp->name,"datatype")==0 || 1616 1654 strcasecmp(tmp->name,"uom")==0) 1655 #ifdef USE_MS 1656 if(testMap!=NULL && strncasecmp(testMap->value,"text/xml",8)!=0){ 1657 if(strcasecmp(tmp->name,"mimeType")==0) 1658 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST testMap->value); 1659 } 1660 else 1661 #endif 1617 1662 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1618 1663 tmp=tmp->next; … … 1784 1829 maps* tmpI=request_outputs; 1785 1830 while(tmpI!=NULL){ 1831 #ifdef USE_MS 1832 map* testMap=getMap(tmpI->content,"useMapserver"); 1833 #endif 1786 1834 toto=getMap(tmpI->content,"asReference"); 1835 #ifdef USE_MS 1836 if(toto!=NULL && strcasecmp(toto->value,"true")==0 && testMap==NULL){ 1837 #else 1787 1838 if(toto!=NULL && strcasecmp(toto->value,"true")==0){ 1839 #endif 1788 1840 elements* in=getElements(s->outputs,tmpI->name); 1789 1841 char *format=NULL; … … 1853 1905 free(file_url); 1854 1906 } 1907 #ifdef USE_MS 1908 else{ 1909 if(testMap!=NULL){ 1910 setReferenceUrl(m,tmpI); 1911 } 1912 } 1913 #endif 1855 1914 tmpI=tmpI->next; 1856 1915 } … … 2136 2195 tmpContent=tmpContent->next; 2137 2196 } 2197 #ifdef USE_MS 2198 /** 2199 * check for useMapServer presence 2200 */ 2201 map* tmpCheck=getMap(tmpIoType->content,"useMapServer"); 2202 if(tmpCheck!=NULL){ 2203 // Get the default value 2204 tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL); 2205 tmpCheck=getMap(tmpMaps->content,"mimeType"); 2206 addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value); 2207 map* cursor=tmpIoType->content; 2208 while(cursor!=NULL){ 2209 addToMap(tmpMaps->content,cursor->name,cursor->value); 2210 cursor=cursor->next; 2211 } 2212 2213 cursor=tmpInputs->content; 2214 while(cursor!=NULL){ 2215 if(strcasecmp(cursor->name,"Title")==0 || 2216 strcasecmp(cursor->name,"Abstract")==0) 2217 addToMap(tmpMaps->content,cursor->name,cursor->value); 2218 cursor=cursor->next; 2219 } 2220 } 2221 #endif 2138 2222 } 2139 2223 if(tmpMaps->content==NULL)
Note: See TracChangeset
for help on using the changeset viewer.