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.
Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header
-
nick.diama
- Posts: 19
- Joined: Wed May 25, 2016 5:36 pm
Re: Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header
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
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
Re: Integrator - HTTP Service - OutboundXML Handler - Custom Content-Type in HTTP Header
I would recommend looking at XML binding to read and write XML.
Using style-sheet transformation (XSLT) can get complex.
Cheers
Alick
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
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
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