Document Upload via HTTP POST

 

PHP Example

<?php $request = new HttpRequest(); $request->setUrl('https://sa.servername.com/SATestFileUpload/Fileupload.asmx'); $request->setMethod(HTTP_METH_POST); $request->setHeaders(array( 'postman-token' => 'df6d2bc2-39e9-f3ea-3f96-c9a62da5b357', 'cache-control' => 'no-cache', 'content-type' => 'text/xml' )); $request->setBody('<?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <UploadFile xmlns="http://localhost/"> <f>base64Binary</f> <fileName>test.xml</fileName> <caseNumber>1802864</caseNumber> </UploadFile> </soap12:Body> </soap12:Envelope>'); try { $response = $request->send(); echo $response->getBody(); } catch (HttpException $ex) { echo $ex; }

C# Example

var client = new RestClient("https://sa.servername.com/SATestFileUpload/Fileupload.asmx"); var request = new RestRequest(Method.POST); request.AddHeader("postman-token", "49867e69-f578-9149-96e5-173d60d7b8b3"); request.AddHeader("cache-control", "no-cache"); request.AddHeader("content-type", "text/xml"); request.AddParameter("text/xml", "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">\r\n <soap12:Body>\r\n <UploadFile xmlns=\"http://localhost/\">\r\n <f>base64Binary</f>\r\n <fileName>test.xml</fileName>\r\n <caseNumber>1802864</caseNumber>\r\n </UploadFile>\r\n </soap12:Body>\r\n</soap12:Envelope>", ParameterType.RequestBody); IRestResponse response = client.Execute(request);

 

Visit smartadvocate.com/support for other help options including how to access our Support Tracker and Daily Office Hours sessions.