mpp ku xml

Maida MS Project (MPP) zuwa XML ta amfani da .NET REST API.

A cikin saurin bunƙasa yanayin sarrafa ayyuka da musayar bayanai, buƙatun canza Microsoft Project (MPP) fayiloli zuwa [XML](https:/ /docs.fileformat.com/web/xml/) ya sami muhimmiyar mahimmanci. Ƙarfin fassara hadaddun tsare-tsaren ayyuka da bayanai ba tare da ɓata lokaci ba zuwa tsarin XML ya zama kadara mai mahimmanci ga masu sarrafa ayyukan, manazarta bayanai, da masu haɓaka software. Wannan labarin yana zurfafa cikin mahimman buƙatun MPP zuwa jujjuyawar XML da nufin haɓaka haɗin gwiwar bayanai, haɗa bayanan aikin tare da wasu aikace-aikacen, ko don haɓaka ƙarfin nazarin bayanai.

API ɗin NET REST don Gudanar da Fayilolin Ayyukan MS

Aspose.Tasks Cloud SDK for .NET kayan aiki ne mai ɗimbin yawa wanda ke ba da dama mai yawa don sarrafa bayanan aikin da fayiloli. Siffar juyawa ta MPP zuwa XML babban aiki ne wanda ke ba ku damar canza fayilolin Ayyukan Microsoft cikin wahala zuwa tsarin XML. Ta hanyar canza fayilolin MPP zuwa XML tare da .NET REST API, za ku sami ikon raba, bincika, da haɗa bayanan aikin tare da wasu aikace-aikace, bayanai, da tsarin. Bugu da ƙari, wannan hanyar kuma tana sauƙaƙe bayanan aiki masu rikitarwa zuwa tsari mai tsari, wanda mutum zai iya karantawa, yana tabbatar da daidaiton bayanai da daidaito.

Domin amfani da SDK a cikin aikinku, da fatan za a bincika ‘Aspose.Tasks-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Wannan zai ƙara bayanin SDK a cikin aikin ku. Na biyu, sami takaddun shaidar abokin ciniki daga dashboard ɗin girgije.

Idan ba ku da asusun da ke akwai, kawai ƙirƙiri asusun kyauta ta bin umarnin da aka ƙayyade a cikin labarin saurin farawa.

Maida MPP zuwa XML tare da C# .NET

Da fatan za a bi umarnin da aka bayar a ƙasa don canza MPP zuwa XML akan layi, wanda ke buɗe duniyar yuwuwar.

TasksApi tasksApi = new TasksApi(clientSecret, clientID);

Ƙirƙiri wani abu na ajin TasksApi yayin wucewa da bayanan abokin ciniki azaman mahawara ta shigarwa.

GetTaskDocumentWithFormatRequest formatRequest = new GetTaskDocumentWithFormatRequest()
{
    Format = ProjectFileFormat.Xml,
    Name = inputFile,
    ReturnAsZipArchive = false
};

Ƙirƙirar misalin Buƙatar inda muka ƙididdige sunan shigar da MPP, tsarin sakamako da ma’auni mai ƙayyadaddun idan fitarwar za a iya ajiye ZIP ko a’a.

var output = tasksApi.GetTaskDocumentWithFormat(formatRequest);

A ƙarshe, kira API don canza MPP zuwa XML akan layi kuma dawo da fitarwa a cikin misalin rafi.

saveToDisk(finalResponse, resultant);

Hanyar mu ta al’ada tana ba da damar adana sakamakon XML akan ma’ajiyar gida.

// Don ƙarin misalai, da fatan za a ziyarci https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-dotnet

// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/
string clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
string clientID = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";

// ƙirƙirar misalin TasksApi
TasksApi tasksApi = new TasksApi(clientSecret, clientID);

// Sunan shigar da fayil MPP
String inputFile = "Home move plan.mpp";
// sunan resultant fayil XML
String resultant = "resultant.xml";

// ƙirƙiri buƙatun sauya fayil MPP
GetTaskDocumentWithFormatRequest formatRequest = new GetTaskDocumentWithFormatRequest()
{
    Format = Aspose.Tasks.Cloud.Sdk.Model.ProjectFileFormat.Xml,
    Name = inputFile,
    // ba za a adana fitarwar sakamako azaman kunshin zip ba
    ReturnAsZipArchive = false
};

// yi canjin MPP zuwa XML kuma mayar da fitarwa azaman misali rafi
var output = tasksApi.GetTaskDocumentWithFormat(formatRequest);

// Hanyar al'ada don adana sakamakon fayil a kan tsarin gida
saveToDisk(response, resultant);

// Hanya don adana abun ciki na rafi zuwa fayil akan faifan gida
public static void saveToDisk(Stream responseStream, String resultantFile)
{
    var fileStream = File.Create(resultantFile);
    responseStream.Seek(0, SeekOrigin.Begin);
    responseStream.CopyTo(fileStream);
    fileStream.Close();
}
mpp ku xml

Samfoti na sauya MPP zuwa XML ta amfani da .NET REST API.

Za a iya sauke samfurin fayil ɗin MPP da aka yi amfani da shi a cikin misalin da ke sama daga Tsarin motsa gida.mpp.

Ajiye MPP zuwa XML ta amfani da Umarnin CURL

Canjin MPP zuwa XML ta amfani da Aspose.Tasks Cloud da umarnin cURL yana kawo sauƙi da inganci ga tsarin. Yin amfani da umarnin cURL yana ƙara daidaita tsarin jujjuyawar, yana ba ku damar haɗa wannan fasalin ba tare da matsala ba cikin aikace-aikacenku ko ayyukan aiki. Wannan tsarin yana ba ku ikon sarrafa MPP zuwa jujjuyawar XML, yana mai da shi zaɓi mai amfani ga waɗanda ke neman sarrafa manyan kundin bayanan aikin yadda ya kamata.

Mataki na farko a wannan hanyar shine samar da alamar samun damar JWT ta amfani da umarni mai zuwa:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=163c02a1-fcaa-4f79-be54-33012487e783&client_secret=c71cfe618cc6c0944f8f96bdef9813ac" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Da zarar muna da alamar JWT, da fatan za a aiwatar da umarni mai zuwa don fitarwa fayil ɗin MS Project (MPP) zuwa takaddar aikin Excel.

curl -X GET "https://api.aspose.cloud/v3.0/tasks/{sourceMPP}/format?format=xml&returnAsZipArchive=false" \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer <JWT Token>" \
-o Resultant.xml

Sauya sourceMPP tare da sunan shigar da fayil MPP da ake samu a cikin Ma’ajiyar gajimare kuma, maye gurbin `JWT Token’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, ko kun zaɓi canza MPP zuwa XML ta amfani da Aspose.Tasks Cloud tare da .NET SDK mai ƙarfi ko zaɓi don ingantaccen tsarin umarni na cURL, kuna da kayan aiki don saduwa da bukatun canza MPP zuwa XML yadda ya kamata. Don haka duk abin da kuka zaɓa, haɓakar Aspose.Tasks Cloud yana tabbatar da cewa zaku iya daidaita tsarin ku don dacewa da takamaiman buƙatunku, buɗe yuwuwar sauya MPP zuwa XML maras kyau a cikin ayyukanku.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: