IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFHLS2WS CICS web service assistant


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptaritu1

New User


Joined: 10 Jun 2009
Posts: 5
Location: Delhi

PostPosted: Fri Jun 26, 2009 4:03 pm
Reply with quote

We have a C++ application deployed with CICS. We were trying to expose the same as Web Service.

We tried using the DFHLS2WS CICS web service assistant to expose the following C Structure to the web

Struct {
int X;
char[9];
int Y;
}dfhrequest;

The utility generates the WSDL and WSBIND file.

WSDL is then used to generate the soap message which is received by CWI

Our C++ application program is invoked by CICS default transaction.

The C++ application program is designed to pick up data as follows:

4 bytes as integer variable. ( 0 to 3)
Next 9 bytes as charcater array ( 4 to 12 )
Next 4 bytes as character ( 13 to 16 )

But the data is not received that ways. We observed from the attached commarea that data is coming like following

4 bytes as integer variable. ( 0 to 3)
Next 12 bytes as character array ( 4 to 16 )
Next 4 bytes as character ( 16 to 20 )


We did further tests with following structures

Struct {
int X;
intZ;
int Y;
}dfhrequest;

Struct {
Char X[9];
Char Y[10];
Char Z[11];
}dfhrequest;


Struct {

int a;
int b;
int c;
Char X[9];
Char Y[10];
Char Z[11];
}dfhrequest;


Perfect results in all of these cases.

It seems when there is a mix of data types int, character, int there is a problem of offset which is causing issue.

Can somebody suggest how we can set the UNALIGN because it seems we cannot have keyword unaligned in C.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Jun 26, 2009 6:38 pm
Reply with quote

Hi Ritu,

I am mainframe (COBOL) programmer but i will still let u know what i think might be happening.

In mainframe there are some cases called boundary allignment which requires fields to be alligned in multiples of four ( bytes ). so here... in ur case when u have a mix of integer and char fields it might be advisable to put in fillers (between the struct wherever required) so that each field is alligned as multiples of four.
Back to top
View user's profile Send private message
guptaritu1

New User


Joined: 10 Jun 2009
Posts: 5
Location: Delhi

PostPosted: Tue Jun 30, 2009 5:12 pm
Reply with quote

when we send it as a single charcater array.. say int, char int are taken as char[16], then when it reaches our application it will use the bytes in commarea and take first 4 bytes as int and next 9 bytes as character and would expect the \0 as the terminator for the character array.

But we get Soap parsing error.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Jun 30, 2009 5:18 pm
Reply with quote

hi...

no idea what soap parsing error is.... icon_eek.gif

icon_smile.gif ... anyways... i did not und the "terminator" concept. are u telling that the destination C++ programs is always expecting a null termination ( single byte ) after every character field ??
Back to top
View user's profile Send private message
guptaritu1

New User


Joined: 10 Jun 2009
Posts: 5
Location: Delhi

PostPosted: Tue Jun 30, 2009 5:19 pm
Reply with quote

when we send it as a single charcater array.. say int, char int are taken as char[16], then when it reaches our application it will use the bytes in commarea and take first 4 bytes as int and next 9 bytes as character and would expect the \0 as the terminator for the character array.

But we get Soap parsing error.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 30, 2009 6:01 pm
Reply with quote

From the z/OS XL C/C++ Language Reference manual, with emphasis added by me:
Quote:
Structure members are assigned to memory addresses in increasing order, with the first component starting at the beginning address of the structure name itself. To allow proper alignment of components, padding bytes may appear between any consecutive members in the structure layout.
I suggest you add pad bytes before your int Y definition so that it starts on byte 16. Although I haven't found any clear definition in the manual, int fields on z/OS appear to be treated as full words since they are 4 bytes and therefore are aligned on 4-byte boundaries.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts How to avoid duplicating a CICS Web S... CICS 0
Search our Forums:

Back to Top