cancel
Showing results for 
Search instead for 
Did you mean: 

php sample code connection soap call request

hanifeoglu
Discoverer
0 Kudos

Hi i try to connect with php soap web services and i want call one a request product SS18 category

i m need sample php code curl, or anything

Thanks

$xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
		   <soapenv:Header/>
		   <soapenv:Body>
		      <urn:ZsdB2b0001>
		         <!--Optional:-->
		         <IInput>
		            <Season>SS18</Season>
		         </IInput>
		      </urn:ZsdB2b0001>
		   </soapenv:Body>
		</soapenv:Envelope>';

Accepted Solutions (0)

Answers (1)

Answers (1)

hanifeoglu
Discoverer
0 Kudos

Hi everyone,

in my case done now no need any help, my solutions is here

<?php
$curl = curl_init();
$credentials = base64_encode('user:pass');
curl_setopt_array($curl, array(
  CURLOPT_PORT => "8000",
  CURLOPT_URL => "here ws url ",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "Here post request xml put it",
  CURLOPT_HTTPHEADER => array(
	'Authorization' => 'Basic ' . $credentials,
    "Content-Type: text/xml",
    "SOAPAction: urn:sap-com:document:sap:soap:functions:mc-style:ZSD_WS_B2B:ZsdB2b0001Request",
    "cache-control: no-cache"
  ),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
	echo $response;
}

if you need anyone help contact me
salih Hanifeoglu
salih@ketencek.com