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
TerryLuschenTerryLuschen 

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 )

<env:Body><dme:LoadPatient><dme:Mrn>1234</dme:Mrn></dme:LoadPatient></env:Body>

 

I also need to get xmlns:dme="http://gehcit.ge.com/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','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        //This did not do anything to the resulting XML
        //private String[] Mrn_type_info = new String[]{'Mrn','http://gehcit.ge.com/dme','string','1','1','true'};
        //false, false produces this:<m:LoadPatient xmlns:m="http://gehcit.ge.com/dme"><Mrn>08001074</Mrn></m:LoadPatient>
        //false, true produces this: <m:LoadPatient xmlns:m="http://gehcit.ge.com/dme"><Mrn>08001074</Mrn></m:LoadPatient>
        //true, false produces this: <LoadPatient xmlns="http://gehcit.ge.com/dme"><Mrn>08001074</Mrn></LoadPatient>
        //true, true produces this:  <LoadPatient xmlns="http://gehcit.ge.com/dme"><Mrn>08001074</Mrn></LoadPatient>
        //The second parameter doesn't seem to do anything
        private String[] apex_schema_type_info = new String[]{'http://gehcit.ge.com/dme','false','false'};
        //Putting the dme at the front of this did not help at all
        //private String[] apex_schema_type_info = new String[]{'dme:http://gehcit.ge.com/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.

 

WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://sap.com/xi/WebService/soap1.1',
              'http://gehcit.ge.com/dme',
              'LoadPatient',
              'http://gehcit.ge.com/dme',
              'LoadPatientResponse',
              'gehcitGeComDme3.LoadPatientResponse_element'}
            ); 

 

 My question is very similar to this post:

http://boards.developerforce.com/t5/Apex-Code-Development/Namespace-references-incorrect-and-unmanageable-in-the-generated/m-p/62626#M2640