User-565527305 posted
getting a http 405 error when calling an asmx web service using php. have configured iis to allow GET, POST on the server. any assistance is greatly appreciated.
here's the recieving code for the web service:
private string[][] BuildParameters(string myparam)
{
string[][] parameters = new string[0][];
parameters[0] = new string[] { "@myparam", myparam, "3" };
return parameters;
}
[WebMethod]
public object GetScalarValue(string title)
{
dataAccess = new DA();
dataAccess.ConnectionString = GetConnectionString();
dataAccess.ProcedureName = "ExecStoredProcedure";
dataAccess.ProcedureParameters = BuildParameters(myparam);
return dataAccess.GetScalarValue();
}
here's the calling php code:
<?php
$soap_client = new SoapClient(null, array(
'location' => 'http://TestWebservice.test.web.service',
'uri' => 'http://tempuri.org/',
));
try {
$param = array(
'myparam' => '000150',
);
$info = $soap_client->__soapCall('GetScalarValue’ ', array($param));
print ‘<pre>’ . print_r($info, TRUE) . ‘</pre>’;
} catch (SoapFault $fault) {
echo $soap_client->__getLastRequestHeaders();
$error = 1;
print('Sorry, service returned the following ERROR: ' . $fault->faultcode . '-' . $fault->faultstring);
}
?>