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

RE: For SOAP Request with a UserID and Password (EXAMPLE14).



If you are struggling with "is your install of LIBHTTP working?", try EXAMPLE1. It is still working as of this afternoon.

Then to test SSL/TLS, try this changed version of EXAMPLE3.

H DFTACTGRP(*NO) BNDDIR('HTTPAPI')                     
H ACTGRP('HTTPAPI')                                    
                                                       
 /copy qrpglesrc,httpapi_h                             
                                                       
D cmd             pr                  extpgm('QCMDEXC')
D   cmd                        200a   const            
D   len                         15p 5 const            
                                                       
D rc              s             10i 0                  
D app_id          s            100a                    
                                                       
c                   callp     http_debug(*on)          
c                   eval      rc = http_url_get(                           
c                                  'https://www.fortify.net/sslcheck.html':
c                                  '/tmp/httptest.html')                   
                                                                           
c                   if        rc <> 1                                      
c                   callp     http_crash                                   
c                   endif                                                  
                                                                           
c                   callp     cmd('DSPF ''/tmp/httptest.html''': 200)      
                                                                           
c                   eval      *inlr = *on

If you get results from those two, you should be ready to try your web service. Scott and Alan have pointed you down the road in the right direction on a specific example to use.


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of PReid@xxxxxxxxxxxx
Sent: Thursday, December 27, 2012 1:57 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: For SOAP Request with a UserID and Password (EXAMPLE14).

Hello.

I've been attempting to learn how to use the HTTPAPI for several days now. 
Our company has a need to make a SOAP request to one of our vendors and 
receive data back from them. They require a UserID and Password in the 
request. Also, it is a secure (https) service. Can you tell me which of 
the HTTPAPI Examples I should start with as a model to do this. I am 
thinking EXAMPLE14, however; I don't seem to be able to get EXAMPLE14 to 
work, are we sure that the URL's in this example aren't out of date?

I have been experimenting with SoapUI so I know what my XML request and 
response will look like. Note I have replaced my actual UserID and 
Password with stars for security reasons.

Any help would be much appreciated as I've very new to this. Thanks!!!

XML Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"; 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"; 
xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
" 
xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<soap:Header>
<wsa:Action>http://www.qualcomm.com/VerifyAccess</wsa:Action>
<wsa:MessageID>urn:uuid:db5ab195-ceb1-4325-8e1a-3b293ee1b49b</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonym
ous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>https://qhos.qualcommapps.com/qhoswsna/driver.asmx</wsa:To>
<wsse:Security soap:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasisopen.
org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="SecurityToken-fbd3add0-e734-4dc3-b717-609e4089228d">
<wsse:Username>*******************</wsse:Username>
<wsse:Password Type="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText
">*********</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
   <soap:Body>
      <ExportDriver xmlns="http://www.qualcomm.com";>
         <!--Optional:-->
         <request>
            <!--Optional:-->
            <Drivers>
               <!--Zero or more repetitions:-->
               <string>CGOES</string>
               <string>LBOLT</string>
            </Drivers>
            <RuleSet>CANMain</RuleSet>
         </request>
      </ExportDriver>
   </soap:Body>
</soap:Envelope>

XML Response
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="
http://www.w3.org/2001/XMLSchema"; xmlns:wsa="
http://schemas.xmlsoap.org/ws/2004/08/addressing"; xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
" xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
">
   <env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope";>
      <wsa:Action>http://www.qualcomm.com/ExportDriverResponse
</wsa:Action>
 
<wsa:MessageID>urn:uuid:2ba97535-796d-4e24-9bb4-8215718d8f80</wsa:MessageID>
 
<wsa:RelatesTo>urn:uuid:f866f097-61e1-40c2-85a3-945fa79c4621</wsa:RelatesTo>
      <wsa:To>
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsse:Security>
         <wsu:Timestamp 
wsu:Id="Timestamp-a1924cfb-a098-481f-922c-df5b8c524aea">
            <wsu:Created>2012-12-27T17:52:20Z</wsu:Created>
            <wsu:Expires>2012-12-27T17:57:20Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </env:Header>
   <soap:Body>
      <ExportDriverResponse xmlns="http://www.qualcomm.com";>
         <ExportDriverResult>
            <DriverExport>
               <DriverExportData>
                  <DriverId>CGOES</DriverId>
                  <Password>3395</Password>
                  <LastName>Goes</LastName>
                  <FirstName>Casey</FirstName>
                  <DepotId>13</DepotId>
                  <TractorId>05197</TractorId>
                  <ActivityStarted>2012-12-27T12:41:00</ActivityStarted>
                  <DayDrive>715</DayDrive>
                  <DayDuty>492</DayDuty>
                  <WeekDuty>2593</WeekDuty>
                  <DayOff>15497</DayOff>
                  <Shift>612</Shift>
 <LastAvailHoursRecalc>2012-12-27T12:52:20.6906826Z</LastAvailHoursRecalc>
                  <TodayOnDuty>272</TodayOnDuty>
                  <TodayOffDuty>424</TodayOffDuty>
                  <TodaySleeper>0</TodaySleeper>
                  <TodayDrive>65</TodayDrive>
                  <YesterdayOnDuty>379</YesterdayOnDuty>
                  <YesterdayOffDuty>959</YesterdayOffDuty>
                  <YesterdaySleeper>0</YesterdaySleeper>
                  <YesterdayDrive>102</YesterdayDrive>
                  <Activity>4</Activity>
                  <TimeZone>Eastern Standard Time</TimeZone>
                  <USDutyCycle>EightDay</USDutyCycle>
                  <CANDutyCycle>SevenDay</CANDutyCycle>
                  <CurrentRuleSet>CANMain</CurrentRuleSet>
               </DriverExportData>
               <DriverExportData>
                  <DriverId>LBOLT</DriverId>
                  <Password>4498</Password>
                  <LastName>Bolt</LastName>
                  <FirstName>Lynden</FirstName>
                  <DepotId>14</DepotId>
                  <TractorId>02160</TractorId>
                  <ActivityStarted>2012-12-27T11:43:00</ActivityStarted>
                  <DayDrive>687</DayDrive>
                  <DayDuty>488</DayDuty>
                  <WeekDuty>3848</WeekDuty>
                  <DayOff>19808</DayOff>
                  <Shift>608</Shift>
 <LastAvailHoursRecalc>2012-12-27T12:52:20.7063081Z</LastAvailHoursRecalc>
                  <TodayOnDuty>250</TodayOnDuty>
                  <TodayOffDuty>420</TodayOffDuty>
                  <TodaySleeper>0</TodaySleeper>
                  <TodayDrive>93</TodayDrive>
                  <YesterdayOnDuty>0</YesterdayOnDuty>
                  <YesterdayOffDuty>1440</YesterdayOffDuty>
                  <YesterdaySleeper>0</YesterdaySleeper>
                  <YesterdayDrive>0</YesterdayDrive>
                  <Activity>4</Activity>
                  <TimeZone>Eastern Standard Time</TimeZone>
                  <USDutyCycle>EightDay</USDutyCycle>
                  <CANDutyCycle>SevenDay</CANDutyCycle>
                  <CurrentRuleSet>CANMain</CurrentRuleSet>
               </DriverExportData>
            </DriverExport>
         </ExportDriverResult>
      </ExportDriverResponse>
   </soap:Body>
</soap:Envelope>
___________________________________________________________
Paul Reid
Application Developer III
Erb Group of Companies | 290 Hamilton Road | New Hamburg, Ontario | N3A 
1A2
Phone: 519.662.6133 ext. 2363
Web: http://www.erbgroup.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------