REQUEST DOCUMENT and HTTPS on HP UNIX

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.

Base program was pulled from this forum.

Program is attached.

The PDA is as follows:
DEFINE DATA PARAMETER
1 FULFILLMENT_REQUESTS
2 C#FULFILLMENT_REQUEST (I4)
2 FULFILLMENT_REQUEST
3 CONTENT_ID (A40)
3 CONTENT_ID_TYPE (A16)
3 FORMAT_TYPE (N3)
3 TRANSACTION_ID (A20)
3 CUSTOMER_ID (A20)
3 CUSTOMER_NAME (A100)
3 RETAILER_PRICE (A10)
3 RETAILER_CURRENCY (A3)
3 LIT
4 SECURITY_LEVEL (N2)
4 PASSPORT_ID (A10)
2 C#FULFILLMENT_RESPONSE (I4)
2 FULFILLMENT_RESPONE
3 ENCRYPTED_FULFILLMENT_REQUEST (A) DYNAMIC
3 FULFILLMENT_ERROR
4 ERROR_CODE (A10)
4 ERROR_MESSAGE (A150)
4 ERROR_DETAILS (A) DYNAMIC
END-DEFINE

The following is the Output that I get:
Page 1

Trace File Defined= /home/isd/xxxxxx/20091209_10490

MORE

#CONTENT_ID := 2EEC1B6A-9C0A-4FFF-BAAB-60B3B1019E6A-50_
#FORMAT_TYPE := 2
#TRANSACTION_ID := B-T-Test
_________
#CUSTOMER_ID := B-T-Test____________
#CUSTOMER_NAME := B-T-Test______________________
#RETAILER_PRICE := .01_______
#RETAILER-CURRENCY := USD

Page 2

HTTP Error: 415
HTTP Text :
XML Response :

MORE
Program.txt (8.07 KB)

btw. Base program was pulled from this post:
http://tech.forums.softwareag.com/viewtopic.php?t=638&host=natural&sid=89a83c2d0846d2e6ed84308b1e2c823f

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.

Thanks Doug. You are a gentleman and a scholar. That got me something back from the WebService:

HTTP/1.1 415 Missing Content Type
Connection: close
Date: Thu, 10 Dec 2009 14:45:10 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Length: 0

It looks like the HEADER NAME ‘Content-Type’ VALUE ‘text/xml; charset=utf-8’ is not getting past to the WebService or am I missing something.

  1. 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.
  2. 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?

I am also going to see if the people running the WebService can trap the incoming request.

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?).

1 Like

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.

btw, I have an open SR with Customer Support.