00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "rsApiHandler.h"
00017 #include "sdssImgCutoutMS.h"
00018 #include "sdssImgCutoutH.h"
00019 #include "sdssImgCutout.nsmap"
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 int
00062 msiSdssImgCutout_GetJpeg(msParam_t* inRaParam,
00063 msParam_t* inDecParam,
00064 msParam_t* inScaleParam,
00065 msParam_t* inWidthParam,
00066 msParam_t* inHeightParam,
00067 msParam_t* inOptParam,
00068 msParam_t* outImgParam,
00069 ruleExecInfo_t* rei )
00070 {
00071
00072 struct soap *soap = soap_new();
00073 struct _ns1__GetJpeg inValues;
00074 struct _ns1__GetJpegResponse outResponse;
00075
00076 char response [1000];
00077 int status;
00078 bytesBuf_t *dataBBuf = NULL;
00079
00080 RE_TEST_MACRO( " Calling msiSdssImgCutout_GetJpeg" );
00081
00082 inValues.ra_USCORE = atof((char *) inRaParam->inOutStruct);
00083 inValues.dec_USCORE = atof((char *) inDecParam->inOutStruct);
00084 inValues.scale_USCORE = atof((char *) inScaleParam->inOutStruct);
00085 inValues.width_USCORE = atoi((char *) inWidthParam->inOutStruct);
00086 inValues.height_USCORE = atoi((char *) inHeightParam->inOutStruct);
00087 inValues.opt_USCORE = (char *) inOptParam->inOutStruct;
00088
00089 soap_init(soap);
00090 soap_set_namespaces(soap, sdssImgCutout_namespaces);
00091 status = soap_call___ns2__GetJpeg(soap, NULL, NULL, &inValues, &outResponse);
00092
00093 if (status == SOAP_OK) {
00094 dataBBuf = (bytesBuf_t *) malloc (sizeof (bytesBuf_t));
00095 memset (dataBBuf, 0, sizeof (bytesBuf_t));
00096 dataBBuf->len = outResponse.GetJpegResult->__size;
00097 dataBBuf->buf = outResponse.GetJpegResult->__ptr;
00098 fillBufLenInMsParam (outImgParam,outResponse.GetJpegResult->__size, dataBBuf);
00099 return(0);
00100 }
00101 else {
00102 snprintf(response,999, "Error in execution of msiSdssImgCutout_GetJpeg::%s\n",soap->buf);
00103 fillMsParam( outImgParam, NULL,
00104 STR_MS_T, response, NULL );
00105 return(0);
00106 }
00107 }
00108