Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Getting an error from EZASOKET while passing SOAP XML

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Thu May 17, 2018 9:21 pm    Post subject: Getting an error from EZASOKET while passing SOAP XML
Reply with quote

I have written a COBOL code that can access a webservice from mainframes. The input that is sent from COBOL code is SOAP XML [through variables holding XML is bits and parts].

The data is being sent without any truncation and is being received without any issue with truncation. But I am always receiving a XML that states as below

"HTTP/1.1 400 Bad Request Content-Type: text/html; charset=us-ascii Server: Microsoft-HTTPAPI/2.0 Dat
e: Wed, 16 May 2018 *********** Connection: close Content-Length: 326 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
//EN""http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>Bad Request</TITLE> <META HTTP-EQUIV="Content-Type" C
ontent="text/html; charset=us-ascii"></HEAD> <BODY><h2>Bad Request - Invalid Verb</h2> <hr><p>HTTP Error 400. The requ
est verb is invalid.</p> </BODY></HTML>"

I do understand that the server is not able to understand the XML request that I have sent. If my understanding is correct, then can you please let me know if there is anyway to get out of it.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Thu May 17, 2018 9:59 pm    Post subject: Reply to: Getting an error from EZASOKET while passing SOAP XML
Reply with quote

Quote:
can you please let me know if there is anyway to get out of it.
Yes - find and fix the invalid code. Start by displaying in your code EXACTLY what is being sent. Take that text, put it in a browser, and see what the server shows you when you manually try it. Validate that you don't have things in the text to cause issues (such as an ampersand). Talk to your network support group and verify you're not having a gateway timeout (which sometimes gets reported as an error 400). The message indicates an invalid verb -- are you attempting to do a GET or PUT?
Quote:
The data is being sent without any truncation and is being received without any issue with truncation.
There is no indication in the message of truncation, so why do you think this is an issue?
Back to top
View user's profile Send private message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Fri May 18, 2018 11:41 am    Post subject: Re: Reply to: Getting an error from EZASOKET while passing SOAP XML
Reply with quote

Robert Sample wrote:
Quote:
can you please let me know if there is anyway to get out of it.
Yes - find and fix the invalid code. Start by displaying in your code EXACTLY what is being sent. Take that text, put it in a browser, and see what the server shows you when you manually try it. Validate that you don't have things in the text to cause issues (such as an ampersand). Talk to your network support group and verify you're not having a gateway timeout (which sometimes gets reported as an error 400). The message indicates an invalid verb -- are you attempting to do a GET or PUT?
Quote:
The data is being sent without any truncation and is being received without any issue with truncation.
There is no indication in the message of truncation, so why do you think this is an issue?


Sure Robert. I have already tried displaying the message being sent from our end and what is received and then translated.

But no clue of what is going wrong. Will check on the same once again.
Back to top
View user's profile Send private message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Fri May 18, 2018 11:53 am    Post subject: Re: Reply to: Getting an error from EZASOKET while passing SOAP XML
Reply with quote

Robert Sample wrote:
The message indicates an invalid verb -- are you attempting to do a GET or PUT?


I am trying to POST and then listen the socket for response.
Do we need to use GET or PUT keyword in the SOAP XML that we send via EZASOKET?
Can you please help me understand.
Back to top
View user's profile Send private message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Fri May 18, 2018 12:05 pm    Post subject: Need help to understand accessing the URL
Reply with quote

I wonder that my REXX is able to hit the web service and get the right output using the same SOAP envelope that i have used in the COBOL program, but COBOL program is not able to fetch the output from webservice.

Only difference that i can find from my REXX and COBOL is that, in REXX and COBOL i am trying to use the IP address to connect to the server but later while posting the SOAP evvelope, in my REXX i am POSTing it to the exact path as in URL but in COBOL EZASOKET I could not find option on how to do the same.

Let me explain with an example as in what i meant above,

https://xyxz.globally.com/dummy.otg.garage.web.services/myservice.asmx is the complete webservice URL.

I tried to connect to the IP address of this webservice in both REXX and COBOL.
But in REXX while writing the socket with SOAP ENVELOPE, i am using POST /dummy.otg.garage.web.services/myservice.asmx
But in COBOL after getting the connection established with the socket, i am trying to write the SOAP envelope with the same content but it s not giving the response.
What I suspect from this is, since in COBOL i am not able to point out to the exact service that i am looking for, instead i am passing my query to https://xyxz.globally.com [IP address of this URL] and it is not able to understand my query?

Is my suspection correct?
Underlying point is that IP address will not change based on the path but remains same for a base DNS.

If yes then how can i point to the complete URL to access the service. So is this something that i need to worry about.

PS: If i had poured in my thoughts and confused you, then please feel free to raise it so i can clarify to seek your support.
Back to top
View user's profile Send private message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Sat May 26, 2018 3:42 pm    Post subject: Finally it’s achieved
Reply with quote

Thanks all for your time. The issue has been resolved due to a small ASCII character that made me to test the code again and again.

Without CRLF character the server cannot understand the end of line, hence the issue.
Back to top
View user's profile Send private message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Fri Oct 05, 2018 6:00 pm    Post subject: Error in Decoding ASCII & to EBCDIC
Reply with quote

I am trying to decode ASCII stream that i received from a service in mainframe into EBCDIC format using EZACIC05.

Everything is running as expected but & is decoded as &amp in EBCDIC.
Can someone help or pour your insight on this?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Oct 05, 2018 6:47 pm    Post subject:
Reply with quote

I've never heard of an ASCII to EBCDIC conversion that changes & to &amp -- but I have run into &amp in HTML documents. If your source is HTML, then it is likely that HTML is causing you the problem.

Have you looked into the source on the other system to see what is present there?
Back to top
View user's profile Send private message
vaibhav gs

New User


Joined: 05 Apr 2018
Posts: 17
Location: INDIA

PostPosted: Fri Oct 05, 2018 8:05 pm    Post subject: It makes sense!
Reply with quote

Thanks Robert, then I was diverted assuming its the conversion issue!
The source is having & but the output is &amp
As you mentioned I am transporting data using XML [HTTP 1.1] and so would be the issue with &?

Is there any solution to overcome issue by converting this &amp with & ? or should we handle the same in the code using some logic to replace it explicitly?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Sat Oct 06, 2018 3:19 am    Post subject:
Reply with quote

According to the Enterprise COBOL Version 5.1.1 Programming Guide manual (page 538), CONTENT-CHARACTER should contain the string with &amp; replaced by an & after the XML parsing is done. It's been too long since I last did an XML PARSE to remember if that is truly the case.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Error reading file in REXX module ashek15 CLIST & REXX 3 Wed Oct 24, 2018 4:50 am
No new posts PL/I read error for HFS files Joe Kirsch PL/I & Assembler 6 Fri Sep 28, 2018 9:13 pm
No new posts Error in IEBGENER supriyo kumar JCL & VSAM 1 Thu Sep 27, 2018 10:22 pm
No new posts Error while trying to open an AIX in ... amitc23 CICS 4 Tue Sep 04, 2018 12:15 pm
No new posts SOAP Message Handler Application Inte... John Poulakos CICS 1 Fri Aug 24, 2018 1:05 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us