Gracias a todos de antemano.
Tengo una archivo de datos en disco con formato DBF, y lo he pasado a XML. La cuestión es que un proveedor de mi cliente le exige mandar el archivo XML,que contiene datos de las compras realizadas a una URL, y no se como hacerlo.
Necesitaría que alguien me indicase como realizar el envío de este archivo, teniendo en cuenta que lo que ha enviado el proveedor es lo siguiente:
The XML file of transactions will be submitted using an https POST operation, using an encoding type of “multipart/form-data”. The url for the service will be:
https://proveedor.com.Submit
Three parameters must be supplied:
uid – a username to be agreed
pwd – the password for the specified uid
uploadfile – the XML file
Parts Transaction Submission Process
The XML file of transactions will be submitted using an https POST operation, using an encoding type of ?multipart/form-data?. The url for the service will be:
https://proveedor.com/servlet/services.com..Submit
Three parameters must be supplied:-
uid ? a username to be agreed
pwd ? the password for the specified uid
uploadfile ? the XML file
Sample html
The following HTML page generates a form allowing the user to browse for the file, and then to submit it. (Note that the url, username and password are examples only. The actual url, username and password will be advised)
<html>
<head>
</head>
<body>
<form action="https://proveedor.com/servlet/services.com..Submit?
"
enctype="multipart/form-data"
method="POST">
<input type="hidden" name=uid value='USERNAME'>
<input type="hidden" name=pwd value='password'>
<br>
File to upload: <input size=45 type=file name=uploadfile>
<input type='submit' name='upload_button' value='Submit'>
</form>
</body>
</html>
Response
The response will be an XML document. The http status will also be set to an appropriate value (200 for
OK, 4xx for error). The response is sent as soon as the XML document has been received and validated
against the schema. It therefore cannot report on errors found during processing.
Sample responses
This example response indicates a successful submission: -
<?xml version="1.0" encoding="UTF-8" ?>
- <DMSSubmissionReport>
<Success Message="The file has been stored and will be loaded shortly." />
</DMSSubmissionReport>
This example is for a submission that is unsuccessful because the file does not conform to the XML schema (Note that only the first error will be reported): -
<?xml version="1.0" encoding="UTF-8" ?>
<DMSSubmissionReport>
<Error Message="Error on line 11 of document : Datatype error: Value '2003-13-04' is not legal value for current datatype. The month must have values 1 to 12." />
</DMSSubmissionReport>