web stats
Trouble with Namespaces and ports to host inbound Web Services (Web Service reader) - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-20-2014, 07:53 AM
dzilberman dzilberman is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Location: San Francisco, CA
Posts: 71
dzilberman is on a distinguished road
Unhappy Trouble with Namespaces and ports to host inbound Web Services (Web Service reader)

Hello,

I apologize for boring the Forum with questions on the same subject - but Mirth is not my main activity and I still have some issues to resolve for the use case I'm implementing.
The attached channel (thanks to Eduardo for helping out before) should accept an inbound Web Service call, parse X12 payload out of SOAP Message (also attached as Tesia270.xml) , depending on one of its elements route execution to either SOAP Web Service call or HTTP RESTFul GET call (the latter I couldn't even test yet)

The problem was that when I used SOAP and X12 templates for Source connector, it was essentially ignoring actual message content, such as for this X12 payload:

Quote:
<real:Input270>
ISA*00* *00* *12*DEFCOM *01*999999999 *120117*1719*U*00400*000006768*0*P*&gt;
GS*HS*4405197800*999999999*20120117*1719*1421*X*00 4010VICS
ST*270*1234
BHT*0022*13*1*20010820*1330
HL*1**20*1
NM1*PR*2******PI*123456789
HL*2*1*21*1
NM1*1P*2******SV*987654321
HL*3*2*22*0
NM1*IL*1*DOE*JANE****MI*345678901
EQ*30**FAM
SE*10*1234
GE*1*1421
IEA*1*000006768
</real:Input270>
the Transformed message still had whatever was in output template:
Quote:
....
<ISA.05>
<ISA.05.1>12</ISA.05.1>
</ISA.05>
<ISA.06>
<ISA.06.1>ABCCOM </ISA.06.1> <== should be DEFCOM
</ISA.06>
<ISA.07>
<ISA.07.1>01</ISA.07.1>
</ISA.07>
When I removed all the Templates from the Source transformer and tried to parse out name spaces with wild cards (as Eduardo recommended):

Code:
msg = SerializerFactory.getSerializer('EDI/X12').fromXML(msg.*::Body.*::Process270.*::Input270.toString());
logger.info('Converted XML message to EDI X12 format:' + msg.toString());
I am now getting Source transformer failing with this error:

Quote:
32: //SerializerFactory.getSerializer('EDI/X12').fromXML(message);
33: //msg = SerializerFactory.getSerializer('EDI/X12').fromXML(msg);
34: msg = SerializerFactory.getSerializer('EDI/X12').fromXML(msg.*::Body.*::Process270.*::Input27 0.toString());
35: logger.info('Converted XML message to EDI X12 format:' + msg.toString());
36: //msg = SerializerFactory.getSerializer('EDI/X12').fromXMLSerializerFactory.getSerializer('EDI/X12').fromXML(message);
37: if ('xml' === typeof msg && msg.hasSimpleContent()) { msg = msg.toXMLString(); }if ('xml' === typeof tmp && tmp.hasSimpleContent()) { tmp = tmp.toXMLString(); }
38: }
LINE NUMBER: 34
DETAILS: Wrapped com.mirth.connect.donkey.model.message.XmlSerializ erException: Error converting XML to EDI
at 15f65fbf-c57d-4b45-accb-c16f9fb00445:34 (doTransform)
at 15f65fbf-c57d-4b45-accb-c16f9fb00445:39 (doScript)
at 15f65fbf-c57d-4b45-accb-c16f9fb00445:41
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:134)
at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.call(JavaScr iptFilterTransformer.java:100)

... 6 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 10; Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
I'd also like to have a working version of parsing a SOAP response with mixed name spaces like in the attached sample - I know there were posts on that but I still can't figure out what is the best syntax to use for iteration over XML nodes.

many thanks,
Dan Z
Attached Files
File Type: xml Test Eligibility Dispatcher NameSpace Problems.xml (29.3 KB, 2 views)
File Type: xml Tesia_270.xml (1.0 KB, 2 views)
Reply With Quote
  #2  
Old 02-20-2014, 07:54 AM
dzilberman dzilberman is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Location: San Francisco, CA
Posts: 71
dzilberman is on a distinguished road
Default

OH, and the ports question: can different Web Services readers be hosted on the same port (say 8088)? I was getting HTTP server errors trying to deploy those so had to use different ports for different services. Is there a workaround for that - opening multiple ports on AWS where our Mirth is hosted is a problem. Thanks
Reply With Quote
Reply

Tags
web service port, x12, xml name spaces

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation