HTTP_Post binding/security mismatch between the sender and the receiver

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
onie
Posts: 11
Joined: Mon Nov 07, 2022 8:27 pm
Location: Florida

HTTP_Post binding/security mismatch between the sender and the receiver

Post by onie »

Hi Scott,

This is a SOAP API that I am working to write RPG program to process. V7R4M0 is the current version.
I am doing a HTTP_POST and getting the HTTP 500 error and below is the faultstring error.
Thanks for your advice and help! I am learning as I go with this project.
Onie
************Beginning of data**************
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelop ... <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05 ... aultstring xml:lang="en-US">The message with Action 'https://tmwsytems.com/ AMS/IntegrationToolKit/SetFuelTicket' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including sec
urity requirements, e.g. Message, Transport, None).</faultstring></s:Fault></s:Body></s:Envelope>


I have been able to get the API to run on Postman and SoapUI. I added the SoapAction string, but that didn't change anything.


My Post:

Code: Select all

  rc = HTTP_POST(URL
                : SoapAddr
                : SoapLen
                : FILEPATH
                : TimeOut
                : *omit
                : *omit
                : SoapAction );               "

 "SOAP =
   '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap' +
   '.org/soap/envelope/" xmlns:ams="http://tmwsystems.com/AMS">' +
   '<soapenv:Header>' +
   '<ams:UserName>' + %trim(#UsrNme) + '</ams:UserName>' +
   '<ams:Password>' + %trim(#Pswd) + '</ams:Password>' +
   '</soapenv:Header>' +
   '<soapenv:Body>' +
   '<ams:SetFuelTicketParamMessage>' +
   '<ams:Param>' +
       '<ams:UnitId>' + %trim(#UnitId) + '</ams:UnitId>' +
       '<ams:ShopId>' + %trim(#ShopId) + '</ams:ShopId>' +
       '<ams:UnitNumber>' + %trim(#UnitNum) + '</ams:UnitNumber>' +
       '<ams:Vendor>' + %trim(#Vendor) + '</ams:Vendor>' +
       '<ams:BatchId>' + %trim(%editc(#BatchID: 'M')) + '</ams:BatchId>' +
       '<ams:FuelType>' + %trim(#FuelType) + '</ams:FuelType>' +
       '<ams:TicketNumber>' + %trim(#TicketNum) + '</ams:TicketNumber>' +
       '<ams:TripNumber>' +  %trim(#TripNum) + '</ams:TripNumber>' +
       '<ams:Quantity>' +  %trim(%editc(#Qty : 'M')) + '</ams:Quantity>' +
       '<ams:TotalAmt>' + %trim(%editc(#TotalAmt: 'M')) + '</ams:TotalAmt>' +
       '<ams:CreateDate>' + %trim(#CrtDate) + '</ams:CreateDate>' +
       '<ams:NotCompanyUnit>' + %trim(#false) + '</ams:NotCompanyUnit>' +
       '<ams:AmtUOM>' + %trim(#US$) + '</ams:AmtUOM>' +
       '<ams:TaxOverride>' + %trim(#false) + '</ams:TaxOverride>' +
       '<ams:Taxable>' + %trim(#false) + '</ams:Taxable>' +
       '<ams:ChgUOM>' + %trim(#US$) + '</ams:ChgUOM>' +
     '</ams:Param>' +
   '</ams:SetFuelTicketParamMessage>' +
  '</soapenv:Body>' +
  '</soapenv:Envelope>' ;     
                                         
  SOAPAddr = %Addr(SOAP) + 2;
    SOAPLen = %Len(%Trim(SOAP));
    SoapAction = %trim(sAction);   
RESPONSE:

************Beginning of data**************
HTTPAPI Ver 1.43 released 2021-04-19
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R4M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_url_post(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'00000136'
DNS default domain:xxxxxxxxx.com (x out name)
DNS server found: 10.1.5.14
DNS server found: 9.9.9.9
DNS server found: 8.8.4.4
https_init(): entered
QSSLPCL = *TLSV1.3 *TLSV1.2 *TLSV1.1 *TLSV1
SSL version 2 support disabled
SSL version 2 support disabled
SSL version 3 support disabled
Old interface to TLS version 1.0 support enabled
TLS version 1.0 support enabled
TLS version 1.1 support enabled
TLS version 1.2 support enabled
TLS version 1.3 support enabled
initializing GSK environment
GSK Environment now available
---------------------------------------------------------
Dump of local-side certificate information:
---------------------------------------------------------
Nagle's algorithm (TCP_NODELAY) disabled.
SNI hostname set to: ave.tmwcloud.com
---------------------------------------------------------
Dump of server-side certificate information:
---------------------------------------------------------
Cert Validation Code = 0
-----BEGIN CERTIFICATE-----
MIIGkDCCBXigAwIBAgIJAM1n/nloGgL4MA0GCSqGSIb3DQEBCwUAMIG0MQswCQYD
VQQGEwJVUzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEa
MBgGA1UEChMRR29EYWRkeS5jb20sIEluYy4xLTArBgNVBAsTJGh0dHA6Ly9jZXJ0 ( did not include all of this)
-----END CERTIFICATE-----
Serial Number: 00:CD:67:FE:79:68:1A:02:F8
Common Name: *.tmwcloud.com
Issuer CN: Go Daddy Secure Certificate Authority - G2
Issuer Country: US
Issuer State/Province: Arizona
Issuer Locality: Scottsdale
Issuer Org: GoDaddy.com, Inc.
Issuer Org Unit: http://certs.godaddy.com/repository/
Version: 3
not before: 20221218065335
Unknown Field: 06:53:35 18-12-2022
not after: 20240114084906
Unknown Field: 08:49:06 14-01-2024
pub key alg: 1.2.840.113549.1.1.1
signature algorithm: 1.2.840.113549.1.1.11
Unknown Field: 0382010F003082010A0282010100CA6E3906D4165DEB
Unknown Field: 2048
Unknown Field: 2048
Unknown Field: 5F61A78D3D1F6D127D8655DFCAFE2CC0
Unknown Field: 1.2.840.113549.2.5
Unknown Field: 63FED1CA56FF960148D8EE43030F93F375D7A26B
Unknown Field: 4FE8C61DFAAF5D646F712634F77426172BA49B059A3F809A1BCA3A76B87D701E
Unknown Field: 5
Unknown Field: *.tmwcloud.com
Unknown Field: 0
Unknown Field: 1.3.6.1.5.5.7.3.2
Unknown Field: 1.3.6.1.5.5.7.3.1
Unknown Field: 2.23.140.1.2.1
Unknown Field: 2.16.840.1.114413.1.7.23.1
Unknown Field: http://ocsp.godaddy.com/
Protocol Used: TLS Version 1.2
http_persist_post(): entered
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /AMSApp/IntegrationToolKit/IntegrationToolKit.svc HTTP/1.1
Host: ave.tmwcloud.com
User-Agent: http-api/1.43
Content-Type: text/xml
SOAPAction: https://XXXsytems.com/ AMS/IntegrationToolKit/SetFuelTicket
Content-Length: 899
senddoc(): entered
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns
recvresp(): entered
HTTP/1.1 500 Internal Server Error
Date: Wed, 06 Sep 2023 11:34:44 GMT
Content-Type: text/xml; charset=utf-8
Content-Length: 757
Connection: keep-alive
Set-Cookie: ApplicationGatewayAffinityCORS=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/; SameSite=None; Secure
Set-Cookie: ApplicationGatewayAffinity=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/
Server: Microsoft-IIS/10.0
X-UA-Compatible: IE=Edge, Chrome=1
Strict-Transport-Security: max-age=157680000

SetError() #13: HTTP/1.1 500 Internal Server Error
recvresp(): end with 500
recvdoc parms: identity 757
header_load_cookies() entered
cookie_parse() entered
cookie = ApplicationGatewayAffinityCORS=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/; SameSite=None; Secure
cookie attr ApplicationGatewayAffinityCORS=f027b2f5d7b4ac42faf47404f3ad4e56
cookie attr Path=/
cookie attr SameSite=None
cookie attr Secure=
cookie_parse() entered

Connection: keep-alive
Connection: keep-alive
Set-Cookie: ApplicationGatewayAffinityCORS=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/; SameSite=None; Secur
Set-Cookie: ApplicationGatewayAffinity=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/
Server: Microsoft-IIS/10.0
X-UA-Compatible: IE=Edge, Chrome=1
Strict-Transport-Security: max-age=157680000


SetError() #13: HTTP/1.1 500 Internal Server Error
recvresp(): end with 500
recvdoc parms: identity 757
header_load_cookies() entered
cookie_parse() entered
cookie = ApplicationGatewayAffinityCORS=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/; SameSite=None; Secure
cookie attr ApplicationGatewayAffinityCORS=f027b2f5d7b4ac42faf47404f3ad4e56
cookie attr Path=/
cookie attr SameSite=None
cookie attr Secure=
cookie_parse() entered
cookie_parse() entered
cookie = ApplicationGatewayAffinity=f027b2f5d7b4ac42faf47404f3ad4e56; Path=/
cookie attr ApplicationGatewayAffinity=f027b2f5d7b4ac42faf47404f3ad4e56
cookie attr Path=/
recvdoc(): entered
SetError() #0:
recvdoc(): Receiving 757 bytes.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelop ... <faultcode (THE MESSAGE AT THE BEGINNING < ABOVE)
SetError() #13: HTTP/1.1 500 Internal Server Error
http_close(): entered
************End of Data********************
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: HTTP_Post binding/security mismatch between the sender and the receiver

Post by Scott Klement »

Something is different between what you are sending, and what the API expects.

Since you said you have this working in Postman and SoapUI, you should be able to compare what you are sending there with what is sent here and see what is different.
Post Reply