web stats
Strip Namespaces? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2014, 12:32 AM
discofris discofris is offline
OBX.1 Kenobi
 
Join Date: Jan 2014
Location: Belgium
Posts: 45
discofris is on a distinguished road
Thumbs up Strip Namespaces?

Hey all.
I have a channel which transforms an HL7 to XML, which is then send via SOAP to a WebService.
Sending an XML to the WebService works, I got also responses. But the WebService is very specific in the layout of the XML.

This has to be my final XML:
Code:
<ADT xmlns="http://tempuri.org/ADT_HL7_ManageADTA01.xsd">
  <cSite>WS_LOCATION1CODE_IN</cSite>
  <cRecord_number>1111</cRecord_number>
  <cLast_name>Last Name</cLast_name>
  <cFirst_name>First Name</cFirst_name>
</ADT>
Problem is that with the default strip namespaces on, the xmlns="http://tempuri.org/ADT_HL7_ManageADTA01.xsd" is stripped and the WebService rejects then my message.
So when I deactived the strip namespaces my XML to the WebService is accepted nicely, only problem is it doesn't get parsed now .

I also tried with adding
Code:
default xml namespace = 'http://tempuri.org/ADT_HL7_ManageADTA01.xsd';
after disabling Strip Namespaces. But no luck ...

Attached my Channel. Could someone point me in the good direction?
Attached Files
File Type: xml TransformToSoapXML.xml (35.0 KB, 36 views)

Last edited by discofris; 01-09-2014 at 01:47 AM.
Reply With Quote
  #2  
Old 01-07-2014, 06:47 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Do this instead:

Code:
var ns = new Namespace('http://tempuri.org/ADT_HL7_ManageADTA01.xsd');
tmp.addNamespace(ns);
Then in your message builder, use this for the Message Segment:

Code:
tmp.ns::['cRecord_number']
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 01-07-2014, 07:27 AM
discofris discofris is offline
OBX.1 Kenobi
 
Join Date: Jan 2014
Location: Belgium
Posts: 45
discofris is on a distinguished road
Thumbs up

Waw 'narupley' ... I'm speechless
Worked like a charmed ... looking forward to my next bump on the road.

Many thanks for your prompt help!!
Reply With Quote
  #4  
Old 08-19-2014, 12:30 AM
discofris discofris is offline
OBX.1 Kenobi
 
Join Date: Jan 2014
Location: Belgium
Posts: 45
discofris is on a distinguished road
Default

Thread bump ... sorry ...

I tried the above for an XML where the text nodes are one node deeper.
My final XML should look like this:

Code:
<ADT xmlns="http://tempuri.org/ADT_HL7_ManageADTA01.xsd">
<SiteDetails>
  <cSite>WS_LOCATION1CODE_IN</cSite>
</SiteDetails>
<PatientDetails>
  <cRecord_number>1111</cRecord_number>
  <cLast_name>Last Name</cLast_name>
  <cFirst_name>First Name</cFirst_name>
</PatientDetails>
</ADT>
But I can't seem to figure out how to do this, works great with all textnodes in the root node, but not with the textnodes in separate nodes ... any help appreciated ... thanks!
__________________
Mirth Connect Server 3.4.1.8057
Java version: 1.8.0_101

on Debian 8.5 and various Winboxes
Reply With Quote
  #5  
Old 08-19-2014, 06:40 AM
skekasaurus skekasaurus is offline
OBX.3 Kenobi
 
Join Date: Dec 2013
Posts: 145
skekasaurus is on a distinguished road
Default

It's the same process, just make sure you also tack on the namespace for all the children you go into...something like...

Code:
tmp.ns::['PatientDetails'].ns::['cRecord_number']
Reply With Quote
  #6  
Old 08-19-2014, 08:02 AM
discofris discofris is offline
OBX.1 Kenobi
 
Join Date: Jan 2014
Location: Belgium
Posts: 45
discofris is on a distinguished road
Default

Got it. Thanks!
__________________
Mirth Connect Server 3.4.1.8057
Java version: 1.8.0_101

on Debian 8.5 and various Winboxes
Reply With Quote
Reply

Tags
namespace, xml

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 01:45 AM.


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