View previous topic :: View next topic
|
Author |
Message |
ask2sudhir.ibm
New User
Joined: 24 Aug 2012 Posts: 7 Location: india
|
|
|
|
Hi,
I am trying to implement CICS as web service requester.
But we are not able to have any success yet.
Below is code and copybooks its a simple hello world program.
First thing I am struggling with is the CONT and NUM variables generated from DFHWS2LS I am not sure what to do with those variables.
Please have a look at the code and copybook and please let me know what is going wrong.
I am getting DFHPI0000000 something in output from SEND TEXT in my code after doing GET container.
Program + copybook + WSDL are attached.
Copybooks
input
05 sayHello.
10 arg0-num PIC S9(9) COMP-5 SYNC.
10 arg0-cont PIC X(16).
01 HELLOI01-arg0.
05 arg0 PIC X(255).
output
05 sayHelloResponse.
10 Xreturn-num PIC S9(9) COMP-5 SYNC.
10 Xreturn-cont PIC X(16).
01 HELLOO01-Xreturn.
05 Xreturn PIC X(255).
any help is much appreciated. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Sudhir,
I don't see anywhere FLENGTH is getting calcuated during the PUT and GET so may that be the reason and also review right container name is passed while you do a GET. |
|
Back to top |
|
|
ask2sudhir.ibm
New User
Joined: 24 Aug 2012 Posts: 7 Location: india
|
|
|
|
Hi Rohit,
When I put the code in XPED the container name while doing GET is correct.
Also I have not put FLENGTH I know but I am not getting any error as well while running the program because of that.
The issue is I am not passing the data correctly to webservice in SOAP message. I am passing NULL to it.
And in return I am getting some junk value like DFHPI00000 of 20 bytes in output after doing a get container.
My doubt is that I am not handling these varibale NUM and CONT in copybooks correctly. As I have not coded such program before.
Still looking for help and direction to resolve this. |
|
Back to top |
|
|
ask2sudhir.ibm
New User
Joined: 24 Aug 2012 Posts: 7 Location: india
|
|
|
|
Could someone please advice what I am missing here as I am still struggling to get it correct. |
|
Back to top |
|
|
koppineedi
New User
Joined: 19 Sep 2007 Posts: 7 Location: chennai
|
|
|
|
Can you share the structure of output - TESTOUT
Regards,
Hari |
|
Back to top |
|
|
ask2sudhir.ibm
New User
Joined: 24 Aug 2012 Posts: 7 Location: india
|
|
|
|
Here are the copybboks for input and output
Copybooks
input
05 sayHello.
10 arg0-num PIC S9(9) COMP-5 SYNC.
10 arg0-cont PIC X(16).
01 HELLOI01-arg0.
05 arg0 PIC X(255).
output
05 sayHelloResponse.
10 Xreturn-num PIC S9(9) COMP-5 SYNC.
10 Xreturn-cont PIC X(16).
01 HELLOO01-Xreturn.
05 Xreturn PIC X(255). |
|
Back to top |
|
|
koppineedi
New User
Joined: 19 Sep 2007 Posts: 7 Location: chennai
|
|
|
|
NUM field is used to check whether we have any data present in the container.
EXEC CICS GET CONTAINER(WS-CONTAINER-NAME)
CHANNEL(WS-CHANNEL-NAME)
INTO(sayHelloResponse)
END-EXEC
when you get the response into container, use the proper response container.(Xreturn-cont)
If Xreturn-num > 0
EXEC CICS GET CONTAINER(Xreturn-cont)
CHANNEL(WS-CHANNEL-NAME)
INTO(HELLOO01-Xreturn)
END-EXEC
end-if.
Regards,
Hari |
|
Back to top |
|
|
ask2sudhir.ibm
New User
Joined: 24 Aug 2012 Posts: 7 Location: india
|
|
|
|
Thanks Hari!!!
Finally I was able to get it correct. The issue was I was putting the data in wrong container and I was passing NULL to web service.
Also when we get response of web service we need to do GET container twice.
First GET will get the container name where the response is. And this container is the one which is in output copybook with name as -cont.
So we need to populate the first container from the area where we are putting the actuall data which we want to pass to web service.
Next put is for putting the whole structure into memory spaces.
Thanks
Sudhir |
|
Back to top |
|
|
|