ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportSpecial Character Handling

Post new topicReply to topic
Special Character Handling View previous topic :: View next topic
Author Message
syedimtiyaz1234
PostPosted: Mon Feb 05, 2018 1:32 pm Post subject: Special Character Handling Reply with quote

Newbie

Joined: 22 Jan 2018
Posts: 7

Hi All,

we have one WSDL and in the response sometime Special Character is sent and now by default all Special Char is escaped like "$amp; $gt; etc.

now due to this there is some issue and so we wanted to un-escape it before we send it.

So we added this function AsisElementContent and i could verify it in SOAPUI that it works fine meaning response is coming as '&,<,> etc.' but now the Problem is that the response message is not a SOAP message. It's not validating in SOAPUI and it is failing in application as well as.

This is happening when there is some special Char in the response.

Could anyone please suggest anything.

Thank You
Imtiyaz
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Feb 06, 2018 5:32 am Post subject: Re: Special Character Handling Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19770
Location: LI,NY

syedimtiyaz1234 wrote:
Hi All,

we have one WSDL and in the response sometime Special Character is sent and now by default all Special Char is escaped like "$amp; $gt; etc.

now due to this there is some issue and so we wanted to un-escape it before we send it.

So we added this function AsisElementContent and i could verify it in SOAPUI that it works fine meaning response is coming as '&,<,> etc.' but now the Problem is that the response message is not a SOAP message. It's not validating in SOAPUI and it is failing in application as well as.

This is happening when there is some special Char in the response.

Could anyone please suggest anything.

Thank You
Imtiyaz

You only want to escape the special character. You can't escape all characters indiscriminately or you won't have a valid XML / SOAP message anymore...

example
value of pwd is "</>"
So you would have <pwd>&lt;/&gt;</pwd> or something like it.
Hope that helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
syedimtiyaz1234
PostPosted: Tue Feb 06, 2018 6:24 am Post subject: Reply with quote

Newbie

Joined: 22 Jan 2018
Posts: 7

Hi,

I could not get you. could you please explain me little more.

Or if i understand correctly what you are saying that i can't escape discrimantly as where there is no special Char , the SOAP reply is a valid SOAP.

Yes i only want for special Char if present. i am not sure which special Char would come from backend, it could be &,<,> etc. or if it will come but whenever it comes it should be as it is when IIB reply.

Thank You
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 06, 2018 6:29 am Post subject: Re: Special Character Handling Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25310
Location: Ohio, USA

syedimtiyaz1234 wrote:
now due to this there is some issue and so we wanted to un-escape it before we send it.


What issue? If these are no escaped the XML is invalid. Behold....

syedimtiyaz1234 wrote:
now the Problem is that the response message is not a SOAP message. It's not validating in SOAPUI and it is failing in application as well as.


It's not just not a SOAP message, it's not valid XML.

syedimtiyaz1234 wrote:
This is happening when there is some special Char in the response.


Because without an improperly escaped special character the XML is fine.

syedimtiyaz1234 wrote:
Could anyone please suggest anything.


Fix the "issue" that you believe mean you need to send special characters unescaped. Presumably someone's homebrewed XML parser that's a bit rubbish.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
syedimtiyaz1234
PostPosted: Tue Feb 06, 2018 7:38 am Post subject: Reply with quote

Newbie

Joined: 22 Jan 2018
Posts: 7

The issue is that lets say front end they are expecting only 200 Char length in that element and now from Back end it is 200 with &,or <,> as these are 1 Char size.
Now When IIB sends it is changing it to &amp; thus increasing the size thus validation fails.

We are trying from our side if by any way we could send it as it is.

2nd we are also suggesting to front end if possible can they un-escape those char and then do validation this way they was 200 Char.

and we can not also substring the message to make it 200.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 06, 2018 9:02 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25310
Location: Ohio, USA

syedimtiyaz1234 wrote:
The issue is that lets say front end they are expecting only 200 Char length in that element and now from Back end it is 200 with &,or <,> as these are 1 Char size.
Now When IIB sends it is changing it to &amp; thus increasing the size thus validation fails.


Wrong. If the front end is using a compliant XML parser, the escaped characters will turn back into their unescaped forms automatically. Imagine if every time you sent "Dun & Bradstreet" in XML, you had to manually take the &amp; out.

syedimtiyaz1234 wrote:
We are trying from our side if by any way we could send it as it is.


Not as a valid SOAP or other XML document.

syedimtiyaz1234 wrote:
2nd we are also suggesting to front end if possible can they un-escape those char and then do validation this way they was 200 Char.


See above. Their parser should be doing this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Feb 06, 2018 1:49 pm Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 868

I agree with Vitor. IIB is behaving correctly, and it is emitting a valid XML document. The front end application has some weird restrictions on the length of the XML.
Also, it sounds as if the people who are trying to fix this need to read the XML specification. Trying to un-escape *all* escaped characters in the XML is very unprofessional.

Quote:
So we added this function AsisElementContent
...but you did not follow the advice in the IIB Knowledge Center which says: "The value is written directly to the output bit stream. No character substitutions are performed. Use this element with care."
Back to top
View user's profile Send private message
mpong
PostPosted: Tue Feb 06, 2018 9:38 pm Post subject: Reply with quote

Centurion

Joined: 22 Jan 2010
Posts: 141

https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ad06420_.htm

I have not seen any front-end application enforcing un-escape characters to escaped characters for length restriction. It is worth suggesting to use compliant parser on their side rather than trying to solve from IIB
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportSpecial Character Handling
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.