Hello all,
I have created a Program to make an POST with an XML Payload through an HTTPS call. It works fine through Natural for Windows. But when I move it up to the HP UNIX environment. I receive a HTTP 415 response with no HTTP Test or anything else. Both Natural Version on Windows and UNIX are Natural 6.3.6. I checked to see if openssl is installed and it is. I have generated self signed certificates and placed in the certs directory for openssl.
HTTP415 is a “invalid media” error - often a mismatch of what the service web site allows and what you are specifying in the content-type and sometimes a charset mismatch.
Try reading the header from the response - add a “HEADER ALL #return-hdr” to the RETURN clause and display the dynamic variable #return-hdr when the error occurs to see if that helps identify the error.
try leaving out the HEADER clause altogether. Natural will supply a Request-Method. There is a default Content-Type so you might still need to supply this.
Are you calling a SOAP service or a REST service? I don’t see a SOAP wrapper in your program. If you are calling a REST service, you may need a different Content-Type - I’ve seen some use application/xml rather than text/xml.
Removing the HEADER part of the REQUEST DOCUMENT gives me a 403 that I am not authorized. They do not specification name the service I am calling. I do not believe it is a SOAP request, because the same Natural Program under Natural for Windows works fine.
I tried (and just retried) the application/xml as the ‘Content-Type’. Their documentation specifies ‘text/xml’.
Is there a trace that can be started to capture outbound requests?
did you try putting only the Content-Type in the header (leave out the Request Method)?
you could add a SOAP sniffer (e.g. TCPMON) to check on the outbound documents.
In any case, since it works from Windows and not Unix, either there is a problem with the SSL setup or there’s a bug that needs to be reported to support. The 403 suggests a problem with the SSL or authentication (is there a user/pswd required?).
The user-id and password are in the XML payload and are read from there. I have tried removing the Request Method and leaving the Content Type and still get the 403. I will look into the SOAP sniffer.
As far as the SSL setup, it is installed through the HP System Administration screens. It did not look like there were any certificate setup, so I generated a self signed certificate and a Key. I moved them to the certs directory under the openssl installation directory. From everything I have read thus far, these are only used by incoming ssl connections and not out going. Am I wrong in that? I have not really been able to find what you might call an installation guide for openssl.