Announcement

Collapse
No announcement yet.

XML to SOAP prefix not bound error

Collapse
X
 
  • 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 3.0.1.7051

    Many thanks, DB
    Attached Files

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

    Comment


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

      Comment


      • #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('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: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:

        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

        Comment


        • #5
          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.

          Comment

          Working...
          X