Below is my code with curl. Why I'm getting the error message:
<html><head><title>Error</title></head><body>The parameter is incorrect. </body></html>
<?php
$xml='
<?xml version="1.0" encoding="iso-8859-1"?>
<Request><Send><Key>123123123</Key><Number>10</Number></Send><BInfo><LName>Pizza</LName><LAddress>somewhere</LAddress><LCity>city</LCity><LState>NY</LState><LZip>112</LZip><LPhone>131313132</LPhone></BInfo></Request>
';
$url = "https://www.myapplication.com/directory";
$page="/script.asp";
$post_string = $xml;
$page1="script.asp";
$header = "POST ".$page." HTTP/1.0 \r\n";
$header = "MIME-Version: 1.0 \r\n";
$header .= "Content-type: application/PTI26 \r\n";
$header .= "Content-length: ".strlen($post_string)." \r\n";
$header .= "Content-transfer-encoding: text \r\n";
$header .= "Request-number: 1 \r\n";
$header .= "Document-type: Request \r\n";
$header .= "Interface-Version: Test 1.4 \r\n";
$header .= "Connection: close \r\n\r\n";
$header .= $post_string;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
$data = curl_exec($ch); if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
}
print_r($data);
// use XML Parser on $data, and your set!
$xml_parser = xml_parser_create();
xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,1);
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);
print_r($val);