473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

structure and pointer problems?

Hello,

I am making a service for use with gsoap. It is called
InstTicktServer.c.

The header file is defined as follows:

typedef struct InstTickt__struct_DBInstantTckt {
xsd__int GameNo;
xsd__int PackNo;
xsd__int VIRNNo;
xsd__int LatexNo;
xsd__int TicktStat;
xsd__int RetailNo;
xsd__int TermAmt;
xsd__int LMSAmt;
xsd__string SerialNo;
xsd__string TermDateTime;
xsd__string SysDateTime;
} ;

typedef struct InstTickt__Response {
struct InstTickt__struct_DBInstantTckt *DBList;
xsd__int NoOfItems;
};
--------------------------------------------------------------
Then I have the following function for the processing of the server
code:

int InstTickt__db_get(struct soap *soap, xsd__string *login_name,
xsd__string *login_password,
struct InstTickt__struct_QRYInstantTckt *WhereClause,
struct InstTickt__Response *DBListing)
{

int return_code;
int i = 0;
int my_num_rows = 0;
QRYInstantTckt set_clause;
QRYInstantTckt where_clause;
DBInstantTckt in_InstantTckt[100];

db_reset_query_InstantTckt(&where_clause);
strcpy(where_clause.QRYTermDateTime, "01-NOV-1997");
strcpy(where_clause.QRYOPTermDateTime, "=");

my_num_rows = db_get_InstantTckt("scott", "tiger", in_InstantTckt, -1,
where_clause);

DBListing -> NoOfItems = my_num_rows;

/**********************************
Even though the result returns 99 rows, I just allocate 4
cells below for testing purposes
***********************************/
DBListing -> DBList = (struct InstTickt__struct_DBInstantTckt *)
soap_malloc(soap, sizeof(struct InstTickt__struct_DBInstantTckt) *
4);

if (DBListing -> DBList == NULL)
{
return soap_receiver_fault(soap, "Malloc Failure", "Can't allocate
space for answer!");
}
/*
MAIN PART NOT WORKING, Cell 0 gets the value and prints into
the XML response but Cell 1 does not get the value
*/

DBListing -> DBList[0].GameNo = 111111111;
DBListing -> DBList[1].GameNo = 222222222;

return SOAP_OK;
}
--------------------------------------------

If you look at the resulting XML envelope below, you can see
"111111111" for "GameNo". This is the first cell - but - I do not see
"222222222" for "GameNo" for the second cell.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:InstTickt="urn:InstTickt"><SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><InstTickt:Response><DBList><GameNo>11111111 1</GameNo><PackNo>1089956652</PackNo><VIRNNo>0</VIRNNo><LatexNo>0</LatexNo><TicktStat>1056768</TicktStat><RetailNo>167837696</RetailNo><TermAmt>0</TermAmt><LMSAmt>0</LMSAmt></DBList><NoOfItems>99</NoOfItems></InstTickt:Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
Please tell me - what am I doing wrong????

TIA

Dec 8 '05 #1
2 1948
milkyway wrote:
Hello,

I am making a service for use with gsoap. It is called
InstTicktServer.c.

The header file is defined as follows:

typedef struct InstTickt__struct_DBInstantTckt {
xsd__int GameNo;
xsd__int PackNo;
xsd__int VIRNNo;
xsd__int LatexNo;
xsd__int TicktStat;
xsd__int RetailNo;
xsd__int TermAmt;
xsd__int LMSAmt;
xsd__string SerialNo;
xsd__string TermDateTime;
xsd__string SysDateTime;
} ;

typedef struct InstTickt__Response {
struct InstTickt__struct_DBInstantTckt *DBList;
xsd__int NoOfItems;
};
--------------------------------------------------------------
Then I have the following function for the processing of the server
code:

int InstTickt__db_get(struct soap *soap, xsd__string *login_name,
xsd__string *login_password,
struct InstTickt__struct_QRYInstantTckt *WhereClause,
struct InstTickt__Response *DBListing)
{

int return_code;
int i = 0;
int my_num_rows = 0;
QRYInstantTckt set_clause;
QRYInstantTckt where_clause;
DBInstantTckt in_InstantTckt[100];

db_reset_query_InstantTckt(&where_clause);
strcpy(where_clause.QRYTermDateTime, "01-NOV-1997");
strcpy(where_clause.QRYOPTermDateTime, "=");

my_num_rows = db_get_InstantTckt("scott", "tiger", in_InstantTckt, -1,
where_clause);

DBListing -> NoOfItems = my_num_rows;

/**********************************
Even though the result returns 99 rows, I just allocate 4
cells below for testing purposes
***********************************/
DBListing -> DBList = (struct InstTickt__struct_DBInstantTckt *)
soap_malloc(soap, sizeof(struct InstTickt__struct_DBInstantTckt) *
4);

if (DBListing -> DBList == NULL)
{
return soap_receiver_fault(soap, "Malloc Failure", "Can't allocate
space for answer!");
}
/*
MAIN PART NOT WORKING, Cell 0 gets the value and prints into
the XML response but Cell 1 does not get the value
*/

DBListing -> DBList[0].GameNo = 111111111;
DBListing -> DBList[1].GameNo = 222222222;

return SOAP_OK;
}
--------------------------------------------

If you look at the resulting XML envelope below, you can see
"111111111" for "GameNo". This is the first cell - but - I do not see
"222222222" for "GameNo" for the second cell.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:InstTickt="urn:InstTickt"><SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><InstTickt:Response><DBList><GameNo>11111111 1</GameNo><PackNo>1089956652</PackNo><VIRNNo>0</VIRNNo><LatexNo>0</LatexNo><TicktStat>1056768</TicktStat><RetailNo>167837696</RetailNo><TermAmt>0</TermAmt><LMSAmt>0</LMSAmt></DBList><NoOfItems>99</NoOfItems></InstTickt:Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
Please tell me - what am I doing wrong????

TIA


I don't see a C++ *language* question in here, which means that your
post is off-topic in this newsgroup. See the FAQ for what is on-topic
and for some suggestions of better places to post this:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Dec 8 '05 #2
milkyway wrote:
Hello,

I am making a service for use with gsoap. It is called
InstTicktServer.c.

The header file is defined as follows:

typedef struct InstTickt__struct_DBInstantTckt {


If you wrote this class, you should know that you are not allowed
to use double underscores. They are reserved to the impelementation
(in C++ at least, as a matter of fact this code doesn't look much
like C++ at all, so you probably shouldn't post there).

However, I suspect the problem is with usage of whatever soap library
you are using which is outside the scope of either of these groups.
Dec 8 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
I'm trying to creat a data structure, that can be either a integer, double, string, or linked list. So I created the following, but don't know if it is the data structure itself causing problems,...
16
by: Duncan Mole | last post by:
Hi, This is probably an easy one but it iy first bit of p/invoke. I am trying to use the following C struct in a call: typedef struct { BYTE SRB_Cmd; BYTE SRB_Status, BYTE ...
3
by: Michael | last post by:
Hi, I have had a look in the FAQ but cannot see anything related, of course that doesn't mean it's not there. In any case: I have the following: void function(){ struct tm *time2;
2
by: Mike | last post by:
Hi, I am new to C and having problems with the following program. Basically I am trying to read some files, loading data structures into memory for latter searching. I am trying to use structres...
17
by: dtschoepe | last post by:
Hi, I have a homework project I am working on, so be forwarned, I'm new to C programming. But anyway, having some trouble with a memory allocation issue related to a char * that is a variable...
7
by: ot_007_2001 | last post by:
Hi, all, For pricticing defination of structure in C, I wrote a small code as follow: #include<stdio.h> struct datastruct { int data;
5
by: zehra.mb | last post by:
Hi, I had written application for storing employee data in binary file and reading those data from binary file and display it in C language. But I face some issue with writing data to binary file....
14
by: deepak | last post by:
Hi Experts, I'm getting this compilation error while trying to access a member in structure. at what time we will get this error message? Thanks, Deepak
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
5
by: ctj951 | last post by:
I have a very specific question about a language issue that I was hoping to get an answer to. If you allocate a structure that contains an array as a local variable inside a function and return...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.