hello all,

i have to validate an xml request and check the product database to find out whether the product is in stock or not.

Once the request is parsed i need to read the table to validate that the details sent is present in the database. If not respond with error message. If found, then generate the response according to whether the product is available in stock or not.

this is my request format:

Code:
Request Format
<stockRequest>
  <siteDetails>
    <siteId>12</siteId>
    <siteToken>!!!”$W£%W$£E$£</siteToken>
  </siteDetails>
  <productDetails>
    <productId>ABCDEFGH</productId>
    <quantityRequested>10</quantityRequested>
  </productDetails>
</stockRequest>
this is the response format i need:

Code:
<stockResponse>
  <siteDetails>
    <siteId>12</siteId>
    <siteToken>!!!”$W£%W$£E$£</siteToken>
  </siteDetails>
   <productDetails>
    <productId>ABCDEFGH</productId>
    <quantityInStock>10</quantityInStock>
    <productStatus>IN_STOCK</productStatus>
  </productDetails>
<stockResponse>
Can you help me in writing a php program by which i can validate this

Thanks in advance