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

RE: Send and Receive text string with imbedded ampersands



   Never mind!  - I found the http_EscapeXml() procedure.


   Paul Therrien

   Andeco Software, LLC

   225-229-2491

   paultherrien@xxxxxxxxxxxxxxxxxx

   www.andecosoftware.com


   From: paultherrien@xxxxxxxxxxxxxxxxxx
   [mailto:paultherrien@xxxxxxxxxxxxxxxxxx]
   Sent: Friday, June 12, 2015 11:40 AM
   To: 'ftpapi@xxxxxxxxxxxxxxxxxxxxxx'
   Subject: Send and Receive text string with imbedded ampersands


   I am using  Scott's HTTPAPI service program and code - Thank You Scott!


   I am working with stamps.com and the first step is to get an
   authenticator code which is then used in all subsequent communication
   for the duration of the transaction.

   USPS sends an authenticator code to us and we need to retransmit the
   authenticator code back to them exactly as they sent to us.

   The Authenticator code from USPS has embedded `&'s that are received as
   `&', but when pulled into the RPGLE program the `&'s are
   translated to `&'.


   When I send back the authenticator code to USPS those `&' values
   are required to be sent back.


   What is the best way to handle this?


   Here is an example of what they send ...

   <?xml version="1.0" encoding="utf-8"?>

   <soap:Envelope xmlns:soap=[1]http://schemas.xmlsoap.org/soap/envelope/

   xmlns:xsi=[2]http://www.w3.org/2001/XMLSchema-instance

   xmlns:xsd="[3]http://www.w3.org/2001/XMLSchema";>

   <soap:Body>

   <AuthenticateUserResponse
   xmlns="[4]http://stamps.com/xml/namespace/2015/05/swsim/swsimv45";>

   <Authenticator>exp=1434059237&amp;uid=2940452&amp;cty=swsim&amp;ctk=Kuy
   p36psRu+0l68yzrTXyLchc3o=&amp;iid=Wlri1xV330e3iJyQkIEKAA==&amp;rsid=0&a
   mp;irsid=0&amp;eac=2088717755&amp;eacx=29554687&amp;eac3=0&amp;rrsid=0&
   amp;raid=0&amp;resellerid=0&amp;pexp=0&amp;pl=&amp;ast=1&amp;ipaddr=198
   .46.122.34&amp;ace=1433976437&amp;mac=KOZiCb87BBzjLDKlErQFcctDSko=</Aut
   henticator>

   <LastLoginTime>2015-06-10T21:32:37.77</LastLoginTime>

   <ClearCredential>false</ClearCredential>

   <LoginBannerText />

   <PasswordExpired>false</PasswordExpired>

   <CodewordsSet>true</CodewordsSet>

   </AuthenticateUserResponse>

   </soap:Body>

   </soap:Envelope>


   If I try to send back this:

   <Authenticator>exp=1434059237&uid=2940452&cty=swsim&ctk=Kuyp36psRu+0l68
   yzrTXyLchc3o=&iid=Wlri1xV330e3iJyQkIEKAA==&rsid=0&irsid=0&eac=208871775
   5&eacx=29554687&eac3=0&rrsid=0&raid=0&resellerid=0&pexp=0&pl=&ast=1&ipa
   ddr=198.46.122.34&ace=1433976437&mac=KOZiCb87BBzjLDKlErQFcctDSko=</Auth
   enticator>

   It fails.


   Thanks in advance.

   This is new territory for me.



   Paul Therrien

   Andeco Software, LLC

   225-229-2491

   [5]paultherrien@xxxxxxxxxxxxxxxxxx

   [6]www.andecosoftware.com

References

   1. http://schemas.xmlsoap.org/soap/envelope/
   2. http://www.w3.org/2001/XMLSchema-instance
   3. http://www.w3.org/2001/XMLSchema
   4. http://stamps.com/xml/namespace/2015/05/swsim/swsimv45
   5. mailto:paultherrien@xxxxxxxxxxxxxxxxxx
   6. http://www.andecosoftware.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------