Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header

Post by nick.diama »

Hi all,

I am Using LI HTTP Service - OutboundXML Handler. In the SEND command I set custom Content-Type in HTTP Header like so:

SEND HOST(example.org) SECURE(*YES) CONTENT(application/soap+xml;action="urn:Example/Greece/GetExample") SERVICE_EXCHANGE(*FIELD) URI(/GetExample.svc) HANDLER(OutboundXML) XSL(cdrq)

However, when LI constructs the HTTP Request, for some reason, it inserts the custom Content-Type in HTTP Header always in lowercase.

=== From Trace File ===
Using content type : application/soap+xml;action="urn:example/greece/getexample"; charset=utf-8
=== From Trace File ===

As a result, when I try to make the call the remote web sevrice rejects the request as the NameSpace address is case sensitive. Moreover, I cannot use the SET command in order to set custom HTTP headers as the header I want to set is already defined by the CONTENT(*SOAP) keyword in the SEND Command.

=== Example of HTTP Headers when using SET Command to set custom HTTP Header & CONTENT(*SOAP) keyword in SEND Command ===
POST /GetExample.svc HTTP/1.1
Host: example.org
User-Agent: LANSA Integrator UserAgent/13.2.0 (Server)
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 728
X-User-Agent-Locale: el_GR
X-User-Agent-Identity: USERAGENT:znMiXgfpbiMV3dVEwkJIfYyEyZM=
Content-Type: application/soap+xml;charset=UTF-8;action="urn:Example/Greece/GetExample"
=== Example of HTTP Headers when using SET Command to set custom HTTP Header & CONTENT(*SOAP) keyword in SEND Command ===

So, how can we make LI to set HTTP Headers and especially Content-Type to Proper-Case values rather Lower-Case values.

Thanks in advance for your answers.

Regards,
Nick.
alick
Posts: 16
Joined: Fri Sep 02, 2016 2:43 pm

Re: Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header

Post by alick »

To stop the CONTENT keyword value being lower cased.

1. You need to triple quote ‘’’ the command, so RDML does not uppercase the field value.

2. You need to have the CONTENT type value starting and ending with “ “ to stop lowercasing.

3. If a keyword value starts and ends with “ “ then the command parser will remove these character for escape parsing.

So add \” at the start and \” the end.

4. You need to protect the action value “ “, so escape these \”

RDML

'''SEND HANDLER(OutboundXML) CONTENT("\"application/soap+xml;action=\"urn:Example/Greece/GetExample\"\"") XSL(SENDORDER) HOST(LANSA01:1099)'''

Command string set to service

SEND HANDLER(OutboundXML) CONTENT("\"application/soap+xml;action=\"urn:Example/Greece/GetExample\"\"")
XSL(SENDORDER) HOST(LANSA01:1099)


Host: LANSA01:1099
User-Agent: LANSA-UserAgent/14.2.0 (Server)
Content-Type: application/soap+xml;action="urn:Example/Greece/GetExample"; charset=utf-8

Cheers

Alick
alick
Posts: 16
Joined: Fri Sep 02, 2016 2:43 pm

Re: Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header

Post by alick »

I would recommend looking at XML binding to read and write XML.

Using style-sheet transformation (XSLT) can get complex.

Cheers

Alick
nick.diama
Posts: 19
Joined: Wed May 25, 2016 5:36 pm

Re: Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header

Post by nick.diama »

Thanks Alick! Much appreciated.

The issue here is that I am trying to use HTTP Service and Outbound XML Handler in order to substitute SOAP Agent Service, as it does not support SOAP1.2 that is requested by the remote Web Service.

So what I do is to get the XML produced in SOAPUI, use the Transformation Wizard LI to save as XSL and use that XSL in order to construct the message.

Regards,
Nick
Post Reply