Ad Widget

Collapse

Problem with a web scenario returning code 415 while curl similar test returns 200

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • giraphe
    Junior Member
    • Jul 2021
    • 5

    #1

    Problem with a web scenario returning code 415 while curl similar test returns 200

    Hi,

    I have a curl test wich returns a good 200 status code while performed from Zabbix server :

    cat addressdoctor
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://validator5.AddressDoctor.com/Webservice5/v4">
    <soapenv:Header/>
    <soapenv:Body>
    <v4:Process>
    <!-- empty request-->
    </v4:Process>
    </soapenv:Body>
    </soapenv:Envelope>




    curl -kv --header "Accept-Encoding: gzip, deflate" \
    --header "Content-Type: text/xml;charset=UTF-8" \
    --header "SOAPAction: http://validator5.AddressDoctor.com/Webservice5/v4/Process" \
    --data @addressdoctor \
    -X POST https://validator5.addressdoctor.com...alidation.asmx
    Note: Unnecessary use of -X or --request, POST is already inferred.
    * Trying 216.59.63.65:443...
    * Connected to validator5.addressdoctor.com (216.59.63.65) port 443 (#0)
    * ALPN, offering h2
    * ALPN, offering http/1.1
    * successfully set certificate verify locations:
    * CAfile: /etc/ssl/certs/ca-certificates.crt
    * CApath: /etc/ssl/certs
    * TLSv1.3 (OUT), TLS handshake, Client hello (1):
    * TLSv1.3 (IN), TLS handshake, Server hello (2):
    * TLSv1.2 (IN), TLS handshake, Certificate (11):
    * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
    * TLSv1.2 (IN), TLS handshake, Server finished (14):
    * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
    * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
    * TLSv1.2 (OUT), TLS handshake, Finished (20):
    * TLSv1.2 (IN), TLS handshake, Finished (20):
    * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384
    * ALPN, server accepted to use http/1.1
    * Server certificate:
    * subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=Delaware; serialNumber=3003382; C=US; ST=California; L=Redwood City; O=Informatica LLC; CN=validator5.addressdoctor.com
    * start date: Sep 18 00:00:00 2020 GMT
    * expire date: Sep 23 12:00:00 2021 GMT
    * issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
    * SSL certificate verify ok.
    > POST /webservice5/v4/addressvalidation.asmx HTTP/1.1
    > Host: validator5.addressdoctor.com
    > User-Agent: curl/7.74.0
    > Accept: */*
    > Accept-Encoding: gzip, deflate
    > Content-Type: text/xml;charset=UTF-8
    > SOAPAction: http://validator5.AddressDoctor.com/...ce5/v4/Process
    > Content-Length: 249
    >
    * upload completely sent off: 249 out of 249 bytes
    * Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Cache-Control: private, max-age=0
    < Content-Type: text/xml; charset=utf-8
    < Access-Control-Allow-Origin: *
    < Access-Control-Allow-Headers: Content-Type, SOAPaction
    < Date: Thu, 22 Jul 2021 13:36:31 GMT
    < Connection: close
    < Content-Length: 466
    < X-Content-Type-Options: nosniff
    < X-Frame-Options: SAMEORIGIN
    < X-Xss-Protection: 1; mode=block
    < Strict-Transport-Security: max-age=157680000
    <
    * Closing connection 0
    * TLSv1.2 (OUT), TLS alert, close notify (256):
    <?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"><soap:Body><ProcessResponse xmlns="http://validator5.AddressDoctor.com/Webservice5/v4"><ProcessResult><StatusCode>299</StatusCode><StatusMessage>Invalid request - no values provided</StatusMessage></ProcessResult></ProcessResponse></soap:Body></soap:Envelope>


    Attention : tests take more than 15 seconds to complete !

    I have configured the same test with a web scenario

    Click image for larger version

Name:	mdm_daas_01.png
Views:	1248
Size:	32.8 KB
ID:	428581

    Click image for larger version

Name:	mdm_daas_02.png
Views:	1147
Size:	50.8 KB
ID:	428582

    Click image for larger version

Name:	mdm_daas_03.png
Views:	1125
Size:	20.7 KB
ID:	428583

    I do not understand why test is returning 415 code while performed by Zabbix as a curl returns 200.

    Thanks for helpiong.

    Raphaël
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Content-Type: text/xml

    Comment

    • giraphe
      Junior Member
      • Jul 2021
      • 5

      #3
      Hi, Thanks for pointing this out.
      The Content-Type is defined in the web scenario (as seen in the first capture), it works for the 2 first steps but does not seem to work for the third one.
      If I add again the Content-Type header in the third step (the one in this thread) then it works well.

      It seems the header in the scenario is not defined / propagated in the last step of the web scenario.

      Click image for larger version

Name:	mdm_daas_04.png
Views:	1151
Size:	42.1 KB
ID:	428612

      Click image for larger version

Name:	mdm_daas_05.png
Views:	1131
Size:	54.0 KB
ID:	428613

      And only then it works :

      Click image for larger version

Name:	mdm_daas_06.png
Views:	1122
Size:	21.8 KB
ID:	428614


      So thanks problem is resolved, but there may still be an anomaly.

      Raphaël

      Comment

      Working...