my $xml = <<"GENERATE_XML"; < GeStdDataInput > < Course>BE< /Course> < StdName>TestStudent< /StdName> < CourseFee>350000 < /GeStdDataInput > GENERATE_XML $xmlReq = array ( 'http' => array( 'method' =>"POST", 'header' => "Content-Type: application/xml\r\nAccept: application/xml", 'timeout' => 60, 'content' => $xml) ); $ulr = 'http://studentrecords.com/getStduentData'; $strCont = stream_context_create ($xmlReq); $filePoint = @fopen($url, 'rb', false, $strCont); if (!$filePoint){ $filePoint = @fopen($url, 'rb', false, $strCont); if (!$filePoint) { throw new Exception("Problem with $url, $php_errormsg"); } } $response = @stream_get_contents($filePoint); $response_array = array(); $response_array = simplexml_load_string($response);
Comments
Post a Comment