Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DFHLS2WS CICS web service assistant

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: DFHLS2WS CICS web service assistant
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    Post subject:
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    Post subject: how to read char array
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    Post subject:
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    Post subject: how to read char array
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: 7931
Location: Bellevue, IA

PostPosted: Tue Jun 30, 2009 6:01 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Any Recommended Timesharing service c... johnmull All Other Mainframe Topics 0 Mon Jan 02, 2017 11:39 am
No new posts INDEPENDENT CICS TS 4.1 MRO REGION UP... Kyle Carroll CICS 0 Wed Dec 14, 2016 6:55 pm
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us