× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello,

It's not clear why you are calling http_persist_open(), here, as you are not using 'pComm' with any further persist functions. This would not relate to the '400 Bad Request', but it is wasting memory on something that's never used. (Or, at least, not in the code you provided to us.)

With regards to '400 Bad Request', it essentially means that the server you're sending your document to didn't like something about the request.   It could be pretty much anything...   Simply something you've sent wasn't what it expected you to send.

Good servers will send you back a response document -- since this is SOAP, it would be a SOAP message with a "fault" tag in it -- that describes what the problem is.   You say you have a debug log... consider looking for this response document to see if there's more information.

Aside from that, look at their documentation and compare what they say they expect to what you are sending.

Also... as a minor aside...  please don't refer to HTTPAPI as "LIBHTTP".   Yes, the default library its installed into is named "LIBHTTP", but that's just the name of the library.  The tool is called "HTTPAPI".

-SK


On 4/1/2020 9:09 AM, Stephen Piland wrote:
We have Scott's LIBHTTP v1.39 installed and I'm having issues adding Basic Authentication to a process that was previously working great.

The code below is the shell of what is going on. We added the http_setauth line. Maybe I'm doing it in the wrong order. We are connecting according to the debug log. With the same info, I'm able to connect and post using SoapUI. However, we receive a HTTP 400 Bad Request back in our RPG code. That same HTTP 400 is returned in SoapUI if I pass in a bad UserId and/or password.

Any thoughts? Thanks!

http_setOption('SoapAction': '"InventoryByStore"');
pComm = http_persist_open(URL);
http_setauth(HTTP_AUTH_BASIC:UID:Password);
response = http_string('POST': URL: SOAP_Message: 'text/xml');


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.