Skip to content

Instantly share code, notes, and snippets.

@hamada147
Created November 14, 2018 10:47
Show Gist options
  • Save hamada147/77af9eba659e24021843196f107481e7 to your computer and use it in GitHub Desktop.
Save hamada147/77af9eba659e24021843196f107481e7 to your computer and use it in GitHub Desktop.
<?php
$soap_request = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dood="http://xmlns.oracle.com/apps/scm/doo/decomposition/receiveTransform/receiveSalesOrder/DooDecompReceiveOrderExternalComposite" xmlns:mod="http://xmlns.oracle.com/apps/scm/doo/decomposition/receiveTransform/receiveSalesOrder/model/" xmlns:mod1="http://xmlns.oracle.com/apps/scm/doo/processOrder/model/">
<soapenv:Header />
<soapenv:Body>
<dood:process>
<dood:OrchestrationOrderRequest>
<!--Optional:-->
<mod:SourceTransactionIdentifier>moussa.ahmed95@gmail.com</mod:SourceTransactionIdentifier>
<mod:SourceTransactionSystem>OPS</mod:SourceTransactionSystem>
<mod:SourceTransactionNumber>100006</mod:SourceTransactionNumber>
<mod:BuyingPartyType>ORGANIZATION</mod:BuyingPartyType>
<mod:FreezeTaxFlag>False</mod:FreezeTaxFlag>
<mod:BuyingPartyId>300000001416778</mod:BuyingPartyId>
<mod:ShipToPartySiteIdentifier>300000001416782</mod:ShipToPartySiteIdentifier>
<mod:BillToCustomerIdentifier>300000001416780</mod:BillToCustomerIdentifier>
<mod:BillToAccountSiteUseIdentifier>300000001416784</mod:BillToAccountSiteUseIdentifier>
<mod:TransactionalCurrencyCode>EGP</mod:TransactionalCurrencyCode>
<mod:TransactionOn>2018-11-06T16:52:01</mod:TransactionOn>
<mod:RequestingBusinessUnitIdentifier>300000001392231</mod:RequestingBusinessUnitIdentifier>
<mod:RequestingLegalUnitIdentifier>300000001391017</mod:RequestingLegalUnitIdentifier>
<mod:OrigSystemDocumentReference>ORIGSYS</mod:OrigSystemDocumentReference>
<mod:PartialShipAllowedFlag>false</mod:PartialShipAllowedFlag>
<mod:ShipToPartyType>ORGANIZATION</mod:ShipToPartyType>
<mod:ShipToPartyIdentifier>300000001416778</mod:ShipToPartyIdentifier>
<!--Zero or more repetitions:-->
<mod:OrchestrationOrderRequestLine>
<mod:SourceTransactionLineIdentifier>1</mod:SourceTransactionLineIdentifier>
<mod:SourceTransactionScheduleIdentifier>1</mod:SourceTransactionScheduleIdentifier>
<mod:SourceTransactionLineNumber>1</mod:SourceTransactionLineNumber>
<mod:SourceTransactionScheduleNumber>1</mod:SourceTransactionScheduleNumber>
<mod:RequestedFulfillmentOrganizationName>SAS</mod:RequestedFulfillmentOrganizationName>
<mod:InventoryOrganization>SAS</mod:InventoryOrganization>
<mod:SubInventoryCode>FG</mod:SubInventoryCode>
<mod:PaymentTerms>120 Days</mod:PaymentTerms>
<mod:TransactionCategoryCode>ORDER</mod:TransactionCategoryCode>
<mod:PartialShipAllowedFlag>false</mod:PartialShipAllowedFlag>
<mod:ProductNumber>01.FG.01.0003</mod:ProductNumber>
<mod:OrderedQuantity unitCode="EA">5</mod:OrderedQuantity>
<mod:OrderedUOM>Each</mod:OrderedUOM>
<mod:RequestedShipDate>2018-11-06T16:52:01</mod:RequestedShipDate>
<mod:TransactionCategoryCode>ORDER</mod:TransactionCategoryCode>
<mod:UnitListPrice currencyCode="EGP">5000</mod:UnitListPrice>
<mod:UnitSellingPrice currencyCode="EGP">5000</mod:UnitSellingPrice>
<mod:TaxExempt>S</mod:TaxExempt>
<mod:OrigSystemDocumentReference>ORIGSYS</mod:OrigSystemDocumentReference>
<mod:OrigSystemDocumentLineReference>ORIGSYSLINE</mod:OrigSystemDocumentLineReference>
<!--Zero or more repetitions:-->
<mod:LineCharge>
<mod:ChargeDefinitionCode>QP_SALE_PRICE</mod:ChargeDefinitionCode>
<mod:ChargeSubtypeCode>ORA_PRICE</mod:ChargeSubtypeCode>
<mod:PriceTypeCode>ONE_TIME</mod:PriceTypeCode>
<mod:PricedQuantity unitCode="EA">1</mod:PricedQuantity>
<mod:PrimaryFlag>true</mod:PrimaryFlag>
<mod:ApplyTo>PRICE</mod:ApplyTo>
<mod:RollupFlag>false</mod:RollupFlag>
<mod:SourceChargeIdentifier>PMCSC1</mod:SourceChargeIdentifier>
<mod:ChargeTypeCode>ORA_SALE</mod:ChargeTypeCode>
<mod:ChargeCurrencyCode>EGP</mod:ChargeCurrencyCode>
<mod:SequenceNumber>1</mod:SequenceNumber>
<!--Zero or more repetitions:-->
<mod:ChargeComponent>
<mod:ChargeCurrencyCode>EGP</mod:ChargeCurrencyCode>
<mod:HeaderCurrencyCode>EGP</mod:HeaderCurrencyCode>
<mod:HeaderCurrencyExtendedAmount currencyCode="EGP">5000</mod:HeaderCurrencyExtendedAmount>
<mod:PriceElementCode>QP_LIST_PRICE</mod:PriceElementCode>
<mod:SequenceNumber>2</mod:SequenceNumber>
<mod:PriceElementUsageCode>LIST_PRICE</mod:PriceElementUsageCode>
<mod:ChargeCurrencyUnitPrice currencyCode="EGP">5000</mod:ChargeCurrencyUnitPrice>
<mod:HeaderCurrencyUnitPrice currencyCode="EGP">5000</mod:HeaderCurrencyUnitPrice>
<mod:RollupFlag>false</mod:RollupFlag>
<mod:SourceChargeIdentifier>PMCSC1</mod:SourceChargeIdentifier>
<mod:SourceChargeComponentIdentifier>PMCSCC2</mod:SourceChargeComponentIdentifier>
<mod:ChargeCurrencyExtendedAmount currencyCode="EGP">5000</mod:ChargeCurrencyExtendedAmount>
</mod:ChargeComponent>
<mod:ChargeComponent>
<mod:ChargeCurrencyCode>EGP</mod:ChargeCurrencyCode>
<mod:HeaderCurrencyCode>EGP</mod:HeaderCurrencyCode>
<mod:HeaderCurrencyExtendedAmount currencyCode="EGP">5000</mod:HeaderCurrencyExtendedAmount>
<mod:PriceElementCode>QP_NET_PRICE</mod:PriceElementCode>
<mod:SequenceNumber>3</mod:SequenceNumber>
<mod:PriceElementUsageCode>NET_PRICE</mod:PriceElementUsageCode>
<mod:ChargeCurrencyUnitPrice currencyCode="EGP">5000</mod:ChargeCurrencyUnitPrice>
<mod:HeaderCurrencyUnitPrice currencyCode="EGP">5000</mod:HeaderCurrencyUnitPrice>
<mod:RollupFlag>false</mod:RollupFlag>
<mod:SourceChargeIdentifier>PMCSC1</mod:SourceChargeIdentifier>
<mod:SourceChargeComponentIdentifier>PMCSCC3</mod:SourceChargeComponentIdentifier>
<mod:ChargeCurrencyExtendedAmount currencyCode="EGP">5000</mod:ChargeCurrencyExtendedAmount>
</mod:ChargeComponent>
</mod:LineCharge>
</mod:OrchestrationOrderRequestLine>
<mod:OrderProcessingPreferences>
<!--Optional:-->
<mod:CreateCustomerInformationFlag>true</mod:CreateCustomerInformationFlag>
<!--Optional:-->
<mod:SubmitFlag>false</mod:SubmitFlag>
</mod:OrderProcessingPreferences>
<!--Zero or more repetitions:-->
</dood:OrchestrationOrderRequest>
</dood:process>
</soapenv:Body>
</soapenv:Envelope>
XML;
$WSDL = "https://ejeg-test.fa.em2.oraclecloud.com/soa-infra/services/default/DooDecompReceiveOrderExternalComposite/ReceiveOrderRequestService?WSDL";
$user = "---"; // actuall value do exist
$password = "---"; // actuall value do exist
try {
// prepare request
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_URL, $WSDL);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array(
'Content-Type: application/soap+xml; charset=utf-8',
'SOAPAction: "run"',
'Accept: text/xml',
'Cache-Control: no-cache',
'Pragma: no-cache',
'Content-length: '. strlen($soap_request),
'User-Agent: PHP-SOAP/7.0.10'
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_USERPWD, $user.":".$password);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POSTFIELDS, $soap_request);
// send request
$response = curl_exec($ch);
if (empty($response)) {
throw new SoapFault('CURL error: '.curl_error($ch), curl_errno($ch));
}
curl_close($ch);
$this->response([
"replyCode" => 0,
"replyMessage" => "success",
"rawResponse" => $response
]);
} catch (Exception $e) {
$this->response([
"replyCode" => -1,
"replyMessage" => "failed creating order",
"error" => $e,
"request" => $soap_request
]);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment