Iconv() is a system API so there’s
no way to step through the source… somebody please correct me if I’m
wrong!
 
From:
owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On Behalf Of Dana.Anderson@xxxxxxxxxxxxxxxxxxx
Sent: Friday, April 07, 2006 9:26
AM
To: ftpapi@xxxxxxxxxxxxx
Subject: Re: Fw: HTTPAPI ver
1.13.1
 
 
Good Mornign All, 
I
have done some debugging and I think I have narrowed the problem down to the
following:  Before the call to procedure 
"
callp     iconv( ToASCII
. . . " peSize =
230.  I added a work variable WrkpeData.  Before the call to iconv
the values of peData is: 
POST
/ivatengineservice/engineservice.asmx HTTP/1.1 
Host:
nt124a131 
User-Agent:
http-api/1.15 
Content-Type:
text/xml; charset=utf-8 
SOAPAction:
http://tempuri.org/AnalyseDocument 
Expect:
100-continue 
Content-Length:
2873 
After
the call to iconv, Size and OutSize are "0" and peData is blank.  
In
debug mode I cannot step into the procedure iconv to see what is happenning.  Since
the peData is blanks, I feel that is what is causing 
the
error messge"SetError() #13: HTTP/1.1 400 Bad Request".
How
do I step into the iconv subroutine to see what is happenning?  Any
suggestions?  (Also, a word to note, I am connecting to a web service that
is located in our intranet.) 
Thanks,
 Dana 
 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 *
CCSIDxlate():  Translate data from ASCII <--> EBCDIC    
    
 *
               using a pointer to the
data.                 
 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
P
CCSIDxlate      B            
                     
          
D
CCSIDxlate      PI            10I
0                      
    
D
  peSize                  
   10I 0 value              
      
D
  peData                  
     *   value            
        
D
  peDirection                
 1A   const                
    
 
                     
                     
                  
D
Size            s        
    10U 0                
          
D
OutSize         s            
10U 0                    
      
D
WrkpeData       s          32767A
  Varying                  
 
                     
                     
                  
 /if
not defined(HTTP_USE_TABLES)              
                
 
                     
                     
                  
c
                  if    
   Tables_Set = *OFF              
  
c
                  if    
   HTTP_SetCCSIDs( HTTP_ASCII        
c
                     
                    :
HTTP_EBCDIC ) < 0 
c
                  return  
 -1                    
            
c
                  endif  
                     
              
c
                  endif  
                     
              
 
                     
                     
                  
c
                  eval  
   Size = peSize              
      
c
                  eval  
   OutSize = peSize              
    
 
                     
                     
                  
c            
      eval      WrkpeData = %str(peData)          
c
                  if    
   peDirection = TO_ASCII            
c
                  callp     iconv( ToASCII    
               
c            
                     :
peData                     
c            
                     :
Size                    
  
c            
                     :
peData                     
c            
                     :
OutSize )        
          
c
                  else  
                     
                
c
                  callp  
  iconv( ToEBCDIC                
  
c
                     
           : peData        
    
c
                     
           : Size        
      
c
                     
           : peData        
    
c
                     
           : OutSize )      
  
c
                  endif  
                     
      
c            
      eval      WrkpeData = %str(peData) 
 
                     
                     
          
 /endif
                     
                     
    
 
                     
                     
          
c
                  return  
 0                    
    
P
                E      
                     
        
 
  | 
   Scott Klement
  <sk@xxxxxxxxxxxxxxxx>  
  Sent
  by: owner-ftpapi@xxxxxxxxxxxxx  
  04/06/2006 11:36 AM  
  
   
    | 
     Please
    respond to 
    ftpapi@xxxxxxxxxxxxx 
     | 
    
   
   
   | 
  
  
   
    | 
     To 
     | 
    
     ftpapi@xxxxxxxxxxxxx  
     | 
    
   
    | 
     cc 
     | 
    
       
     | 
    
   
    | 
     Subject 
     | 
    
     Re: Fw: HTTPAPI ver 1.13.1 
     | 
    
   
    
  
   
   | 
 
Sender:
Scott Klement <sk@xxxxxxxxxxxxxxxx>
Hi Dana,
If you look at the debug log (or, call
HTTP_Error() to get an error 
message) you'll see that HTTPAPI is returning the
following error message:
"400 Bad Request".
This is an error message that the HTTP server is
sending you -- it's not 
HTTPAPI generating the error, it's the server.
 All HTTPAPI does is relay 
it to you.
According to the HTTP standards, The message means
that the server didn't 
like the HTTP request that was sent.  I'm NOT
speaking from experience, 
however, that's just what the docs say.  I've
never received this error in 
my life.
Here's what the HTTP request looks like, according
to your debug log:
POST /ivatengineservice/engineservice.asmx
HTTP/1.1
Host: nt124a131
Content-Type: text/xml; charset=US-ASCII
SOAPAction:
"http://tempuri.org/AnalyseDocument"
Expect: 100-continue
Content-Length: 2875
A few things strike me as odd about this:
a) There's no user-agent field.
b) The content type claims character set US-ASCII,
but elsewhere in the 
debug log it says:
      <?xml
