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 Index » WebSphere Message Broker (ACE) Support » CCSID when receiving HTTP-request?

Post new topic  Reply to topic
 CCSID when receiving HTTP-request? « View previous topic :: View next topic » 
Author Message
Kjell
PostPosted: Wed Sep 28, 2005 6:47 am    Post subject: CCSID when receiving HTTP-request? Reply with quote

Acolyte

Joined: 26 Feb 2002
Posts: 73

Hi,
I have a webservice that is sending an HTTP request to a flow. This flows picks it up using an HTTPInput node.

Now, Message is received as a BLOB and I need to translate it into a character field. For this purpose I need a CCSID. From where do I get it in this case? An HTTP request does not have an MQMD.

I tried to use default 850, but it failed.
E.g. <?xml version="1.0" encoding="utf-8"?> is sent as part of the message submitted by the client. After a
CAST(InputRoot.BLOB.BLOB AS CHAR CCSID 850) the result was:
%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3

The HTTPInputHeader.content-type displays "application/x-www-form-urlencoded".

It is obvoius that 850 could not be used when casting the message.
So, how can I use what's given in the HTTP-input header (or elsewhere) to have a proper casting of what is submitted by the client?
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed Sep 28, 2005 7:17 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

The equivalent CCSID for UTF-8 is 1208
Back to top
View user's profile Send private message Send e-mail
Kjell
PostPosted: Fri Sep 30, 2005 5:15 am    Post subject: Reply with quote

Acolyte

Joined: 26 Feb 2002
Posts: 73

I tried to CAST to CHAR using CCSID 1208, but still no difference.
After cast the result is as below:
%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0D%0A%3Csoap%3AEnvelope++xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22+xmlns%3Axsd%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22+xmlns%3Asoap%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fenvelope%2F%22+%3E+%0D%0A%3Csoap%3ABody%3E%0D%0A%3CVIRKESORDER_REQUEST%3E%0D%0A%3CVONUM%3E12345678%3C%2FVONUM%3E%3CVOGEN_A%3E02%3C%2FVOGEN_A%3E%3CSTATUS%3E0%3C%2FSTATUS%3E%0D%0A%3C%2FVIRKESORDER_REQUEST%3E%0D%0A%3C%2Fsoap%3ABody%3E%0D%0A%3C%2Fsoap%3AEnvelope%3E

As you can see, the <?xml version="1.0" encoding="UTF-8" ?>
is still displayed as %3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%.

This must be a general problem, when receiving XML from a client.
How to translate it?
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Sep 30, 2005 5:29 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

This is not a general problem. This is happening because your data is encoded in:

Quote:
application/x-www-form-urlencoded


If you look up this media type (for example at http://www.w3.org/MarkUp/html-spec/html-spec_8.html ) you will see that:


Quote:
"The form-urlencoded Media Type
The default encoding for all forms is `application/x-www-form-urlencoded'. A form data set is represented in this media type as follows:

The form field names and values are escaped: space characters are replaced by `+', and then reserved characters are escaped as per [URL]; that is, non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks, as in multi-line text field values, are represented as CR LF pairs, i.e. `%0D%0A'.
The fields are listed in the order they appear in the document with the name separated from the value by `=' and the pairs separated from each other by `&'. Fields with null values may be omitted. In particular, unselected radio buttons and checkboxes should not appear in the encoded data, but hidden fields with VALUE attributes present should. "


You need to write ESQL to handle this data in this format or look up (and change) the ENCTYPE attribute on the form itself.


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CCSID when receiving HTTP-request?
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.