Skip to main content

XML PUT TEXT / GET TEXT logic does not work

  • January 18, 2020
  • 3 replies
  • 0 views

Hi, i implemented below logic, But, call "HttpPost" does not work.... what is causing issue on my code.? Or MicroFocus software has issue?

Move spaces to XMLFILE1-ID.
String LS-DIR-HOMEDRIVE-VALUE ":"
LS-DIR-HOMETEMP-VALUE
"TMP\\file1.xml"
delimited by spaces into XMLFILE1-ID
End-String.


Move spaces to XMLFILE2-ID.
String LS-DIR-HOMEDRIVE-VALUE ":"
LS-DIR-HOMETEMP-VALUE
"TMP\\file2.xml"
delimited by spaces into XMLFILE2-ID
End-String.


XML INITIALIZE.
IF NOT XML-OK
GO TO 004-END-PROCESS
END-IF.
open OUTPUT XMLFILE1.
If XMLFILE1-STATUS = "00" or "10" or SPACE
continue
else
PERFORM 005-ERROR-STATUS
END-IF.

move WS-AUTH-XML to XMLFILE1-REC.
write XMLFILE1-REC.
close XMLFILE1.

XML GET TEXT
request-payload
request-len
 "XMLFILE1-ID"
IF NOT XML-OK
GO TO 004-END-PROCESS
END-IF.
PERFORM 001-NET-INIT.

call "HttpPost"
using
Post-Address1
Content-Type
request-payload
request-len
response-payload
response-len
Desired-SOAP-Action1
giving
response-status.


XML PUT TEXT
response-payload
response-len
 "XMLFILE2-ID"
IF NOT XML-OK
GO TO 004-END-PROCESS
END-IF.
PERFORM 003-NETFREE.

Open input XMLFILE2.

3 replies

  • January 21, 2020

Hi, i implemented below logic, But, call "HttpPost" does not work.... what is causing issue on my code.? Or MicroFocus software has issue?

Move spaces to XMLFILE1-ID.
String LS-DIR-HOMEDRIVE-VALUE ":"
LS-DIR-HOMETEMP-VALUE
"TMP\\file1.xml"
delimited by spaces into XMLFILE1-ID
End-String.


Move spaces to XMLFILE2-ID.
String LS-DIR-HOMEDRIVE-VALUE ":"
LS-DIR-HOMETEMP-VALUE
"TMP\\file2.xml"
delimited by spaces into XMLFILE2-ID
End-String.


XML INITIALIZE.
IF NOT XML-OK
GO TO 004-END-PROCESS
END-IF.
open OUTPUT XMLFILE1.
If XMLFILE1-STATUS = "00" or "10" or SPACE
continue
else
PERFORM 005-ERROR-STATUS
END-IF.

move WS-AUTH-XML to XMLFILE1-REC.
write XMLFILE1-REC.
close XMLFILE1.

XML GET TEXT
request-payload
request-len
 "XMLFILE1-ID"
IF NOT XML-OK
GO TO 004-END-PROCESS
END-IF.
PERFORM 001-NET-INIT.

call "HttpPost"
using
Post-Address1
Content-Type
request-payload
request-len
response-payload
response-len
Desired-SOAP-Action1
giving
response-status.


XML PUT TEXT
response-payload
response-len
 "XMLFILE2-ID"
IF NOT XML-OK
GO TO 004-END-PROCESS
END-IF.
PERFORM 003-NETFREE.

Open input XMLFILE2.

Hi All,   Any clue on this please?


Abdullah Yapıcı

Hi All,   Any clue on this please?

What error does it give?After

xml initialize

command line     add

XML TRACE         

3

"/tmp/output.txt" line.

 

We can get information about the error from the output.txt file.


Stephen Hjerpe
  • Participating Frequently
  • January 29, 2020

What error does it give?After

xml initialize

command line     add

XML TRACE         

3

"/tmp/output.txt" line.

 

We can get information about the error from the output.txt file.

I believe the XML TRACE statement needs to contain the file you are attempting to get trace information on. For example, our TempConvert.cbl has a XML PUT Text  TempFahrenheitResponse.xml

You would use

XML TRACE         

TempFahrenheitResponse.xml

3

"/tmp/output.txt"