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

RE: Fw: HTTPAPI ver 1.13.1




German,

Did you need to change any parameters in the program (ie:  ASCII codes to 1208), or do you use HTTPAPI without any changes?  Also, could you include a listing of the RPG that you have that calls the following webservice?  Any help would be appreciated.

Thanks Much,
Dana Anderson
Patterson Companies




"Mendoza, German   \(RCIS\)" <German.Mendoza@xxxxxxxx>
Sent by: owner-ftpapi@xxxxxxxxxxxxx

04/10/2006 03:13 PM

Please respond to
ftpapi@xxxxxxxxxxxxx

To
<ftpapi@xxxxxxxxxxxxx>
cc
Subject
RE: Fw: HTTPAPI ver 1.13.1





Dana,
I’m not sure about the encoding because we have a web service here that I can consume with the utf-8 encoding.  I will attach the complete code I have which works for me.  The only real difference I see between mine and yours is the URI of the SOAPAction (your web service is expecting tempuri.org) and the parameters the web service expects.  Here’s what our web service is asking for and what it returns.  Basically it wants 3 parameters: Crop Year, State ID, and Insurance Type and returns back one string.  This works fine for me using HTTPAPI version 1.15  (it worked on 1.13 as well).
 
 
 
 
SOAP
The following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values.
POST /CimaxReturnType_clsXMLReturn.asmx HTTP/1.1
Host: dvcifyiapp1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://rcis.com/LoadROList"
 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <LoadROList xmlns="http://rcis.com/">
      <sintCropYear>short</sintCropYear>
      <sintStateId>short</sintStateId>
      <sintInsuranceType>short</sintInsuranceType>
    </LoadROList>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
 
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <LoadROListResponse xmlns="http://rcis.com/">
      <LoadROListResult>string</LoadROListResult>
    </LoadROListResponse>
  </soap:Body>
</soap:Envelope>
 
 
 



From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On Behalf Of Dana.Anderson@xxxxxxxxxxxxxxxxxxx
Sent:
Friday, April 07, 2006 2:11 PM
To:
ftpapi@xxxxxxxxxxxxx
Cc:
owner-ftpapi@xxxxxxxxxxxxx
Subject:
RE: Fw: HTTPAPI ver 1.13.1

 

Thanks German,


I'm sort of at a loss right now.  It seems to me to be something to do with encoding.


Dana Anderson



Most Recent Debug Listing




Program Source Code

/Free                                                                    
 SOAPMsg =                                                              
  '<?xml version="1.0" encoding="UTF-8" ?>'                            +
     '<soap:Envelope'                                                  +
            ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'   +
            ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"'            +
            ' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
        '<soap:Body>'                                                  +
          '<AnalyseDocument xmlns="http://tempuri.org/">'              +
            '<document>'                                               +
               XMLStr                                                  +
            '</document>'                                              +
          '</AnalyseDocument>'                                         +
        '</soap:Body>'                                                 +
      '</soap:Envelope>';                                                

                                                                         
 http_debug(*ON);                                                        


 rc = http_url_post_xml(                                            
       'http://nt124a131/ivatengineservice/engineservice.asmx'      
        : %addr(SOAPMsg) + 2                                        
        : %len(SOAPMsg)                                              

        : %paddr(StartOfElement)                                    
        : %paddr(EndOfElement)                                      
        : %addr(Response)                                            

        : HTTP_TIMEOUT                                              
        : HTTP_USERAGENT                                            
        : 'text/xml; charset=utf-8'                                  

        : 'http://tempuri.org/AnalyseDocument');                    
                                                                     
/End-Free                                                            



Instuctions given us by the web service:

================================================================================

POST /ivatengineservice/engineservice.asmx HTTP/1.1
Host: nt124a131
Content-Type: text/xml; charset=utf-8
Content-Length:
length
SOAPAction: "http://tempuri.org/AnalyseDocument"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
  <AnalyseDocument xmlns="http://tempuri.org/">
    <document>
string</document>
  </AnalyseDocument>
</soap:Body>
</soap:Envelope>



"Mendoza, German   \(RCIS\)" <German.Mendoza@xxxxxxxx>
Sent by: owner-ftpapi@xxxxxxxxxxxxx

04/07/2006 01:42 PM


Please respond to
ftpapi@xxxxxxxxxxxxx


