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 » Problem with Null values

Post new topic  Reply to topic Goto page 1, 2  Next
 Problem with Null values « View previous topic :: View next topic » 
Author Message
Shadow
PostPosted: Fri Jul 06, 2007 8:43 am    Post subject: Problem with Null values Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

Hello all.

I have a custom node that makes SAP RFC calls. It builds the message tree with
call results. Some elements are not mandatory, so they do not apeear in tree.
These results are written in a MQ queue using CWF format. All fields in messageset
have the attribute 'nilable' marked and min and max occurs set to 1.
The null encoding is set to 'NullLiteralFill' and null value to 'SPACE', so the
missing elements in tree are written with spaces in queue.

Everything goes fine until here.

The problem is that the flow that consumes the queue, do not read the message
properly. It gets confused with spaces.

The wierd thing is, if I read the message using rfhutil and put it again in queue,
the flow reads it perfectly!


Here is the trace of message tree built by custom node:
Quote:

(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'IQHFNLC002001'
(0x03000000):MessageType = 'rtipo2'
(0x03000000):MessageFormat = 'CWF1'
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 1208
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = TRUE
(0x03000000):CreationTime = GMTTIMESTAMP '2007-07-06 15:10:33.400'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'414d5120424e4f424b52503120202020468a98a72001400f'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'BK1.BKR.SAP.FIFO.QL.CONSULTPARTIDASINDIVIDUAIS'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 1208
(0x03000000):Format = 'MQSTR '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 1
(0x03000000):MsgId =
X'303030303030303030303030303030303030303030303831'
(0x03000000):CorrelId =
X'414d5120424e4f424b52503120202020468a98a72001400f'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'BNOBKRP1 '
(0x03000000):UserIdentifier = 'wbiadmin '
(0x03000000):AccountingToken =
X'0332303300000000000000000000000000000000000000000000000000000006'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 6
(0x03000000):PutApplName = ' '
(0x03000000):PutDate = DATE '2007-07-06'
(0x03000000):PutTime = GMTTIME '15:10:33.400'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId =
X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x0100001B):MRM = (
(0x0300000B):HeaderNA = ' '
(0x0300000B):status = 'OK'
(0x0300000B):mensagem_status = ''
(0x0300000B):qtd = '1'
(0x01000013):rIt = (
(0x0300000B):no_doc = '0100000246'
(0x0300000B):doc_fat = '0700003815'
(0x0300000B):cod_cliente = 'TE00002663'
(0x0300000B):texto = 'Aceitação fatura'
(0x0300000B):cnpj = '66011883000143'
(0x0300000B):empresa = 'DATA'
(0x0300000B):cliente = 'JULIAN MARCUIR INDUSTRIA E COMERCIO'
(0x0300000B):local = 'BARUERI'
(0x0300000B):data_doc = DATE '2006-07-12'
(0x0300000B):tip = 'RV'
(0x0300000B):atribuicao = '0'
(0x0300000B):vt = 'ATRA'
(0x0300000B):st = 'ABER'
)
)
)



Here is the trace of mqinput reading the same message.
Note that the CPF field is 11 characters long, and is null (was populated with 11
spaces by MQOutput).
The next field, LOCAL, has the 11 characters of CPF and not only its own value,
that is BARUERI.
From this point forward, the message is all wrong.

Quote:
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'IQHFNLC002001'
(0x03000000):MessageType = 'rtipo2'
(0x03000000):MessageFormat = 'CWF1'
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 1208
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = TRUE
(0x03000000):CreationTime = GMTTIMESTAMP '2007-07-06 15:28:33.380'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'414d5120424e4f424b52503120202020468a98a720014012'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'SAP.BKR.BK1.FIFO.QL.CONSULTPARTIDASINDIVIDUAIS'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 1208
(0x03000000):Format = 'MQSTR '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 1
(0x03000000):MsgId =
X'303030303030303030303030303030303030303030303834'
(0x03000000):CorrelId =
X'414d5120424e4f424b52503120202020468a98a720014012'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'BNOBKRP1 '
(0x03000000):UserIdentifier = 'wbiadmin '
(0x03000000):AccountingToken =
X'0332303300000000000000000000000000000000000000000000000000000006'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 6
(0x03000000):PutApplName = ' '
(0x03000000):PutDate = DATE '2007-07-06'
(0x03000000):PutTime = GMTTIME '15:28:33.380'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId =
X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x0100001B):MRM = (
(0x0300000B):HeaderNA = ''
(0x0300000B):status = 'OK'
(0x0300000B):mensagem_status = ''
(0x0300000B):qtd = 1
(0x01000013):rIt = (
(0x0300000B):st = 'ABER'
(0x0300000B):atribuicao = '0'
(0x0300000B):no_doc = '0100000246'
(0x0300000B):tip = 'RV'
(0x0300000B):data_doc = DATE '2006-07-12'
(0x0300000B):vt = 'ATRA'
(0x0300000B):texto = 'Aceitação fatura'
(0x0300000B):doc_fat = '0700003815'
(0x0300000B):cod_cliente = 'TE00002663'
(0x0300000B):cliente = 'JULIAN MARCUIR INDUSTRIA E COMERCIO'
(0x0300000B):cnpj = '66011883000143'
(0x0300000B):cpf = NULL
(0x0300000B):local = ' BARUERI'
(0x0300000B):empresa = NULL
(0x0300000B):doc_compensacao = NULL
(0x0300000B):data_compensacao = NULL
)
)
)


Env:
Quote:
AIX 5200-07-00
MB v6.0.0.0
MQ v5.3 CSD10


Any ideas why the MQInput is not reading the message as it should be?
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
wbi_telecom
PostPosted: Fri Jul 06, 2007 9:02 am    Post subject: Reply with quote

