axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yampolsky, Robert" <ryamp...@harris.com>
Subject RE: Newbie questions and some weird behavior
Date Fri, 06 May 2005 14:36:29 GMT
>One thing to figure out is to know whether the error is in generated
>code or in the user written code. Will have to generate the code and
>see.

Okay.  There's not much code, though.  This is a trivial test of the
service, and all it does is print out the input to a log file, copy back
the input params as outputs and log them.  The logged stuff looks ok:

Here's the code:

void HUB_TO_HUB::Hub_Request(xsd__string Value0, xsd__string Value1,
xsd__string Value2, xsd__string Value3, xsd__string Value4, xsd__string
Value5, xsd__string Value6, xsd__string Value7, AXIS_OUT_PARAM
xsd__string *OutValue0, AXIS_OUT_PARAM xsd__string *OutValue1,
AXIS_OUT_PARAM xsd__string *OutValue2, AXIS_OUT_PARAM xsd__string
*OutValue3, AXIS_OUT_PARAM xsd__string *OutValue4, AXIS_OUT_PARAM
xsd__string *OutValue5)
{
char    timestamp[100];
time_t  clock;
struct  tm *tm;
FILE    *file;

        file = fopen("/home/rob/hub2hub/server/log", "w+");
        fprintf(file, "Input:\n"
                      "  TO_TP=%s\n"
                      "  FROM_TP=%s\n"
                      "  TO_HUB=%s\n"
                      "  FROM_HUB=%s\n"
                      "  UID=%s\n"
                      "  APIKEY=%s\n"
                      "  ROUTING=%s\n"
                      "  MESSAGE=%s\n",
                      Value0, Value1, Value2, Value3, Value4, Value5,
Value6, Value7);

        // Pass back caller's UID.
        *OutValue0 = Value4;
        // Pass back caller's FROM_TP as TO_TP.
        *OutValue1 = Value0;
        // Pass our hub ID as FROM_TP
        *OutValue2 = "ABCD-EFGH-IJKL-MNOP";
        // Force status code of 0 (SUCCESS) for now
        *OutValue3 = "0";
        *OutValue4 = "SUCCESS";
        // Send timestamp.
        clock = time((time_t *) 0);
        tm = localtime(&clock);
        sprintf(timestamp, "%04d-%02d-%02d %02d-%02d-%02d",
                tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
                tm->tm_hour, tm->tm_min, tm->tm_sec);
        *OutValue5 = timestamp;

        fprintf(file, "Output:\n"
                      "  UID=%s\n"
                      "  TO_TP=%s\n"
                      "  FROM_TP=%s\n"
                      "  STATUS=%s\n"
                      "  STATUS_MSG=%s\n"
                      "  TIMESTAMP=%s\n",
                      *OutValue0, *OutValue1, *OutValue2, *OutValue3,
*OutValue4, *OutValue5);
        fclose(file);
}
                   

Mime
View raw message