12
TÉCNICA – APPLICATION PROGRAMMING INTERFACE MASTERWAY VISIT US

TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

TÉCNICA

– A P P L I C A T I O N P R O G R A M M I N G I N T E R F A C E

M A S T E R W A Y

V I S I T U S

Page 2: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

O Q U E É A A P I

$url = https://app.masterway.net/?action=apisoap&wsdl;

$xml = FicheiroEnvio.xml;

$client = new nusoap_client($url);

$result = $client->call('ComercialDocs', array('parameter'=>$xml));

$url = https://app.masterway.net/?action=apisoap&wsdl;

$linkfile = FicheiroEnvio . xml;

$xml = file_get_contents($linkfile);

$xml_post_string = '<?xml version="1.0" encoding="UTF-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body>

<AccountingDocs> // FUNCTION TO CALL

' . utf8_encode($xml) . '

</AccountingDocs>

</soap:Body>

</soap:Envelope>';

$headers = array(

"Content-type: text/xml;charset=\"utf-8\"",

"Accept: text/xml",

"Cache-Control: no-cache",

"Pragma: no-cache",

"SOAPAction: ",

"Content-length: " . strlen($xml_post_string),

);

Page 3: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

P AR A Q U E S ER V E

P AR Â ME T R O S

$ch = curl_init();

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

curl_setopt($ch, CURLOPT_TIMEOUT, 5000);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);

$url = https://app.masterway.net/?action=apisoap&wsdl&testmode=true&wsdl;

Page 4: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

F U N Ç Õ E S

$url = https://app.masterway.net/?action=apisoap&wsdl&testmode=true&wsdl;

Page 5: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

F IC H E IR O

Page 6: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =
Page 7: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =
Page 8: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =
Page 9: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

R E S PO ST A

[Errors]

{

[Reference]

[Msg]

}

[Imports]

{

[Reference]

[CompanyCode]

[Year]

[DocumentType]

[Serie]

[Journal]

[DocumentNumber]

}

[Confirmation]

{

[Reference]

[CompanyCode]

[Year]

[Journal]

[DocumentNumber]

}

[Information]

{

[Reference]

[Msg]

}

Page 10: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =
Page 11: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =
Page 12: TÉCNICA - Masterway · 2020-02-12 · FUNÇÕES $url =

a simplicidade e eficácia chegam ao seu negócio

www.masterway.net