Вы могли попробовать это:
find. -name *.ear -exec du {} \;
Это даст Вам размер в байтах. Но команда du также принимает параметры-k для КБ и-m для МБ. Это даст Вам вывод как
5000 ./dir1/dir2/earFile1.ear
5400 ./dir1/dir2/earFile2.ear
5400 ./dir1/dir3/earFile1.ear
Вы можете использовать UploadString . Вам необходимо правильно установить заголовки Content-Type
и SOAPAction
:
class Program
{
static void Main(string[] args)
{
using (var client = new WebClient())
{
// read the raw SOAP request message from a file
var data = File.ReadAllText("request.xml");
// the Content-Type needs to be set to XML
client.Headers.Add("Content-Type", "text/xml;charset=utf-8");
// The SOAPAction header indicates which method you would like to invoke
// and could be seen in the WSDL: <soap:operation soapAction="..." /> element
client.Headers.Add("SOAPAction", "\"http://www.example.com/services/ISomeOperationContract/GetContract\"");
var response = client.UploadString("http://example.com/service.svc", data);
Console.WriteLine(response);
}
}
}
Вы можете попробовать использовать класс webclient и опубликовать XML-файл в службе.