NetTalk Central

Author Topic: Multiple structures in a web service  (Read 5665 times)

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Multiple structures in a web service
« on: October 20, 2019, 12:33:06 PM »
Hi Bruce,

I have a group as a parameter that has a uid and a pwd and other fields and a queue as a second parameter. The group has a number of settings that I use to process the queue.
The queue has postal address information in it. Both are sent to the web service which processes the data and returns a field and the updated queue.
This has been working and now the group seems to be empty when the api is called, so it fails.

The last time the customer accessed the API was in around June the 17th. They have been preparing their software to integrate into our system and now the api call fails.

Can you maybe point me in a direction to resolve.

They are using Python and sending the below to the API.

URL - http://www.cmsienvws.com/AddMultiAddresses

HEAD - {'Host': 'www.cmsienvws.com', 'Content-type': 'application/json', 'Content-length': '886', 'Accept': 'application/json'}

REQUEST - {"AddressRecords": [{"IMB": "", "RETURNCITY_ST_ZIPCODE": "IRONDALE, AL  35210-1782", "SENDTOZIPCODE": "35007-9371", "PICNUMBER": "", "LINEWEIGHT": 1.0, "RETURNADDRESS1": "PINNACLE DATA SYSTEMS, LLC", "RETURNADDRESS2": "350 AUTOMATION WAY", "RETURNADDRESS3": "", "SENDTO1": "JEFF WADE", "SENDTO2": "104 COMANCHE CIR", "SENDTOSTATE": "AL", "SENDTOCITY": "ALABASTER", "SENDTOADDRESS2": "", "SENDTOADDRESS1": "104 COMANCHE CIR", "CUSTOMFIELD1": "0_2", "CUSTOMFIELD3": "", "CUSTOMFIELD2": "", "CUSTOMFIELD5": "", "CUSTOMFIELD4": "", "LINEPOSTAGE": 0.5}], "AddrRequestGrpMulti": {"USERNAME": "PinnacleT", "SIGNATUREREQUESTED": 1, "USERPASSWORD": "pinnacle123", "MIXEDWEIGHTMAIL": 0, "PIECECOUNT": 1, "PRESORTDISCOUNTS500PCSPLUS": 0, "PRINTSEARCHFIELDS": 1, "PIECEWEIGHT": 1.0, "ENVELOPETYPE": 1, "CERTIFIEDMAIL": 1, "IMBDECODED": 0, "CASSADDRESS": 0, "POSTAGE": 0.5, "RESTRICTEDDELIVERYREQUEST": 0, "BRECRE": 0}}

The account is a test account so you can try it if you like.
If you need anything else let me know.

Ashley

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Multiple structures in a web service
« Reply #1 on: October 20, 2019, 09:27:39 PM »
Are you hiding your server behind a proxy? Where your server thinks it is not secure?

cheers
Bruce

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Multiple structures in a web service
« Reply #2 on: October 20, 2019, 11:59:41 PM »
Using Amazon's ELB to handle the security. The ELB changes the incoming requests to https.

I will check with AWS to see if anything has changed with the ELB

Ashley

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Multiple structures in a web service
« Reply #3 on: October 21, 2019, 02:59:51 AM »
I removed the group of parameters and have them listed individually, and I now receive the request with data included except for the queue of addresses.

Ashley

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Multiple structures in a web service
« Reply #4 on: October 21, 2019, 10:06:50 PM »
Hi Ashley,

So one of the root problems is that your server is set to serve insecure, and you are relying on the ELB to translate incoming HTTPS traffic to HTTP. Personally, for security reasons, I'm not a fan of this approach, but you're not the first to do it.

However it means that you need to tell the server that "it's serving securely" even though it thinks it is not. You can do this in the WebHandler procedure. Probably the best place to do it is in the SetSessionIDCookieName method, before the parent call. Something like
  self.SSL = true

Note that I've not tested this specific scenario myself so I cannot really comment as to possible side effects from this approach. Frankly serving your site as HTTPS direct from the server is a lot safer, and recommended.

But anyway, set the setting, then let me know and I can re-test your server to see what your actual mistake is.

cheers
Bruce

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Multiple structures in a web service
« Reply #5 on: October 22, 2019, 01:55:33 AM »
Thank you Bruce, I will give it a go.


Ashley