How It Works: Just enter the website url and the
schemaViewer will parse it for commented xml and
display text and a scrollable tree node of all
elements.
Basically the schema viewer takes
the url that you entered in the [ Web URL to
Parse] field, adds "&useSchemaView=y"
at the end of the url. This is done so that you
can tell your script to only output the
commented XML if that variable is included in
the URL.
Note, you must add a ? at the end of the url if it is a normal page with no
variables like this one.
What Your Web Page
Scripting may look like:
//send the request and get response
$responseXml = $session->sendHttpRequest($requestXmlBody);
What Your Need to include
after the above:
if($useSchemaView) {
echo "\r\n<!-- UsingSchemaView\r\n$responseXml\r\nEndOfSchemaView -->";
}
- It starts reading the commented
XML when it finds the line:
<!-- UsingSchemaView
- And stops reading the commented
XML when it finds the line:
EndOfSchemaView
-->
- Notice above that lines are seperated with \r\n.
Notes:
* schemaViewer should work with any
xml output that has the above
commenting lines before and after
the xml string regardless of the
source, web page, java-app.
The [Web URL to Parse] field will
not parse an actual xml file. It
will only start concating the xml
string if the above commented lines
are added to the output xml.
* Your actual "<?xml.....
" output can not be on
the same line as the "<!--
UsingSchemaView" line. Or
ending comment line.
* You can add aditional variables
for security purposes:
if($useSchemaView
&& $password) {
if($password == "myPassword") { ......
Then just add
&password=myPassword
to the URL.
You should prevent anyone from
seeing your xml data.
You can view [Request] and
[Response] formats to any of the eBay Unified
Schema calls.
Just select the call from the drop down list and
click the format button you would like to view.
Request or Response.
The output is shown as a Tree
View scroll and as normal text in the Source
View text area.
Clicking on the [Docs] button will
lauch your browser window to the selected eBay
Unified Schema call.
Viewing computer or web based XML files:
Click the File -> Open menu and enter the file name or website url for
this XML file.