web stats
XML to SOAP prefix not bound error - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2015, 08:40 AM
davebacon62 davebacon62 is offline
What's HL7?
 
Join Date: Mar 2015
Posts: 2
davebacon62 is on a distinguished road
Default XML to SOAP prefix not bound error

I am attempting to transform XML to SOAP to post results to a webservice, using the incoming xml and webservice wsdl as message templates.
I have tried fixes from previous posts using an addNamespace java script but still have "the "prefix "soapenv"for element "soapenv:Envelope" is not bound" error.
Any ideas greatly appreciated.
Mirth version is 3.0.1.7051

Many thanks, DB
Attached Files
File Type: xml ReportExportToWeb.xml (19.7 KB, 31 views)
Reply With Quote
  #2  
Old 03-23-2015, 11:17 AM
eduardoa eduardoa is offline
Mirth Employee
 
Join Date: Mar 2013
Location: Santa Fe Springs, California
Posts: 134
eduardoa is on a distinguished road
Default

Your channel is set to strip namespaces on outbound for the destination connector.
Reply With Quote
  #3  
Old 03-24-2015, 05:37 AM
davebacon62 davebacon62 is offline
What's HL7?
 
Join Date: Mar 2015
Posts: 2
davebacon62 is on a distinguished road
Default

I removed the strip namespaces option for the destination data types and this has fixed the prefix error but am now stuck on new errors in the transformer, specifically "cannot read xxx from undefined". I have used the drag and drop message Builder functionality to build the transformer mappings and don't see any issue with the messages templates?
Attached Files
File Type: xml ReportExportToWeb.xml (31.1 KB, 54 views)
Reply With Quote
  #4  
Old 03-24-2015, 02:02 PM
eduardoa eduardoa is offline
Mirth Employee
 
Join Date: Mar 2013
Location: Santa Fe Springs, California
Posts: 134
eduardoa is on a distinguished road
Default

You are setting the default namespace then using the default to extract elements that do not use that default. Don't set the default namespace unless you want to use an empty namespace for all elements that dont correspond to a namespace.

I suggest just setting your used namespaces:

var soapenv = new Namespace('http://schemas.xmlsoap.org/soap/envelope/');
var res = new Namespace("http://wales.nhs.uk/ResultsReporting");

Then in MessageBuilder or Javascript you can set/access elements this way:

tmp.soapenv::Body.res::ReceiveResult.res:atientI d = msg['Patient']['PatientIdentifier'][1]['IdentifierValue'].toString();

The drag and drop feature does not work well with namespaces at the moment so you will have to use this format(ns::node). There is a ton of posts on these forums regarding this topic:

http://www.mirthcorp.com/community/i...wse/MIRTH-3196
http://mirth.com/community/forums/sh...ad.php?t=10496
http://mirth.com/community/forums/showthread.php?t=9822
http://mirth.com/community/forums/sh...ad.php?t=11425
Reply With Quote
  #5  
Old 03-17-2017, 10:48 AM
KristinkaJu KristinkaJu is offline
What's HL7?
 
Join Date: Feb 2017
Posts: 1
KristinkaJu is on a distinguished road
Default

Hello,
Iīm new in Mirth Connect. I have to translate a SOAP XML to FHIR XML.
I have the same Problem, that I got Errors. I tried everything whatīs in the Forums is recomend, but it didnīt work.

This is my XML:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<m:BAPI_PATIENT_GETDETAIL.Response xmlns:m="urn:sap-com:document:sap:rfc:functions">
<PATIENT_DATA>
...
</PATIENT_DATA>
<ADRESSES>
...
</ADRESSES>
<RETURN/>
</m:BAPI_PATIENT_GETDETAIL.Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In the transformer i used a Mapper to transform the data:

var soapenv = new Namespace ('http://schemas.xmlsoap.org/soap/envelope/');
var m = new Namespace ('urn:sap-com:document:sap:rfc:functions');
logger.info(tmp.soapenv::Body.m::BAPI_PATIENT_GETD ETAIL.Response.m::['PATIENT_DATA'].toString());

and in the Mapping Step:
tmp.soapenv::Body.m::BAPI_PATIENT_GETDETAIL.Respon se.m::['PATIENT_DATA'].m::['FRST_NAME_PAT'] = msg['PID']['PID.5']['PID.5.2'].toString()

Can someone please help me?

Thanks in advance.
Reply With Quote
Reply

Tags
prefix transformer error, soap

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 11:57 AM.


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