[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Invalid Header Name



I'm trying to consume a new web service that my company has produced and I'm having problems with the header information. When I process the request in soapUI, I get the data. When I process the request via HTTPAPI, I get an Invalid Header Name error. 

The first attachment (soapUI) shows the request as processed in soapUI (obviously).
The second attachment (debug) is from the httpapi_debug log file. I formatted the soap request in this file to look like the soapUI request just for comparison.
The third attachment (geteodroll) is the program.

As far as I can tell, the HTTPAPI request should work. Any guidance would be appreciated.


Karl B. Woods  
Sr. Programmer/Analyst
Professional Services
1960 S. Milestone Dr., Ste B
Salt Lake City, UT 84104 
Tel: (801) 433-9426 (office)
Fax: (801) 478-2775
E-mail:  karl.woods@xxxxxxxxxxxxxx
                                                                                     
This e-mail contains proprietary information and may be confidential. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you received this message in error, please delete it immediately.


---------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
   xmlns:ns="http://fwapi.DriverTech.com/CommonTypes/2009/04"; 
   xmlns:rep="http://fwapi.DriverTech.com/ReportsService_v2";>
   <soapenv:Header>
      <ns:RequestHeader>
         <ns:CompanyCode>COMP1</ns:CompanyCode>
         <ns:UserName>USER1</ns:UserName>
         <ns:Password>PWD1</ns:Password>
         <ns:DataStoreName>STORE1</ns:DataStoreName>
         <ns:DriverTechAPIVersion></ns:DriverTechAPIVersion>
         <ns:RequestId></ns:RequestId>
      </ns:RequestHeader>
   </soapenv:Header>
   <soapenv:Body>
      <rep:VehiclePerformance_GetByDate>
         <rep:StartDate>2009-05-01</rep:StartDate>
         <rep:EndDate>2009-05-05</rep:EndDate>
         <rep:QueryByRecordDate>false</rep:QueryByRecordDate>
       </rep:VehiclePerformance_GetByDate>
   </soapenv:Body>
</soapenv:Envelope>
HTTPAPI Ver 1.21 released 2007-10-01

New iconv() objects set, PostRem=1208. PostLoc=0. ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: DRIVERTECH.COM
DNS server found: 10.10.10.25
DNS server found: 10.10.10.28
https_init(): entered
-------------------------------------------------------------------------------------
Dump of local-side certificate information:
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Dump of server-side certificate information:
-------------------------------------------------------------------------------------
Cert Validation Code = 6000
-----BEGIN CERTIFICATE-----
MIIGSDCCBTCgAwIBAgIQCIfDfm8LQjuHfTN0UAfocjANBgkqhkiG9w0BAQUFADBj
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSIwIAYDVQQDExlEaWdpQ2VydCBHbG9iYWwgQ0EgKDIw
NDgpMB4XDTA4MTIwOTAwMDAwMFoXDTExMTIxMzIzNTk1OVoweDELMAkGA1UEBhMC
VVMxDTALBgNVBAgTBFV0YWgxFzAVBgNVBAcTDlNhbHQgTGFrZSBDSXR5MRswGQYD
VQQKExJEcml2ZXJUZWNoLCBMLkwuQy4xCzAJBgNVBAsTAklTMRcwFQYDVQQDFA4q
LnRydWNrLXBjLm5ldDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAohKTwvw9
WXJ68pUXWiIoPti3pTk8l1B+QNaT8p4dSzCt6Ei6BfrsBYARs3fqbgA5WsEgT8Fh
OM+olV9xURCvGcb3pBrkphtWJ7pt4PnrgJrcGoqrftaZfkKn8cxWd9FfugW+UkAB
r1A5xyCHdbYV1n7KhasYg6VRK4zDFxpcoxkCAwEAAaOCA2UwggNhMB8GA1UdIwQY
MBaAFENJR+fPQNGaqJLyjIrKmJPPyQgPMB0GA1UdDgQWBBQctf0RsV2uB1ydacmw
G7AAX34cxTAnBgNVHREEIDAegg4qLnRydWNrLXBjLm5ldIIMdHJ1Y2stcGMubmV0
MHoGCCsGAQUFBwEBBG4wbDAkBggrBgEFBQcwAYYYaHR0cD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fiYBHQeTgoj86zc
NiYqGCUboscywZ1u1zDDY5bU50TmF2+y1kCa5jKzynrdS/y/+8s06PWwHKv8Ymou
xT5OiJ6G5ckjSY1oeGMkpAL1jLLWL2RT/lqTcBY/jqAhmA3hQ7ciZcvSe2j2bu7R
pPZ/ynvOngEiRcN4AitBC6LYumy/F+PzlYR0KvYGEnpCS0zpWbBW6PuXW9iSilvx
Fs5U45ZoQqmhl7th/4d8l4HbDqQ4L0CKXhbjc7uCFlhdYbzHzr0pvSjO1GxWsB43
x59NntZgmkKxdAZ/W3YCY5Ts+zo/gky0vrcG6w==
-----END CERTIFICATE-----
Serial Number: 08:87:C3:7E:6F:0B:42:3B:87:7D:33:74:50:07:E8:72
Common Name: *.truck-pc.net
Country: US
State/Province: Utah
Locality: Salt Lake CIty
Org Unit: DriverTech, L.L.C.
Org: IS
Issuer CN: DigiCert Global CA (2048)
Issuer Country: US
Issuer Org: DigiCert Inc
Issuer Org Unit: www.digicert.com
Unknown Field: 03
Unknown Field: 20081208170000
Unknown Field: 20111213165959
Unknown Field: 1.2.840.113549.1.1.5

Protocol Used: TLS Version 1
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /WebServices/FleetWatcher/Reports/V1_9/ReportsService.asmx HTTP/1.1
Host: www.truck-pc.net
User-Agent: http-api/1.21
Content-Type: text/xml; charset=utf-8
Expect: 100-continue
Content-Length: 806
SOAPAction: http://fwapi.DriverTech.com/ReportsService_v2/VehiclePerformance_GetByDate

recvresp(): entered
SetError() #43: CommSSL_Read:  time-out!
senddoc(): entered

<?xml version="1.0" encoding="utf-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns="http://fwapi.DriverTech.com/CommonTypes/2009/04"; 
xmlns:rep="http://fwapi.DriverTech.com/ReportsService_v2";> 
  <soapenv:Header> 
  <ns:RequestHeader> 
    <ns:CompanyCode>CUST1</ns:CompanyCode> 
    <ns:UserName>USER1</ns:UserName> 
    <ns:Password>PWD1</ns:Password> 
    <ns:DataStoreName>STORE1</ns:DataStoreName> 
    <ns:DriverTechAPIVersion></ns:DriverTechAPIVersion> 
    <ns:RequestId></ns:RequestId> 
  </ns:RequestHeader> 
</soapenv:Header> 
<soapenv:Body> 
  <rep:VehiclePerformance_GetByDate> 
  <rep:StartDate>2009-05-01</rep:StartDate> 
  <rep:EndDate>2009-05-05</rep:EndDate> 
  <rep:QueryByReceiptDate>false</rep:QueryByReceiptDate> 
  </rep:VehiclePerformance_GetByDate> 
</soapenv:Body> 
</soapenv:Envelope>

recvresp(): entered
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Wed, 03 Jun 2009 13:39:37 GMT
Connection: close
Content-Length: 42


SetError() #13: HTTP/1.1 400 Bad Request
recvdoc parms: identity 42
header_load_cookies() entered
recvdoc(): entered
SetError() #0:
<h1>Bad Request (Invalid Header Name)</h1>
SetError() #13: HTTP/1.1 400 Bad Request
http_close(): entered
D2028H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE': 'DTECHBIND')

     FDTEODRELM IT   F   20        DISK
     FDTWSINB   O    E             DISK
     ?********************************************************************
     ?* EXTENSION SPECS
     ?********************************************************************
      /copy httpapi_h
D2028 /copy Dtech_Copy
     ?********************************************************************
     D StartOfElement  PR
     D   UserData                      *   value
     D   depth                       10I 0 value
     D   name                      1024A   varying const
     D   path                     24576A   varying const
     D   attrs                         *   dim(32767)
     D                                     const options(*varsize)

     D EndOfElement    PR
     D   UserData                      *   value
     D   depth                       10I 0 value
     D   name                      1024A   varying const
     D   path                     24576A   varying const
     D   value                    65535A   varying const
     D   attrs                         *   dim(32767)
     D                                     const options(*varsize)

     D Add_SOAPACTION  PR
     D   Header                    1024A   varying
     D   UserData                      *   value

     D SNDDTAQ         PR                  ExtPgm('QSNDDTAQ')
     D  Dtaqnme                      10a
     D  Dtaqlib                      10a
     D  DtaqLen                       5  0
     D  Dtaqdta                    4500a

     D  SendMesg       PR                  ExtPgm('SNDMSG')
     D   ErrUser                     10    const
     D   ErrMesg                    174    const

     D GETEODROLL      PR
     D  PmStrDte                     10A
     D  PmEndDte                     10A

     D GETEODROLL      PI
     D  PmStrDte                     10A
     D  PmEndDte                     10A
     ?********************************************************************
     D SOAP            s          32767A   varying
     D rc              s             10I 0
     D act             s             10I 0
     D count           s              4s 0
     D @first          s              1a   Inz('Y')
     D @len            s              2s 0 Inz
     D @pos            s              2s 0 Inz(10)
     D @WkFld          s             10a   Inz
     D @elm            s              3s 0 Inz
     D @idx            s              5s 0 Inz
     D DteIso          s               d   datfmt(*iso)
     D cnt1            s             10I 0
     D cnt2            s             10I 0
     D @RxTime         s                   Like(RxTim1) Inz(*All'0')
D2035D AttrNme         s             15a   Dim(200)
D2035D AttrVal         s             20a   Dim(200)

     D RxAry           ds
D2035D  DtaqAry                      10a   Dim(200) Inz(*All'0')

D2035D ArrTag          s             15a   Dim(200) FromFile(DTEODRELM)
D2035D ArrIdx          s              5s 0 Dim(200) Alt(ArrTag)
     ?*---------------------------------------------------------------------
     ?* Web Service Credentials for each individual account from control fil
     ?*---------------------------------------------------------------------
     D WScompany       s             15a   Inz
     D WScustnum       s             15a   Inz
     D WSusername      s             15a   Inz
     D WSpassword      s             15a   Inz
     D WSdtastore      s             10a   Inz
     D WSstrdate       s             10a   Inz
     D WSenddate       s             10a   Inz
D2035D WStimeout       c                   Const(1800)
     ?*---------------------------------------------------------------------
     D WkTime          ds
     D  WkCy                   1      4
     D  WkMo                   6      7
     D  WkDy                   9     10
     D  WkHr                  12     13
     D  WkMn                  15     16
     D  WkSs                  18     19
     D
     D WkTime1         ds
     D  WkCy1                  1      4
     D  WkMo1                  5      6
     D  WkDy1                  7      8
     D  WkHr1                  9     10
     D  WkMn1                 11     12
     D  WkSs1                 13     14

     ?********************************************************************
     ?* Main Driver - Calls Webservice & retrieves Messages.
     ?********************************************************************

      /free
       If PmStrDte = *Blanks and PmEndDte = *Blanks;
         DteIso    = %date;
         DteIso   -= %days(1);
         WSstrdate = %char(DteIso);
         WSenddate = %char(DteIso);
       Else;
         WSstrdate = PmStrDte;
         WSenddate = PmEndDte;
       EndIf;

       //?Retrieve values from DTCTL
D2028  Ctl_Init();
       WScompany  = Ctl_GetValue('WsCompanyCode': 'X');                   //?D2028
       WScustnum  = Ctl_Getvalue('WsCustNum': 'X');                       //?D2028
       WSusername = Ctl_Getvalue('WsUserName': 'X');                      //?D2028
       WSpassword = Ctl_Getvalue('WsPassword': 'X');                      //?D2028
       WSdtastore = Ctl_Getvalue('WsDataSource': 'X');                    //?D2028

       //?Note:  http_debug(*ON/*OFF) can be used to turn debugging
       //?       on and off.  When debugging is turned on, diagnostic
       //?       info is written to an IFS file named
       //?       /tmp/httpapi_debug.txt     Use "WRKLNK /tmp" cmd

       http_debug(*ON);

       HTTP_setCCSIDs(1208: 0);  // CCSID 1208 = UTF-8

         SOAP =
         '<?xml version="1.0" encoding="utf-8"?>' +
         ' <soapenv:Envelope' +
         ' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";' +
         ' xmlns:ns="http://fwapi.DriverTech.com/CommonTypes/2009/04";' +
         ' xmlns:rep="http://fwapi.DriverTech.com/ReportsService_v2";>' +
         ' <soapenv:Header>' +
         ' <ns:RequestHeader>' +
         ' <ns:CompanyCode>' +%trim(WScompany) + '</ns:CompanyCode>' +
         ' <ns:UserName>' + %trim(WSusername) + '</ns:UserName>' +
         ' <ns:Password>' + %trim(WSpassword) + '</ns:Password>' +
         ' <ns:DataStoreName>' + %trim(WSdtastore) + '</ns:DataStoreName>' +
         ' <ns:DriverTechAPIVersion></ns:DriverTechAPIVersion>' +
         ' <ns:RequestId></ns:RequestId>' +
         ' </ns:RequestHeader>' +
         ' </soapenv:Header>' +
         ' <soapenv:Body>' +
         ' <rep:VehiclePerformance_GetByDate>' +
         ' <rep:StartDate>' + %trim(WSstrdate) + '</rep:StartDate>' +
         ' <rep:EndDate>'   + %trim(WSenddate) + '</rep:EndDate>' +
         ' <rep:QueryByReceiptDate>false</rep:QueryByReceiptDate>' +
         ' </rep:VehiclePerformance_GetByDate>' +
         ' </soapenv:Body>' +
         ' </soapenv:Envelope>';

       //  This tells HTTPAPI to call our subprocedure (in this example,
       //  the subprocedure is name ADD_SOAPACTION) when assembling the
       //  HTTP headers to send to the remote server.

       http_xproc( HTTP_POINT_ADDL_HEADER
                 : %paddr(Add_SOAPACTION) );

       rc = http_url_post_xml(
            'https://www.truck-pc.net/WebServices/FleetWatcher/+
            Reports/V1_9/ReportsService.asmx'
            : %addr(SOAP) + 2
            : %len(SOAP)
            : %paddr(StartOfElement)
            : %paddr(EndOfElement)
            : *NULL
            : WStimeout
            : HTTP_USERAGENT
            : 'text/xml; charset=utf-8' );

       if (rc <> 1);
          SendMesg('QSYSOPR':
              'Web Service GETEODROLL failed. ' +
              '  Start Date: ' + %Trim(PmStrDte) +
              '  End Date: ' + %Trim(PmEndDte) +
              '  See /tmp/httpapi_debug.txt');
              http_crash();
              *inlr = *on;
       endif;

       *inlr = *on;

      /end-free

     ?********************************************************************
     ?* Procedure - Start of XML element
     ?********************************************************************
     P StartOfElement  B
     D StartOfElement  PI
     D   UserData                      *   value
     D   depth                       10I 0 value
     D   name                      1024A   varying const
     D   path                     24576A   varying const
     D   attrs                         *   dim(32767)
     D                                     const options(*varsize)
      /free

        if path = '/soap:Envelope/soap:Body';
           act += 1;
        endif;

      /end-free

     P                 E

     ?********************************************************************
     ?* Procedure - Add longer SOAPAction
     ?********************************************************************
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      * HTTPAPI will call this (because we set it with http_xproc)
      * just before sending the HTTP headers to the remote server.
      * This procedure lets us add any header we like to the
      * HTTP request.
      *
      * In this example, I'll use it to supply the SoapAction:
      * header.  This way, I can supply a SOAPAction that's up to
      * 1024 characters long.
      *
      * NOTE: Make sure you leave off the SOAPAction header on the
      *       HTTP_url_post_xml, above, otherwise you'll send two
      *       of them!
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P Add_SOAPACTION  B
     D Add_SOAPACTION  PI
     D   Header                    1024A   varying
     D   UserData                      *   value
      /free
         Header = 'SOAPAction: '
                + 'http://fwapi.DriverTech.com/'
                + 'ReportsService_v2/VehiclePerformance_GetByDate';
      /end-free
     P                 E

     ?********************************************************************
     ?* Procedure - End of XML element
     ?********************************************************************
     P EndOfElement    B
     D EndOfElement    PI
     D   UserData                      *   value
     D   depth                       10I 0 value
     D   name                      1024A   varying const
     D   path                     24576A   varying const
     D   value                    65535A   varying const
     D   attrs                         *   dim(32767)
     D                                     const options(*varsize)
      /free

         select;
           when name = 'Entry';
             clear RxRecf;
             clear AttrNme;
             clear AttrVal;
             Reset DtaqAry;
             cnt1 = 1;
             cnt2 = 1;
             dow attrs(cnt1) <> *NULL;
               AttrNme(cnt2) = %str(attrs(cnt1));
               cnt1 += 1;
               AttrVal(cnt2) = %str(attrs(cnt1));
               cnt1 += 1;
               cnt2 += 1;
             enddo;

             For cnt1 = 1 to cnt2;
               Select;
                 When AttrNme(cnt1) = 'DSRI' or        //?Ignore DSRI and DSRD        //?D2035
                      AttrNme(cnt1) = 'DSRD';
                 When AttrNme(cnt1) = 'Id';
                   RxSeq# = %dec(AttrVal(cnt1): 9: 0);
                 When AttrNme(cnt1) = 'Version';                                //?D2035
                   RxFld2 = AttrVal(cnt1);                                      //?D2035
                 When AttrNme(cnt1) = 'TruckName';
                   RxTrk# = AttrVal(cnt1);
                 When AttrNme(cnt1) = 'DriverLogon';
                   RxFld1 = AttrVal(cnt1);
                 When AttrNme(cnt1) = 'Date';
                   WkTime = AttrVal(cnt1);
                   WkCy1  = WkCy;
                   WkMo1  = WkMo;
                   WkDy1  = WkDy;
                   WkHr1  = WkHr;
                   WkMn1  = WkMn;
                   WkSs1  = WkSs;
                   RxTim1 = WkTime1;
                 When AttrNme(cnt1) = 'ReceivedOn';
                   WkTime = AttrVal(cnt1);
                   WkCy1  = WkCy;
                   WkMo1  = WkMo;
                   WkDy1  = WkDy;
                   WkHr1  = WkHr;
                   WkMn1  = WkMn;
                   WkSs1  = WkSs;
                   RxTim2 = WkTime1;
                 Other;
                   If %subst(AttrVal(cnt1): 1: 1) <> *Blank;
                     ReSet @pos;
                     @len = %CheckR(' ': AttrVal(cnt1));
                     @pos = (@pos - @len) + 1;
                     @elm = %Lookup(AttrNme(cnt1): ArrTag);
                     If @elm <> 0;
                       @idx = ArrIdx(@elm);
                       Monitor;
                         EvalR %SubSt(DtaqAry(@idx): @pos) =
                               %SubSt(AttrVal(cnt1):1: @len);
                       On-Error;
                       EndMon;
                     EndIf;
                   EndIf;
               EndSl;
             EndFor;
             If RxTim1 = *Blanks;
               RxTim1 = @RxTime;
             EndIf;
             If RxTim2 = *Blanks;
               RxTim2 = @RxTime;
             EndIf;
             %Subst(RxRecd: 41) = RxAry;
             Write RxRecf;
         EndSl;

      /end-free

     P                 E
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------