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

Getting an error from EZASOKET while passing SOAP XML


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 17, 2018 9:59 pm
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
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
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
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,

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 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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 05, 2018 6:47 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Oct 06, 2018 3:19 am
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
elixir1986
Warnings : 1

New User


Joined: 10 Nov 2015
Posts: 44
Location: USA

PostPosted: Tue Nov 27, 2018 3:52 am
Reply with quote

Hi,

I am pondering the possibilities on hitting the web service without intervention of db2. Currently using sql mentioned below,


Code:
   select                                                           
                db2xml.soaphttpnv
                (:internet protocol address,:webservice link,:soap xml schema
                  structure)                     
                  into :varchar-output                                           
              from sysibm.sysdummy1                                             
end-exec.


This thread provided information of access webservice. Could you please tell if the web service was accessed from batch or online mode?

Also, similar to the snippet I have provided, if you could provide me on accessing web service in batch mode without using db2, it would be great.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top