Author |
Message
|
wraymore |
Posted: Tue Jun 12, 2007 8:17 am Post subject: base64 encoded HL7 String in XML Message - need to decode |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
I have an input XML message that contains an element that is a base64 encoded HL7 string. The output is to just contain the decoded HL7 string. I have a MRM message set defined for the input. In the message flow I have the Input Parsing of the MQInput Node setup with the message set values and I am getting the input message to parse. The element - Request - has its Physical representation encoding set to Base64.
The output message is to only include this Request element as its decoded string representation and I am really stuggling with it. I have looked through this forum (probably have overlooked the soluteion) and checked through the WMBT Information Center to no avail.
We have just upgraded to WMBv6. Any assistance would be greatly appreciated. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 8:18 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think if you are seeing that the field has been decoded in the input message, then you merely need to set the output message so that it doesn't re-encode it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 13, 2007 12:48 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The output message definition should define this element as 'string' instead of base64Binary. |
|
Back to top |
|
 |
wraymore |
Posted: Wed Jun 13, 2007 1:01 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
I must have something wrong.
Listed here are my message sets:
Input
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:Q1="ommitedNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="ommitedNamespace">
<xsd:element name="Status" type="xsd:string"/>
<xsd:element name="faultcode" type="xsd:string"/>
<xsd:element name="PAStateServiceCall">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/0/PAStateServiceCall;XSDElementDeclaration=2$MRObject"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Q1:Request"/>
<xsd:element ref="Q1:Response"/>
<xsd:element ref="Q1:Status"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="faultactor" type="xsd:string"/>
<xsd:element name="faultstring" type="xsd:string"/>
<xsd:element name="Response">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Request" type="xsd:base64Binary"/>
<xsd:complexType name="t_PAStateReport">
<xsd:sequence>
<xsd:element name="PAStateRptData" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="PAStateReport" type="Q1:t_PAStateReport">
</xsd:element>
</xsd:schema>
Output
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="t_PAStateRptMsg">
<xsd:sequence>
<xsd:element name="PAStateRptData" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="PAStateRptMsg" type="t_PAStateRptMsg">
<xsd:annotation>
<xsd:appinfo source="WMQI_APPINFO">
<MRMessage messageDefinition="/0/PAStateRptMsg;XSDElementDeclaration$MRObject"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:schema>
Input Message
<?xml version="1.0" encoding="UTF-8"?>
<PAStateServiceCall xmlns:dp="http://www.datapower.com/extensions">
<Request>V2VsZG9uIE1vb3Jl</Request>
<Response>
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/03/addressing/fault</wsa:Action>
<wsa:MessageID>uuid:d87fb62f-e67d-4c3c-9d46-227d3a3571ff</wsa:MessageID>
<wsa:RelatesTo>uuid:e1b2bf95-c3bb-4e66-ae94-fa98d461e3ab</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-328a2692-fc64-411b-a497-b509612ea684">
<wsu:Created>2007-06-13T20:46:12Z</wsu:Created>
<wsu:Expires>2007-06-13T21:11:12Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server unavailable, please try later</faultstring>
<faultactor>https://www.nedsstest.state.pa.us/ELRWebService/elrws.asmx</faultactor>
</soap:Fault>
</soap:Body>
</soap:Envelope>
</Response>
<Status>... No communication Error. Message from Web Service Attached. ... WebService faults are not monitored. So please parse this XML for the fault messages if any....</Status>
</PAStateServiceCall>
Output Message
<?xml version="1.0"?>
<PAStateRptMsg xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<PAStateRptData>V2VsZG9uIE1vb3Jl</PAStateRptData>
</PAStateRptMsg>
Input Message Parsing from MQInput Node
Msg Domain: MRM : For binary, text or XML messages (namespace aware, validation, low memory use)
Message Set: TRD_State_Rpt_Status_Handler_MsgSet (BMPNI3O002001)
Message Type: PAStateServiceCall
Message Format: XML1
ESQL from Compute Node
CREATE COMPUTE MODULE TRD_State_Rpt_Status_Handler_BuildRequestMessage
CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN
CALL CopyMessageHeaders();
SET OutputLocalEnvironment = InputLocalEnvironment;
--Copy the Properties file
SET OutputRoot.Properties = InputRoot.Properties;
DECLARE Prprts REFERENCE TO OutputRoot.Properties;
SET Prprts.MessageSet = 'C9T5G2G002001';
SET Prprts.MessageType = 'PAStateRptMsg';
SET Prprts.MessageFormat = 'XML1';
SET OutputRoot.MRM.PAStateRptData = InputRoot.MRM.Request;
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
END MODULE;
 |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 13, 2007 2:24 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Here's your problem:
Code: |
<xsd:element name="Request" type="xsd:base64Binary"/>
|
When using MRM XML physical format, you have to explicitly set the property 'Encoding' to 'Base64' (on the XML properties of the element) if you want it to be decoded by the MRM parser.
If it still does not work then you probably have a mismatch between your message definition and your input message. You can diagnose that by either
a) taking a user trace and looking for warnings about self-defining elements
b) enabling validation in your flow - you will get errors if you have a mismatch. |
|
Back to top |
|
 |
wraymore |
Posted: Thu Jun 14, 2007 5:22 am Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
I checked my input message set Physical Properties and the encoding is set to Base64.
So I tried turning on validation for the compute node that moves the request data from input to output. Did not get any exceptions when executing. So I turned on a user trace and found out that the message did not match the artifacts of the message set and was being processed as self-defining (BIP5493W). I generated the xsd from this same particular message, but something is apparently crossed up.
 |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 14, 2007 6:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
In your schema, request is in the namespace 'omittedNamespace'. In your instance doc it has no namespace. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 14, 2007 6:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kimbert wrote: |
In your schema, request is in the namespace 'omittedNamespace'. In your instance doc it has no namespace. |
This is the number one reason why MRM-XML messages do not get processed properly - the namespace in the model does not match the namespace in the message.
It's also a royal joy to troubleshoot if you don't know to look for it explicitly and exactly. Things like forgetting to put a "/" at the end of a namespace, or adding one - for example, can drive you insane until you start doing a character-by-character comparison of the two namespaces. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|