Disciple

Joined: 15 Feb 2006
Posts: 188
Location: Harrisburg, PA

In your MQOutput node, under the validation tag do you have the "Content and Value" set for Validate option? In case you have not try that.
if your output message is not adhering to your message set definition it will error out and you will know which field is not as per the definition.

Cheers,
Back to top
View user's profile Send private message
Shadow
PostPosted: Fri Jul 06, 2007 10:15 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

After check the validation option in mqoutput, the parser gave me the error:
Quote:
An element has been deemed complete occurring less than specified minOccurs

But, I did not understand it...

The exception´s inserts shows the field 'cpf', inside repeating element 'rIt', as the responsible.

This field does not exist in message tree and should be padded with space in output stream.

Do I have to set the minOccurs to 0? This way it will be present and padded in output stream?
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Jul 06, 2007 10:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you need to ensure that the field EXISTs in the message tree, but has a NULL VALUE.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Shadow
PostPosted: Fri Jul 06, 2007 10:34 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

I forgot to mention that the message tree is populated in different order of the message definition, but the message definition has the complex type set as "unordered set".
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Jul 06, 2007 10:37 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well.

It shouldn't matter, but you can try changing the code to populate in the right order, anyway.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Shadow
PostPosted: Fri Jul 06, 2007 10:43 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

jefflowrey wrote:
Well.

It shouldn't matter, but you can try changing the code to populate in the right order, anyway.

This is almost impossible.
My custom node code does not know the correct order of fields, just their names...
There is a way, inside java code, to get the message set definition and the correct order of fields?
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shadow
PostPosted: Fri Jul 06, 2007 10:52 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

jefflowrey wrote:
I think you need to ensure that the field EXISTs in the message tree, but has a NULL VALUE.

Hi jefflowrey.

I've changed my custom node code to not supress the empty elements and set their value to null.

This way, I have the following parser error on mqoutput:
Quote:
Syntax Error: Unknown or Invalide Type found in Tree.



The field is 'cpf' and its type is "Fixed lenght string".
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0


Last edited by Shadow on Fri Jul 06, 2007 11:04 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Jul 06, 2007 10:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

... No, there is no way you can get that kind of information about a message set from *anything* in Broker, other than the Toolkit.

It makes no sense that you can't organize your Java code to build the message tree so that the fields are populated in the correct order.

Just like in ESQL, it's simply a matter of the order of your statements...

Even if you choose not to do this in your Java code, you can easily add a regular compute node afterward to build the OutputRoot tree in the correct order.

But, as I said - it shouldn't make a difference. It's just a thing to try.

Like it's a thing to try to make sure that the field EXISTS, but has a NULL value.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wbi_telecom
PostPosted: Fri Jul 06, 2007 11:10 am    Post subject: Reply with quote

Disciple

Joined: 15 Feb 2006
Posts: 188
Location: Harrisburg, PA

Try using VALUE after your set statement and set it to NULL. If you set the tag to NULL it will disappear from the message tree and you are bound to get a mismatch with the definition.

Cheers,
Back to top
View user's profile Send private message
Shadow
PostPosted: Fri Jul 06, 2007 11:22 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

wbi_telecom wrote:
Try using VALUE after your set statement and set it to NULL. If you set the tag to NULL it will disappear from the message tree and you are bound to get a mismatch with the definition.

Cheers,

Hi wbi_telecom,

My set statement is inside my custom node code (java).
I use the following code to create the field in message tree:

Code:

rep.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "field_name", null);


I´ve checked the message tree in debug and the tag is there with no value.
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Jul 06, 2007 11:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Shadow wrote:
I´ve checked the message tree in debug and the tag is there with no value.


Is that a change you've made, or was it like that before, when you said "This field does not exist in message tree "?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Shadow
PostPosted: Fri Jul 06, 2007 11:32 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

jefflowrey wrote:
Is that a change you've made, or was it like that before, when you said "This field does not exist in message tree "?

Hi Jeff.

I've changed the code!
In the first time, there was no element in tree. Only the ones that were not null.

Shadow wrote:
jefflowrey wrote:
I think you need to ensure that the field EXISTs in the message tree, but has a NULL VALUE.

Hi jefflowrey.

I've changed my custom node code to not supress the empty elements and set their value to null.

This way, I have the following parser error on mqoutput:
Quote:
Syntax Error: Unknown or Invalide Type found in Tree.



The field is 'cpf' and its type is "Fixed lenght string".

Now, with the change mentioned above, the element exists in tree, but has no value.
Inside my java code, I set the element to null.
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Jul 06, 2007 11:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Okay.

I didn't see that message because you entered it while I was entering my response to the other one.

Setting it to null like that should be the equivalent of what wbi_telecom and I wanted.

Does it work now? Or same problem?

If it's the same problem, then you're going to have to look at executing your statements in the right order. It's really just a matter of that - putting the createAsLastChild for field 1 before the createAsLastChild for field 2.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Shadow
PostPosted: Fri Jul 06, 2007 11:43 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2006
Posts: 16
Location: Campinas/SP - Brazil

Yes, the posts was at the same time hehe.
jefflowrey wrote:
Does it work now? Or same problem?

If it's the same problem, then you're going to have to look at executing your statements in the right order. It's really just a matter of that - putting the createAsLastChild for field 1 before the createAsLastChild for field 2.

It is not working. Now I have the following error in mqoutput:
Quote:
Syntax Error: Unknown or Invalide Type found in Tree.

I dont think that this is related to the fields order, but I will try your sugestion and populate the tree in correct order.
_________________
IBM Certified Solution Developer - WebSphere Message Broker V6.0
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem with Null values
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.