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

How can i get XML result after execution of 'http_url_post_xml'



   Hi,
   I was able to execute a webservice using basic authentication.
   The `debug' file shows that service is executed properly and result
   seems to be ok
   BUT...
   How can I retrieve the returned XML data `XML Result'?
   Regards.
   FYI, herewith RPG app + Debugfile
   RPG APP  (based on `EXAMPLE18' of LIBHTTP)
         *  This is an example of calling a SOAP Web service w/HTTPAPI.
         *
         *  To Compile (requires V5R1):
         *     CRTBNDRPG PGM(CODASOAP) SRCFILE(libhttp/QRPGLESRC)
         *
         *  To Run:
         *     CALL CODASOAP
         *
         *
        H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')
        D CODASOAP        PR                  ExtPgm('CODASOAP')
        D*   Country1                     3A   const
        D*   Country2                     3A   const
        D*   Amount                      15P 5 const
        D CODASOAP        PI
        D*   Country1                     3A   const
        D*   Country2                     3A   const
        D*   Amount                      15P 5 const
         /copy httpapi_h
        D Incoming        PR
        D   rate                         8F
        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 SOAP            s          32767A   varying
        D rc              s             10I 0
        D rate            s              8F
        D Result          s             12P 2
         /free
          http_debug(*ON);
          http_debug_file = '/home/pgo/debugpat.txt';
          http_XmlStripCRLF(*ON);
          SOAP = '<?xml version="1.0" encoding="utf-8"?>'
          +'<soapenv:Envelope xmlns:soapenv='
          +   '"[1]http://schemas.xmlsoap.org/soap/envelope/"; '
          +'xmlns:web="http://www.coda.com/efinance/schemas/'
          +   'elementmaster/elementmaster-12.0/webservice" '
          +'xmlns:com="[2]http://www.coda.com/efinance/schemas/common"; '

   +'xmlns:elem="[3]http://www.coda.com/efinance/schemas/elementmaster";>'
          +'<soapenv:Header>'
          +'   <web:Options company="Q" user="INSTALL" />'
          +'</soapenv:Header>'
          +'<soapenv:Body>'
          +'   <web:GetRequest>'
          +'      <web:Key>'
          +'         <elem:CmpCode>Q</elem:CmpCode>'
          +'         <elem:Level>3</elem:Level>'
          +'         <elem:Code>000049</elem:Code>'
          +'      </web:Key>'
          +'   </web:GetRequest>'
          +'</soapenv:Body>'
          +'</soapenv:Envelope>';
            http_setAuth(HTTP_AUTH_BASIC:'USERID':'PASSWORD');
          rc = http_url_post_xml(

   'http://Coda/coda/services/finance/elementmaster/elementmaster-12.0'
                            : %addr(SOAP) + 2
                            : %len(SOAP)
                            : *NULL
                            : %paddr(Incoming)
                            : %addr(rate)
                            : HTTP_TIMEOUT
                            : HTTP_USERAGENT
                            : 'text/xml'
                   :
   'uri-coda-webservice/12.000.0729/finance/ElementMaster/Get');
          if (rc <> 1);
             http_crash();
          else;
             dsply 'OK';
          endif;
          *inlr = *on;
         /end-free
        P Incoming        B
        D Incoming        PI
        D   rate                         8F
        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 atof            PR             8F   extproc('atof')
        D   string                        *   value options(*string)
         /free
             if (name = 'ConversionRateResult');
           //     rate = atof(value);
             endif;
         /end-free
        P                 E
   DEBUG-resultfile
   HTTPAPI Ver 1.23 released 2008-04-24
   OS/400 Ver V7R1M0
   New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
   http_setauth(): entered
   http_persist_open(): entered
   http_long_ParseURL(): entered
   DNS resolver retrans: 3
   DNS resolver retry  : 5
   DNS resolver options: x'00000136'
   DNS default domain: CLIPPERSUPPORT.BE
   DNS server found: 10.0.0.180
   DNS server found: 10.0.0.14
   http_persist_post(): entered
   http_long_ParseURL(): entered
   do_post(): entered
   POST /coda/services/finance/elementmaster/elementmaster-12.0 HTTP/1.1
   Host: Coda
   User-Agent: http-api/1.23
   Content-Type: text/xml
   SOAPAction: uri-coda-webservice/12.000.0729/finance/ElementMaster/Get
   Expect: 100-continue
   Content-Length: 635
   Authorization: Basic SU5TVEFMTFxROk9BUw==
   recvresp(): entered
   HTTP/1.1 100 Continue
   SetError() #13: HTTP/1.1 100 Continue
   senddoc(): entered
   <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
   xmlns:soapenv="[4]http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:web="[5]http://www.coda.com/efinance/schemas/elementmaster/elemen
   tmaster-12.0/webservice"
   xmlns:com="[6]http://www.coda.com/efinance/schemas/common";
   xmlns:elem="[7]http://www.coda.com/efinance/schemas/elementmaster";><soa
   penv:Header>   <web:Options company="Q" user="INSTALL"
   /></soapenv:Header><soapenv:Body>   <web:GetRequest>      <web:Key>
       <elem:CmpCode>Q</elem:CmpCode>         <elem:Level>3</elem:Level>
         <elem:Code>000049</elem:Code>      </web:Key>
   </web:GetRequest></soapenv:Body></soapenv:Envelope>
   recvresp(): entered
   HTTP/1.1 200 OK
   Content-Length: 5188
   Content-Type: text/xml;charset=utf-8
   Server: Microsoft-IIS/7.5
   X-Powered-By: ASP.NET
   Date: Tue, 11 Dec 2012 15:00:22 GMT
   SetError() #13: HTTP/1.1 200 OK
   recvdoc parms: identity 5188
   header_load_cookies() entered
   recvdoc(): entered
   SetError() #0:
   <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
   xmlns:soapenv="[8]http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:xsd="[9]http://www.w3.org/2001/XMLSchema";
   xmlns:xsi="[10]http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body
   ><webservice:GetResponse
   xmlns:webservice="[11]http://www.coda.com/efinance/schemas/elementmaste
   r/elementmaster-12.0/webservice"
   xmlns:com="[12]http://www.coda.com/efinance/schemas/common";
   xmlns:elm="[13]http://www.coda.com/efinance/schemas/elementmaster";
   xmlns:udf="[14]http://www.coda.com/common/schemas/udfmaster";><webservic
   e:CmpCode>Q</webservice:CmpCode><webservice:Level>3</webservice:Level><
   webservice:Code>000049</webservice:Code><webservice:Element><elm:TimeSt
   amp>2</elm:TimeStamp><elm:TaxesTimeStamp>2</elm:TaxesTimeStamp><elm:Cmp
   Code>Q</elm:CmpCode><elm:Code>000049</elm:Code><elm:Level>3</elm:Level>
   <elm:Name>AGEPORT AG.Y ESTIBADORES
   PORTUARIOS</elm:Name><elm:ShortName>AGEPORT</elm:ShortName><elm:Currenc
   yCode>EUR</elm:CurrencyCode><elm:SubAnalyse>sometimes</elm:SubAnalyse><
   elm:TaxCode/><elm:AccountType>look_left</elm:AccountType><elm:DateAccou
   ntOpened>2012-07-31T00:00:00.000Z</elm:DateAccountOpened><elm:Compulsor
   yDescr>false</elm:CompulsoryDescr><elm:KeepTurnover>false</elm:KeepTurn
   over><elm:AccountSummary>AS-REL</elm:AccountSummary><elm:ElementStatus/
   ><elm:ExternalValidation/><elm:MemoStatus/><elm:BalancingAccount/><elm:
   SubsLevel>0</elm:SubsLevel><elm:SubsElement/><elm:Matchable>true</elm:M
   atchable><elm:Summary>acct_level</elm:Summary><elm:Split>none</elm:Spli
   t><elm:Settlement/><elm:ForceDisperse>forcedisp</elm:ForceDisperse><elm
   :UserStatus/><elm:PayStatus>available</elm:PayStatus><elm:RecStatus>ava
   ilable</elm:RecStatus><elm:EnablePay>true</elm:EnablePay><elm:DefaultMe
   dia/><elm:PaperMedia>false</elm:PaperMedia><elm:ElecMedia>true</elm:Ele
   cMedia><elm:PayNumber>0</elm:PayNumber><elm:CustomerSupplier>true</elm:
   CustomerSupplier><elm:IsCustomer>true</elm:IsCustomer><elm:IsSupplier>t
   rue</elm:IsSupplier><elm:DiscountEnable>no</elm:DiscountEnable><elm:Tax
   Method>net</elm:TaxMethod><elm:Terms>D030</elm:Terms><elm:TaxAdjustment
   >false</elm:TaxAdjustment><elm:TaxRepESL>false</elm:TaxRepESL><elm:TaxR
   epIntra>false</elm:TaxRepIntra><elm:VAT/><elm:Ten99>false</elm:Ten99><e
   lm:FederalTax/><elm:SocialSecurity/><elm:Ten99Code/><elm:SecondTIN>fals
   e</elm:SecondTIN><elm:SIC/><elm:CreditManager/><elm:CreditRating/><elm:
   CreditRatingDate>2012-07-31T00:00:00.000Z</elm:CreditRatingDate><elm:Cr
   editReference/><elm:CreditAgency/><elm:PaymentIndex/><elm:ForceCreditLi
   mit>false</elm:ForceCreditLimit><elm:IndirectCode/><elm:CreditLimit>0.0
   0</elm:CreditLimit><elm:CreditLimitCurrency>credit_lim_home</elm:Credit
   LimitCurrency><elm:ArcRecon>arc_no_allow_override</elm:ArcRecon><elm:Ar
   cPaid>arc_no_allow_override</elm:ArcPaid><elm:Shared>false</elm:Shared>
   <elm:PostedTo>false</elm:PostedTo><elm:PromptForAsset>false</elm:Prompt
   ForAsset><elm:AssetCategory/><elm:ProcOrders/><elm:ProcRequisitions/><e
   lm:BillingAllowPrinting>false</elm:BillingAllowPrinting><elm:BillingTra
   nsmitPDF>false</elm:BillingTransmitPDF><elm:BillingTransmitXML>false</e
   lm:BillingTransmitXML><elm:BillingSIProForma/><elm:BillingSIFinal/><elm
   :BillingCNProForma/><elm:BillingCNFinal/><elm:CreateDate>2012-09-18T00:
   00:00.000Z</elm:CreateDate><elm:ModifyDate>2012-11-16T00:00:00.000Z</el
   m:ModifyDate><elm:User>INSTALL</elm:User><elm:PunchoutCode/><elm:Puncho
   utMarketplace>false</elm:PunchoutMarketplace><elm:PunchoutUrl/><elm:Pun
   choutDomain/><elm:PunchoutEncoding>null</elm:PunchoutEncoding><elm:Punc
   houtUser/><elm:PunchoutPassword/><elm:PunchoutItemDetailsCode/><elm:Aut
   oReceipt>false</elm:AutoReceipt><elm:ProcStatus>false</elm:ProcStatus><
   elm:ToleranceCode/><elm:MatchingOffset>0</elm:MatchingOffset><elm:ProcT
   ransLimit>0</elm:ProcTransLimit><elm:ProcCalloffs/><elm:ProcGRNs/><elm:
   ProcReturns/><elm:BillingOutputDevice/><elm:EUVATCode/><elm:Translation
   s><elm:List/></elm:Translations><elm:LongName/><elm:Quantities/><elm:Di
   scounts/><elm:Addresses><elm:Address><elm:DefaultAddress>true</elm:Defa
   ultAddress><elm:Tag>1</elm:Tag><elm:Name>AGEPORT AG.Y ESTIBADORES
   PORTUARIOS</elm:Name><elm:Address1>MIRADOR APT.401,ENSACHE BELLA
   VISTA</elm:Address1><elm:Address2/><elm:Address3/><elm:Address4/><elm:A
   ddress5/><elm:Address6>P.O.BOX
   22205</elm:Address6><elm:PostCode/><elm:Tel>0018095357758</elm:Tel><elm
   :Fax>0018095354116</elm:Fax><elm:Country>DO</elm:Country><elm:Language>
   EN</elm:Language><elm:Category>LEGAL</elm:Category><elm:EMail>[15]agepo
   rt@xxxxxxxxxxxxxx</elm:EMail></elm:Address><elm:Address><elm:DefaultAdd
   ress>false</elm:DefaultAddress><elm:Tag>2</elm:Tag><elm:Name>AGEPORT AG
   .Y ESTIBADORES
   PORTUARIOS</elm:Name><elm:Address1>[16]MDIAZ@xxxxxxxxxxx</elm:Address1>
   <elm:Address2/><elm:Address3/><elm:Address4/><elm:Address5/><elm:Addres
   s6/><elm:PostCode/><elm:Tel/><elm:Fax/><elm:Country/><elm:Language>EN</
   elm:Language><elm:Category>EMAIL</elm:Category><elm:EMail/></elm:Addres
   s></elm:Addresses><elm:Banks/><elm:Comments/><elm:Groups><elm:GroupCode
   >3REL</elm:GroupCode><elm:GroupCode>3K</elm:GroupCode></elm:Groups><elm
   :Medias/><elm:LeftRules/><elm:RightRules/><elm:Mnemonics/><elm:Punchout
   AdvancedParams/><elm:OutputDevices/></webservice:Element></webservice:G
   etResponse></soapenv:Body></soapenv:Envelope>
   http_close(): entered
   Patrick Goovaerts
   Systems & Development

References

   1. http://schemas.xmlsoap.org/soap/envelope/
   2. http://www.coda.com/efinance/schemas/common
   3. http://www.coda.com/efinance/schemas/elementmaster
   4. http://schemas.xmlsoap.org/soap/envelope/
   5. http://www.coda.com/efinance/schemas/elementmaster/elementmaster-12.0/webservice
   6. http://www.coda.com/efinance/schemas/common
   7. http://www.coda.com/efinance/schemas/elementmaster
   8. http://schemas.xmlsoap.org/soap/envelope/
   9. http://www.w3.org/2001/XMLSchema
  10. http://www.w3.org/2001/XMLSchema-instance
  11. http://www.coda.com/efinance/schemas/elementmaster/elementmaster-12.0/webservice
  12. http://www.coda.com/efinance/schemas/common
  13. http://www.coda.com/efinance/schemas/elementmaster
  14. http://www.coda.com/common/schemas/udfmaster
  15. mailto:ageport@xxxxxxxxxxxxxx%3C/elm:EMail%3E%3C/elm:Address%3E%3Celm:Address%3E%3Celm:DefaultAddress%3Efalse%3C/elm:DefaultAddress%3E%3Celm:Tag%3E2%3C/elm:Tag%3E%3Celm:Name%3EAGEPORT
  16. mailto:MDIAZ@xxxxxxxxxxx%3C/elm:Address1%3E%3Celm:Address2/%3E%3Celm:Address3/%3E%3Celm:Address4/%3E%3Celm:Address5/%3E%3Celm:Address6/%3E%3Celm:PostCode/%3E%3Celm:Tel/%3E%3Celm:Fax/%3E%3Celm:Country/%3E%3Celm:Language%3EEN%3C/elm:Language%3E%3Celm:Category%3EEMAIL%3C/elm:Category%3E%3Celm:EMail/%3E%3C/elm:Address%3E%3C/elm:Addresses%3E%3Celm:Banks/%3E%3Celm:Comments/%3E%3Celm:Groups%3E%3Celm:GroupCode%3E3REL%3C/elm:GroupCode%3E%3Celm:GroupCode%3E3K%3C/elm:GroupCode%3E%3C/elm:Groups%3E%3Celm:Medias/%3E%3Celm:LeftRules/%3E%3Celm:RightRules/%3E%3Celm:Mnemonics/%3E%3Celm:PunchoutAdvancedParams/%3E%3Celm:OutputDevices/%3E%3C/webservice:Element%3E%3C/webservice:GetResponse%3E%3C/soapenv:Body%3E%3C/soapenv:Envelope
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------