Skip to main content

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>

 

 

 

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>

 

 

 

Also, my output of Doc-response.xml below

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><soap:Header><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:a80cce1c-e4f7-4f0e-b731-e54261d7c4c3</wsa:MessageID><wsa:RelatesTo>urn:uuid:917b698a-697e-471b-9eef-cc358ad8eaf7</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-c445541d-dfb9-4710-a0e4-349b0fa9fee9"><wsu:Created>2019-10-16T11:56:50Z</wsu:Created><wsu:Expires>2019-10-16T12:01:50Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: harlandfs/.../faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>


Also, my output of Doc-response.xml below

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><soap:Header><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:a80cce1c-e4f7-4f0e-b731-e54261d7c4c3</wsa:MessageID><wsa:RelatesTo>urn:uuid:917b698a-697e-471b-9eef-cc358ad8eaf7</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-c445541d-dfb9-4710-a0e4-349b0fa9fee9"><wsu:Created>2019-10-16T11:56:50Z</wsu:Created><wsu:Expires>2019-10-16T12:01:50Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: harlandfs/.../faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

Please check with your web service support. The error is returned from there. If you check, you are sending the wrong SOAPAction header - https://px-demo.avcm.esvccenter.com/services/wse/Authentication.asmx?op=AuthenticateUser

It specifically is asking for:

 

SOAPAction: "">harlandfs/.../AuthenticateUser"

 

but instead you are sending:

 

SOAPAction: "">harlandfs/.../Security"

 

POST /services/wse/Authentication.asmx HTTP/1.1
Host: px-demo.avcm.esvccenter.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "">harlandfs/.../AuthenticateUser"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xmlns:xsd="">www.w3.org/.../XMLSchema" xmlns:soap="">schemas.xmlsoap.org/.../">
  <soap:Body>
    <AuthenticateUser xmlns="">harlandfs/.../">
      <userName>string</userName>
      <password>string</password>
    </AuthenticateUser>
  </soap:Body>
</soap:Envelope>