You need to sign in to do that
Don't have an account?
Nitesh Agarwal
VF Page, Sandbox, XML
Dear All,
Greetings of the day!
I have created an apex class and a VF page to display some data in XML format. I have developed it in one sandbox and it was working fine on it and sample data was getting displayed in XML format through VF page, then realised that was not a true copy of production. so I made a true copy of production on another sandbox, and then created the same apex class and VF page with same code and same naming conventions.
For my surprise, the VF page is not displaying anything on this sandbox.
Can anybody suggest, what could be the reason for this.
Below are codes
VF Page
<apex:page Controller="StreamExample" contentType="text/xml" showHeader="true" sidebar="false" cache="false"> </apex:page>
Apex Class Code
public class StreamExample{
public StreamExample()
{
XmlStreamWriter writer = new XmlStreamWriter();
writer.writeStartDocument('utf-8', '1.0');
writer.writeStartElement(null, 'DEXFileUpload', null);
writer.writeStartElement(null, 'Clients', null);
writer.writeEndElement(); //closing tag for Clients
writer.writeEndElement();//closing tag for Dex
writer.close();
}
}
Thanks in Advance
Regards
Nitesh
Greetings of the day!
I have created an apex class and a VF page to display some data in XML format. I have developed it in one sandbox and it was working fine on it and sample data was getting displayed in XML format through VF page, then realised that was not a true copy of production. so I made a true copy of production on another sandbox, and then created the same apex class and VF page with same code and same naming conventions.
For my surprise, the VF page is not displaying anything on this sandbox.
Can anybody suggest, what could be the reason for this.
Below are codes
VF Page
<apex:page Controller="StreamExample" contentType="text/xml" showHeader="true" sidebar="false" cache="false"> </apex:page>
Apex Class Code
public class StreamExample{
public StreamExample()
{
XmlStreamWriter writer = new XmlStreamWriter();
writer.writeStartDocument('utf-8', '1.0');
writer.writeStartElement(null, 'DEXFileUpload', null);
writer.writeStartElement(null, 'Clients', null);
writer.writeEndElement(); //closing tag for Clients
writer.writeEndElement();//closing tag for Dex
writer.close();
}
}
Thanks in Advance
Regards
Nitesh
Controller
Page
NOTE: When including code, please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference
Thanks for the revert.
Howeverm the code is giving error when previewed VF page
Visualforce ErrorHelp for this Page
System.XmlException: Stream already closed
Class.StreamExample.getXML: line 16, column 1
Thanks dear