Hi MicroFocus Team,
I am getting error message as "Server did not recognize the value of HTTP Header SOAPAction"
I have attached my xml and cobol file below, any idea why i am getting above error.
Identification division.
Program-id. Test.
Data division.
Working-storage section.
01 Doc-response.
02 Doc-token pic X(80).
01 WS-SOAP-ENVELOP-INPUT.
02 FILLER PIC X(26) value '<soap:Envelope xmlns:soap='.
02 FILLER PIC X(44) value
'"http://schemas.xmlsoap.org/soap/envelope/" '.
02 FILLER PIC X(10) value 'xmlns:xsi='.
02 FILLER PIC X(43) value
'"http://www.w3.org/2001/XMLSchema-instance"'.
02 FILLER PIC X(1) value space.
02 FILLER PIC X(10) value 'xmlns:xsd='.
02 FILLER PIC X(35) value
'"http://www.w3.org/2001/XMLSchema">'.
02 FILLER PIC X(31) VALUE '<soap:Header><AuthTicket xmlns='.
02 filler pic x(39) value
'"'.">harlandfs/.../"'.
02 FILLER PIC X(21) VALUE '<AuthenticatedTicket>'.
02 AuthenticatedTicket.
03 Doc-User Pic X(13) value 'sparak.tester'.
03 Doc-Pwd Pic X(09) value 'Passw0rd2'.
02 FILLER PIC X(22) VALUE '</AuthenticatedTicket>'.
02 FILLER PIC X(13) VALUE '</AuthTicket>'.
02 FILLER PIC X(14) VALUE '</soap:Header>'.
01 WS-SOAP-ENVELOP-OUTPUT PIC X(200).
01 request-payload usage pointer.
01 response-payload usage pointer.
01 response-status pic 9(3) value zero.
01 response-status-2 pic 9(3) value zero.
01 response-len pic s9(4).
01 request-len pic s9(4).
01 a-single-char pic x.
copy "lixmlall.cpy".
01 Desired-SOAP-Action.
05 filler pic x(10) value 'SOAPAction'.
05 filler pic x value x"00".
05 filler pic x(39) value
"">harlandfs/.../Security".
05 filler pic x value x"00".
78 post-address value
"https://px-demo.avcm.esvccenter.com/services/wse/Authenticat
- "ion.asmx".
78 Content-Type value "text/xml; charset=utf-8".
linkage section.
01 http-response pic x(100).
procedure division.
main.
XML INITIALIZE
if not XML-OK go to z.
XML GET TEXT
request-payload
request-len
"payload2.xml"
IF NOT XML-OK GO TO Z.
call "NetInit"
giving
response-status.
CALL "NetSSLVerifyPeer" USING 0
call "HttpPost"
using
Post-Address
Content-Type
request-payload
request-len
response-payload
response-len
Desired-SOAP-Action
giving
response-status.
set address of http-response to response-payload.
display "Response: ", response-status.
if not response-status = 0
call "NetGetError" using response-payload response-len
giving response-status-2
set address of http-response to response-payload
display "Error! ", response-status
display "Error message: ", http-response(1:response-len)
call "NetFree" using response-payload
go to z
end-if.
XML FREE TEXT
request-payload.
if response-payload = NULL
display "Error: NULL pointer returned", line 10, blink
accept a-single-char prompt
go to z
end-if.
XML PUT TEXT
response-payload
response-len
"Doc-response"
"AuthResponse.xml".
if not XML-OK go to z.
XML IMPORT TEXT
Doc-response
response-payload
response-len
"Doc-response"
if not XML-OK go to z.
call "NetFree"
using
response-payload.
call "NetCleanup"
GOBACK.
z.
copy "lixmltrm.cpy".
display "finished.", line 20 position 5.
accept a-single-char prompt tab.
stop run.
copy "lixmldsp.cpy".
=======================
payload2.xml
------
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="">harlandfs/.../">
<soapenv:Header/>
<soapenv:Body>
<sec:AuthenticateUser>
<!--Optional:-->
<sec:userName>sparak.tester</sec:userName>
<!--Optional:-->
<sec:password>Test123</sec:password>
</sec:AuthenticateUser>
</soapenv:Body>
</soapenv:Envelope>