function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Controlling Namespace in generated Soap Message

I have imported a WSDL and I am trying to call that Web Service using the WebServiceCallout.invoke method.


I need to produce XML that looks like this:  ( I cannot figure out how to get a dme: prefix in front of those XML tags )



I also need to get xmlns:dme="" within the <env: tag.


Any ideas?


I know that modifying this produces some different results...


public class LoadPatient_element {
        public String Mrn;
        private String[] Mrn_type_info = new String[]{'Mrn','','string','1','1','false'};
        //This did not do anything to the resulting XML
        //private String[] Mrn_type_info = new String[]{'Mrn','','string','1','1','true'};
        //false, false produces this:<m:LoadPatient xmlns:m=""><Mrn>08001074</Mrn></m:LoadPatient>
        //false, true produces this: <m:LoadPatient xmlns:m=""><Mrn>08001074</Mrn></m:LoadPatient>
        //true, false produces this: <LoadPatient xmlns=""><Mrn>08001074</Mrn></LoadPatient>
        //true, true produces this:  <LoadPatient xmlns=""><Mrn>08001074</Mrn></LoadPatient>
        //The second parameter doesn't seem to do anything
        private String[] apex_schema_type_info = new String[]{'','false','false'};
        //Putting the dme at the front of this did not help at all
        //private String[] apex_schema_type_info = new String[]{'dme:','false','false'};
        private String[] field_order_type_info = new String[]{'Mrn'};


Also, modifying the line in red should do something, but I do not see a change.


              new String[]{endpoint_x,


 My question is very similar to this post: