Author |
Message
|
belka |
Posted: Thu Jul 29, 2004 8:06 am Post subject: Passing XML as part of the Input Data |
|
|
 Novice
Joined: 16 Jun 2004 Posts: 17
|
We are using WMQI to create a message and send it the workflow to start the process.
i have an input container defined for the message structure. we would like to use one of the fields in the container to store the original message (pre-WMQI).
workflow complains that xml data in the field needs to be part of the data container. is there a way around it? how can i store xml data in one of the data container fields?
thanks. _________________ -belka |
|
Back to top |
|
 |
jmac |
Posted: Thu Jul 29, 2004 12:40 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Convert the xml data to a hexadecimal string and that should work _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Jul 30, 2004 9:52 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
|
Back to top |
|
 |
belka |
Posted: Mon Aug 02, 2004 9:50 am Post subject: |
|
|
 Novice
Joined: 16 Jun 2004 Posts: 17
|
CDATA works, but it strips out all of the XML tags inside.
i haven't tried converting to hex. _________________ -belka |
|
Back to top |
|
 |
jmac |
Posted: Mon Aug 02, 2004 10:00 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
belka:
Hex will work, this is what MQWF does with xml messages it wishes to return to you when you get an error. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
belka |
Posted: Mon Aug 02, 2004 10:38 am Post subject: |
|
|
 Novice
Joined: 16 Jun 2004 Posts: 17
|
john,
i'm totally confused by your last response.
this is what a sample message looks like. text in red will be the original message received by WMQI that couldn'tl be processed.
you're saying convert just that part to hex or the whole message? do you have an example?
<ProcessTemplateCreateAndStartInstance>
<ProcTemplName>ErrorManagementFlow</ProcTemplName>
<ProcInstName>NORDICS_GL003_54278</ProcInstName>
<KeepName>true</KeepName>
<ProcInstInputData>
<StandardError>
<Id>54279</Id>
<SourceSystemId>GL</SourceSystemId>
<SourceRegion>SWEDEN</SourceRegion>
<SourceData>
<test>some test message</test>
<test2>
<test3>another message</test3>
</test2>
</SourceData>
<SourceType>WORKSITE</SourceType>
<ErrorDetails>
<Id>123L</Id>
<Description>IFS company ID not found in GIS lookup table. GAIPS WBI processes requires this value to complete the transaction.</Description>
<AdditionalDetails>Please verify that IFS Company ID is valid, then contact support to update GAIPS process.</AdditionalDetails>
<Data>IFS Company ID = 07</Data>
</ErrorDetails>
<ErrorDetails/>
</StandardError>
</ProcInstInputData>
</ProcessTemplateCreateAndStartInstance> _________________ -belka |
|
Back to top |
|
 |
jmac |
Posted: Mon Aug 02, 2004 10:49 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Belka:
Here is a ProcessTemplateCreateAndStartInstanceResponse message generated by MQWF. The tag RequestAsHexString contains the original create and start instance XML message that was sent to MQWF.
I hope this clears up the confusion... sorry
Code: |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WfMessage>
<WfMessageHeader>
<ResponseRequired>No</ResponseRequired>
</WfMessageHeader>
<ProcessTemplateCreateAndStartInstanceResponse>
<Exception>
<Rc>121</Rc>
<Parameters> </Parameters>
<MessageText>FMC00121E Name is not unique </MessageText>
<Origin>e:\v340\src\fmcecosa.cxx(3922)</Origin>
</Exception> <RequestAsHexString>3C3F786D6C2076657273696F6E3D22312E3022206...</RequestAsHexString>
</ProcessTemplateCreateAndStartInstanceResponse>
</WfMessage |
_________________ John McDonald
RETIRED |
|
Back to top |
|
 |
belka |
Posted: Mon Aug 02, 2004 12:34 pm Post subject: |
|
|
 Novice
Joined: 16 Jun 2004 Posts: 17
|
it worked. is there an API to convert the string from hex to ansi _________________ -belka |
|
Back to top |
|
 |
jmac |
Posted: Mon Aug 02, 2004 12:47 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
If there is I don't know about it... If you find one let me know. I had to write some code to do the translation. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
belka |
Posted: Tue Aug 03, 2004 6:28 am Post subject: [SOLVED]Passing XML as part of the Input Data |
|
|
 Novice
Joined: 16 Jun 2004 Posts: 17
|
ok. had to write my own conversion function. for anybody that cares, here is the code.
public String getHexMember(RequestContext context, ReadOnlyContainer input, String name)
{
String val = null;
StringBuffer buffer = new StringBuffer();
try {
val = context.getMemberValue(input, name, "");
for (int i=0; i<val.length(); i += 2) {
buffer.append( (char)Integer.parseInt(val.substring(i, i+2),16) );
}
}
catch (Exception e) {
}
return buffer.toString();
} _________________ -belka |
|
Back to top |
|
 |
|