To
<ftpapi@xxxxxxxxxxxxx>
cc
 
Subject
RE: Fw: HTTPAPI ver 1.13.1

 


   





Sender: "Mendoza, German   \(RCIS\)" <German.Mendoza@xxxxxxxx>

Dana,
Can you please repost the source to your program?  I'll try to see if I
can find anything in there (along with the most recent httpapi_debug.txt
you sent earlier today).

-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx] On
Behalf Of Scott Klement
Sent: Friday, April 07, 2006 12:33 PM
To: ftpapi@xxxxxxxxxxxxx
Subject: RE: Fw: HTTPAPI ver 1.13.1

Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


iconv() is indeed a system API.  Also, there was nothing in the debug
log
to indicate that it was having translation problems.  I don't think Dana

is on the right track.


On Fri, 7 Apr 2006, Mendoza, German   (RCIS) wrote:
>
> Iconv() is a system API so there's no way to step through the
source...
> somebody please correct me if I'm wrong!
>
-----------------------------------------------------------------------
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
-----------------------------------------------------------------------

H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('LIBHTTP/HTTPAPI')
                                                       
D/copy libhttp/qrpglesrc,httpapi_h                     
                                                       
D count           s             10I 0                  
D rc              s             10I 0                  
D x               s             10I 0                  
D msg             s             52A                    
D CRLF            C                   CONST(x'0d25')   
D data            S           1024A   Varying          
 *                                                     
D odslist         ds                  occurs(200)      
D   ods_STRING                1024A   varying          
**                                                     
D addCount        PR                                   
D   void                          *                    
D   depth                       10I 0 value            
D   name                      1024A   varying const    
 *                                                     
D mapData         PR                                                       
D   void                          *                                        
D   depth                       10I 0 value                                
D   name                      1024A   varying const                        
D   path                     24576A   varying const                        
D   value                    32767A   varying const                        
 *                                                                         
c                   eval      *inlr = *on                                  
 /free                                                                     
  data =                                                                   
  '<?xml version="1.0" encoding="utf-8"?>' + CRLF +                        
  '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";' + 
  ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"; ' +                       
  'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>' + CRLF +       
  '  <soap:Body>' + CRLF +                                                 
  '    <LoadROList xmlns="http://rcis.com/";>' + CRLF +                     
  '      <sintCropYear>2005</sintCropYear>' + CRLF +                       
  '      <sintStateId>27</sintStateId>' + CRLF +                           
  '      <sintInsuranceType>11</sintInsuranceType>' + CRLF +               
  '    </LoadROList>' + CRLF +                                             
  '  </soap:Body>' + CRLF +                                                   
  '</soap:Envelope>';                                                         
                                                                              
  http_debug(*On);                                                            
  rc = http_url_POST_XML('http://dvcifyiapp1:8080/'                           
                   + 'CimaxReturnType_clsXMLReturn.asmx'                      
                   : %addr(data) + 2                                          
                   : %len(data)                                               
                   : %paddr(addCount)                                         
                   : %paddr(mapData)                                          
                   : *NULL                                                    
                   : HTTP_TIMEOUT                                             
                   : HTTP_USERAGENT                                           
                   : 'text/xml; charset=utf-8'                                
                   : '"http://rcis.com/LoadROList";');                         
                                                                              
  if rc <> 1;                                                                 
    msg = http_error();                                                       
    dsply msg;                                                                
  endif;                                                                      
                                                    
  for x = 1 to count;                               
    %occur(odslist) = x;                            
  endfor;                                           
                                                    
  return;                                           
 /end-free                                          
P addCount        B                                 
D addCount        PI                                
D   void                          *                 
D   depth                       10I 0 value         
D   name                      1024A   varying const 
 /free                                              
    if name = 'LoadROListResult';                   
       count = count + 1;                           
       %occur(odslist) = count;                     
    endif;                                          
 /end-free                                          
P                 E                                 

                                                      
P mapData         B                                   
D mapData         PI                                  
D   void                          *                   
D   depth                       10I 0 value           
D   name                      1024A   varying const   
D   path                     24576A   varying const   
D   value                    32767A   varying const   
 /free                                                
    if name = 'LoadROListResult';                     
      ods_STRING = %trim(value);                      
    endif;                                            
 /end-free                                            
P                 E                                                                                       =