Highlighted
Super Contributor.
Super Contributor.
167 views

I am getting error message as "Server did not recognize the value of HTTP Header SOAPAction"

Jump to solution

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
'"http://harlandfs/ECM/Services/Search/"'.
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
"http://harlandfs/ECM/Services/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="http://harlandfs/ECM/Services/Security/">
<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>

 

 

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: I am getting error message as "Server did not recognize the value of HTTP Header SOAPAction

Jump to solution

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: "http://harlandfs/ECM/Services/Security/AuthenticateUser"

 

but instead you are sending:

 

SOAPAction: "http://harlandfs/ECM/Services/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: "http://harlandfs/ECM/Services/Security/AuthenticateUser"

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

 

---
Martin Turner
Product Support Engineer
Micro Focus

View solution in original post

0 Likes
2 Replies
Highlighted
Super Contributor.
Super Contributor.

Re: I am getting error message as "Server did not recognize the value of HTTP Header SOAPAction

Jump to solution

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<... 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: http://harlandfs/ECM/Services/Security.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: I am getting error message as "Server did not recognize the value of HTTP Header SOAPAction

Jump to solution

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: "http://harlandfs/ECM/Services/Security/AuthenticateUser"

 

but instead you are sending:

 

SOAPAction: "http://harlandfs/ECM/Services/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: "http://harlandfs/ECM/Services/Security/AuthenticateUser"

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

 

---
Martin Turner
Product Support Engineer
Micro Focus

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.