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
byrdsbyrds 

HOW DO I GET XML DATA FROM WEB TO CUSTOM OBJECT FIELDS?

THANKS IN ADVANCE.
I AM TRYING TO GRAB THIS DATA FROM THE WEB, OUR URL IS SET UP WITH USERNAME AND PASS WORD.
THIS IS GPS DATA AND IS DYNAMIC SO WOULD CHANGE EACH TIME THE PAGE IS VISITED.
 
WOULD LIKE TO HAVE DATA POSTED IN TO SF CUSTOM OBJECT TO DISPLAY CURRENT STATUS OF EAVH TRUCK ON THEIR OWN RECORDS.
 
THANKS AGAIN
 
<Veh_Positions>
<Vehicle ivehicleid="353404016220052">
<data label="0210 Pablo Rodas" reg_number="832-274-3696" dtime="2012-08-15T19:10:11" flatt="29.738672" flong="-95.510833" heading="" speed="0.58" odometer="264821" event_type="Shutdown" event_code="202"driverid="0" vehicleid="353404016220052" gps="3" speed_mph="0.36" odometer_mi="164552.09" Driver="">
<pto/>
</data>
</Vehicle>
<Vehicle ivehicleid="353404016220063">
<data label="0247 Alfonso Quintanilla" reg_number="956-739-6923" dtime="2012-08-17T15:04:42" flatt="29.831770" flong="-95.208461" heading="" speed="0.07" odometer="50060" event_type="Shutdown"event_code="202" driverid="0" vehicleid="353404016220063" gps="3" speed_mph="0.04" odometer_mi="31105.83" Driver="">
<pto/>
</data>
</Vehicle>
<Vehicle ivehicleid="353404016220066">
<data label="0331 Juan Lopez" reg_number="832-217-0400" dtime="2012-08-17T19:59:05" flatt="31.135393" flong="-95.979401" heading="" speed="103.97" odometer="49514" event_type="Position" event_code="1"driverid="0" vehicleid="353404016220066" gps="3" speed_mph="64.60" odometer_mi="30766.56" Driver="">
<pto/>
</data>
</Vehicle>
Best Answer chosen by Admin (Salesforce Developers) 
JitendraJitendra

Hi,

Do you have any WSDL for this? if not then please follow below steps:

 

Add the source site in Remote Site setting.

Create Apex class and make HTTP Connection.

You will get the XML as string. You may need to parse the XML

 

Example of making http request 

http://shivasoft.in/blog/salesforce/getting-record-from-one-salesforce-organization-to-other/

 

Documentation of XMLStreamReader

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_XmlStream_reader.htm

All Answers

JitendraJitendra

Hi,

Do you have any WSDL for this? if not then please follow below steps:

 

Add the source site in Remote Site setting.

Create Apex class and make HTTP Connection.

You will get the XML as string. You may need to parse the XML

 

Example of making http request 

http://shivasoft.in/blog/salesforce/getting-record-from-one-salesforce-organization-to-other/

 

Documentation of XMLStreamReader

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_xml_XmlStream_reader.htm

This was selected as the best answer
byrdsbyrds

THANK YOU FOR THE REPLY.

NO I HAVE NOT SETUP A WSDL, BUT HAVE READ ABOUT IT AND I WAS THINKING I NEEDED TO SET THAT UP.

 

I WILL DO WHAT YOU SAID AND FOLLOW THE INFO IN THE LINKS YOU SENT.

 

I WILL KEEP YOU POSTED.  

THANKS AGAIN!

byrdsbyrds

THE WSDL WOULD BE FOR THE EXTERNAL SITE THAT IS POSTING THE XML DATA FEED?

I AM TRYING TO BRING THIS DATA IN TO SALESFORCE.

 

THANKS