No announcement yet.

XML to SOAP prefix not bound error

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

    Many thanks, DB
    Attached Files

  • #2
    Your channel is set to strip namespaces on outbound for the destination connector.


    • #3
      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


      • #4
        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('');
        var res = new Namespace("");

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

        tmp.soapenv::Body.res::ReceiveResult.res:atientId = 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:


        • #5
          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=""
          <m:BAPI_PATIENT_GETDETAIL.Response xmlns:m="urn:sap-com:document:sap:rfc:functions">

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

          var soapenv = new Namespace ('');
          var m = new Namespace ('urn:sap-com:document:sap:rfc:functions');

          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.