Skip to content

Instantly share code, notes, and snippets.

@gghhh456
Created January 25, 2016 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gghhh456/d7ebc23c7c43a3697b74 to your computer and use it in GitHub Desktop.
Save gghhh456/d7ebc23c7c43a3697b74 to your computer and use it in GitHub Desktop.
<?php
$xml = file_get_contents('myxmlfile.xml');
$url = "http://webservices.test.aspx";
$post_data = array(
'xml' => $xml,
);
$stream_options = array(
'http' => array(
'method' =>'POST',
'header'=> "content-type: application/xml",
'content' => http_build_query($post_data),
)
);
$context = stream_context_create($stream_options);
$response = file_get_contents($url, false, $context);
print_r($response);
?>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="GetItemInfo"
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<GetItemInfo>
<Authentication>
<Username>Test1</Username>
<Password>test123</Password>
<OrderID>4528412158352483213215</OrderID>
</Authentication>
<ItemNumber>Itemnumber123</ItemNumber>
<Manufacturer>Bosch</Manufacturer>
<Origin>10</Origin>
<Quantity>10</Quantity>
</GetItemInfo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment