[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Invalid Header Name
Scott,
I've changed the logs to .txt documents. You can compile and run the attached program (GETEODROLL). However, I will need an IP address you will be using so that it can be white listed. This is a private service.
Also, the access credentials are made up, so that if you get past the POST problem you will receive an Authentication Failure.
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) 487-2775
E-mail: karl.woods@xxxxxxxxxxxxxx
LiveSTRONG
....... __o Same Road
....... \<, Same Rules
.... ( )/ ( ) Same Rights
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.
-----Original Message-----
From: Scott Klement [mailto:sk@xxxxxxxxxxxxxxxx]
Sent: Monday, July 06, 2009 12:13 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Invalid Header Name
Hi Karl,
Please make it easier for us to help you.
a) Please provide code that we can load and run on our machines. (Your
code refers to files that we don't have)
b) Please provide the code & log files in TEXT format, not (blech) RTF,
which is really really hard to read.
c) Are we allowed to try this web service?
Karl Woods wrote:
> I'm sending this out once again in the hopes that someone can help me
> get this working.
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
soapUI
POST https://www.truck-pc.net/WebServices/FleetWatcher/Reports/V1_9/ReportsService.asmx HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://fwapi.DriverTech.com/ReportsService_v2/VehiclePerformance_GetByDate"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: www.truck-pc.net
Content-Length: 882
<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>&VAR1</ns:CompanyCode>
<ns:UserName>&VAR2</ns:UserName>
<ns:Password>&VAR3</ns:Password>
<ns:DataStoreName>&VAR4</ns:DataStoreName>
<ns:DriverTechAPIVersion></ns:DriverTechAPIVersion>
<ns:RequestId></ns:RequestId>
</ns:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<rep:VehiclePerformance_GetByDate>
<rep:StartDate>2009-06-01</rep:StartDate>
<rep:EndDate>2009-06-01</rep:EndDate>
<rep:QueryByRecordDate>false</rep:QueryByRecordDate>
</rep:VehiclePerformance_GetByDate>
</soapenv:Body>
</soapenv:Envelope>
</soapenv:Body>
</soapenv:Envelope>
HTTPAPI_DEBUG
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
VQQKExJEcml2ZXJUZWNoLCBMLkwuQ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AHQAdQB0AGUAcwAgAGEAYwBjAGUA
cAB0AGEAbgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAgAEMA
UAAvAEMAUABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQAGEA
cgB0AHkAIABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBtAGkA
dAAgAGwAaQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBjAG8A
cgBwAG8AcgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIA
ZQBuAGMAZQAuMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG
9w0BAQUFAAOCAQEAQFJs8ULSbMli7ggjfnsSAryOlBE0f5sa8fiYBHQeTgoj86zc
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.23
Content-Type: text/xml; charset=utf-8
Expect: 100-continue
Content-Length: 804
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>&VAR1</ns:CompanyCode>
<ns:UserName>&VAR2</ns:UserName>
<ns:Password>&VAR3</ns:Password>
<ns:DataStoreName>&VAR4</ns:DataStoreName>
<ns:DriverTechAPIVersion></ns:DriverTechAPIVersion>
<ns:RequestId></ns:RequestId>
</ns:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<rep:VehiclePerformance_GetByDate>
<rep:StartDate>2009-06-01</rep:StartDate>
<rep:EndDate>2009-06-01</rep:EndDate>
<rep:QueryByRecordDate>false</rep:QueryByRecordDate>
</rep:VehiclePerformance_GetByDate>
</soapenv:Body>
</soapenv:Envelope>
recvresp(): entered
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Mon, 29 Jun 2009 20:19:42 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
H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')
?********************************************************************
?* EXTENSION SPECS
?********************************************************************
/copy libhttp/qrpglesrc,httpapi_h
?********************************************************************
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 AttrNme s 15a Dim(200)
D AttrVal s 20a Dim(200)
D RxAry ds
D DtaqAry 10a Dim(200) Inz(*All'0')
?*---------------------------------------------------------------------
?* 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
D 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
WSstrdate = '2009-06-01';
WSenddate = '2009-06-01';
//?Retrieve values from DTCTL
WScompany = 'DRVTCH';
WScustnum = '5000';
WSusername = 'DTReporting';
WSpassword = 'ABC123';
WSdtastore = 'PROD';
//?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 = *Blanks;
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:QueryByRecordDate>false</rep:QueryByRecordDate>' +
' </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(WSstrdate) +
' End Date: ' + %Trim(WSenddate) +
' See /tmp/httpapi_debug.txt');
http_crash();
*inlr = *on;
endif;
*inlr = *on;
/end-free
?********************************************************************
?* 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 - 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 - 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';
EndSl;
/end-free
P E
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------