version="1.0" encoding="utf-8"?>
    and
       New iconv() objects
set, ASCII=819. EBCDIC=0":
Seems to me that both the content-type and
<?xml> tag should say 
ISO-8859-1, since that's what CCSID 819 is.
c) The Host: field doesn't have a domain attached
to the host name.
d) The SOAPAction: field has quotes around it, and
points to a different 
domain than the Host: field does.
Now, I don't know which of these (if any) is
causing the problem. These 
are just what stands out about your document.
---
Scott Klement  http://www.scottklement.com
On Thu, 6 Apr 2006,
Dana.Anderson@xxxxxxxxxxxxxxxxxxx wrote:
> Hi Scott,
>
> Thanks for the info on the debug.
>
> I have attached a debug log.  The XML
itself does work.  A Delphi tool was
> developed in house by someone else to test
the XML against the web
> service.  So I know the XML string for
the document works.
>
> The POST information was supplied to me by the
Web Service.  The only
> difference is the "Expect:
100-continue" section.  But it fails with or
> without it.
>
> How does the "encoding attribute' affect
things?  Again, the value of
> "utf-8" was supplied to me by the
Web Service vendor.  I have tried the
> program with both of the following strings
and both have received an
> error"
>
> Content-Type: text/xml; charset=utf-8
> Content-Type: text/xml; charset=US-ASCII
>
> Would you be able to steer me in a direction
here?  Is there anything that
> may jump out at you?
>
> Thansk Much,
>
> Dana Anderson
> Patterson Companies
> St.
  Paul, MN
>
>
>
>
>
>
> Scott Klement <sk@xxxxxxxxxxxxxxxx>
> Sent by: owner-ftpapi@xxxxxxxxxxxxx
> 04/05/2006 05:56 PM
> Please respond to
> ftpapi@xxxxxxxxxxxxx
>
>
> To
> "'ftpapi@xxxxxxxxxxxxx'"
<ftpapi@xxxxxxxxxxxxx>
> cc
>
> Subject
> Re: Fw: HTTPAPI ver 1.13.1
>
>
>
>
>
>
> Sender: Scott Klement
<sk@xxxxxxxxxxxxxxxx>
>
>
>> I have a question:  I installed it
fine and am working through the
>> process.  I am getting a -1 back
from the Send() function call in the
>> CommTCP_BlockWrite procedure.  I
can't locate the source for the "Send"
>> procedure and was trying to find it in
order to debug the process.  Is
>> this an object that is even available for
viewing?
>
> send() is part of the operating system
(OS/400 or i5/OS).
>
> Instead of telling us that send() is
returning -1 (which may not even be
> an error!) can you please create a debug log
and tell us what you find in
> it?  (Or, post the log here?)
>
> To do that, insert the following to your
program before it calls HTTPAPI:
>
>     http_debug(*ON);
>
>
>>
>> Anything look odd to you below?
>
> Sure, there are a few odd things:
>
> a) You've specified the encoding as
"utf-8" but as far as I can tell,
> it's not.  Unless you've modified the
way HTTPAPI works, it doesn't
> convert from EBCDIC to UTF-8, it converts
from EBCDIC to ISO-8859-1.
>
> b) Your XML code is missing all of the +
(concatenation) characters needed
>
> to create an XML document in an EVAL
statement.  So your code wouldn't
> even compile.
>
> But none of these would cause a problem with
the send() API.  Please post
> the debug log, or at the very least, call the
http_error() subprocedure to
>
> get an error message.  As it stands, I
don't have enough information to
> help you.
>
>
-----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To
unsubsribe from the list send mail
> to majordomo@xxxxxxxxxxxxx with the body:
unsubscribe ftpapi mymailaddr
>
-----------------------------------------------------------------------
>
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To
unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body:
unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------