• prerak desai
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 8
    Replies
Public void getXMLFromList(){
        List<Map<String, Object>> lstMapField = new List<Map<String, Object>>();
        List<String> lstsObjectName = new List<String>();
        lstsObject = [Select Id, Name From Account Limit 5];     
        String accountsJSON = JSON.serialize(lstsObject);
        System.debug('accountsJSON ::'+accountsJSON);
        Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe();     
        if(lstsObject != null && lstsObject.size() > 0){
            for(sObject objA : lstsObject){
                String obj = objA.getSObjectType().getDescribe().getName();                
                Schema.SObjectType sobjType = gd.get(obj);
                Schema.DescribeSObjectResult describeResult = sobjType.getDescribe();
                Map<String,Schema.SObjectField> fieldsMap = describeResult.fields.getMap();  

                System.debug('fieldsMap.keySet() ::'+fieldsMap.keySet());       
                Map<String, Object> queriedFieldValues = new Map<String, Object>();        
                for (String fieldName: fieldsMap.keySet()) {
                    System.debug('fieldName og'+fieldName);
                    try {                             
                        queriedFieldValues.put(fieldName, objA.get(fieldName));
                    } catch (SObjectException e){
                        // Intentional capture
                        queriedFieldValues.put(fieldName,'');                         
                    }
                }        
                lstMapField.add(queriedFieldValues);
                lstsObjectName.add(obj);
                System.debug('lstMapField ::'+lstMapField);         
            }
        }        
        strXML = '';          
        attachment = new Attachment();
        XmlStreamWriter w = new XmlStreamWriter();        
        w.writeStartDocument(null, '1.0');
        if(lstMapField != null && lstMapField.size() > 0){
            Integer  i = 0;            
            for(Map<String, Object> mapField : lstMapField){
                w.writeStartElement(null, lstsObjectName[i], null);           
                for(String strField : mapField.keySet()){
                    w.writeStartElement(null, strField , null);
                    w.writeCharacters(String.valueOf(mapField.get(strField)));
                    w.writeEndElement();                     
                }
                w.writeEndElement();                          
                i++;
            }
        }
        w.writeEndDocument();            
        String xmlOutput = w.getXmlString();
        system.debug('xmlOutput --> '+ w.getXmlString());
        strXML = w.getXmlString();
       // strXML = accountsJSON;
        w.close();           
url :https://ap1.salesforce.com/services/Soap/c/10.0
============
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv='https://dotnetwebservice-developer-edition.ap1/services/Soap/class/HelloWebService/'
      xmlns:xsd='http://www.w3.org/2001/XMLSchema'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <soapenv:Header>
     <ns1:SessionHeader soapenv:mustUnderstand='0' xmlns:ns1='urn:enterprise.soap.sforce.com'>
     <ns2:sessionId xmlns:ns2='urn:enterprise.soap.sforce.com'>00D90000000xMmK!ARUAQNR9Gs47t6qpqBkf2WiLZBmI9HMXHZnzn0HMAvVDWuyfZDo3S8oSnO0l1eBia049KLTnkFwKdeOONpsQg3ULylIkmXlT</ns2:sessionId>
     </ns1:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>   
 <soapenv:getHelloName>
    <soapenv:result></soapenv:result>
 </soapenv:getHelloName>
  </soapenv:Body>
  </soapenv:Envelope>

guy i dont what went wrong in the code i've got an error
"The SOAP request must use SOAP 1.1, did not recieve a SOAP 1.1 Envelope as the document root"
 
I'm unable to understand parameter for Saprfc.ini  file , even i don't know from where i'd get all these values ?

DEST=sapr3
TYPE=A
ASHOST=sapr3
SYSNR=00
RFC_TRACE=0

 
Hey ,
I am SFDC developer i want to mapp a Account object field with the SAP XYZ Object which act same as Account object in SF ??
SF has Account , so what SAP have for the same ????
Hey there ,
I stuck to get version number , i'd managed to get version name n all like 'XYZ..' but what i want is "V1.0 or 1.1 " like this
anybody there ???
 
Below is the link that show you how this problem rise with a chrome browser
http://stackoverflow.com/questions/25732645/tabbing-between-inputs-broken-on-1-select-to-autocomplete-input-and-2-input-mac
Hi there,
As we know the URL Param for Save is SaveURL but i am unable to do same with Save & New , any how i've override Save & New.
I'm unable to understand parameter for Saprfc.ini  file , even i don't know from where i'd get all these values ?

DEST=sapr3
TYPE=A
ASHOST=sapr3
SYSNR=00
RFC_TRACE=0

 
Hey ,
I am SFDC developer i want to mapp a Account object field with the SAP XYZ Object which act same as Account object in SF ??
SF has Account , so what SAP have for the same ????
Hey there ,
I stuck to get version number , i'd managed to get version name n all like 'XYZ..' but what i want is "V1.0 or 1.1 " like this
anybody there ???
 
Below is the link that show you how this problem rise with a chrome browser
http://stackoverflow.com/questions/25732645/tabbing-between-inputs-broken-on-1-select-to-autocomplete-input-and-2-input-mac
Hi there,
As we know the URL Param for Save is SaveURL but i am unable to do same with Save & New , any how i've override Save & New.