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: 8120
Location: East Dubuque, Illinois, USA

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 RDz Json restful service Kevin Vaz IBM Tools 4 Thu Jun 29, 2017 10:44 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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