Kalde epay capture med httprequest og envelope
Når jeg kalder deres webservice får jeg fejl nr 405. Method is not allowed.Er der nogen der ved hvorfor?
Min kode ser sådan her ud
string soapenv = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' >" +
"<soap:Body>" +
"<capture xmlns='https://ssl.ditonlinebetalingssystem.dk/remote/payment'>" +
"<merchantnumber>****</merchantnumber>" +
"<amount>"+Convert.ToInt32(reader["Pris"]) +"</amount>" +
"<pwd>kodeord</pwd>" +
"<orderid>"+reader["Betalingsreference"]+"</orderid>" +
" </capture></soap:Body></soap:Envelope>";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://ssl.ditonlinebetalingssystem.dk");
req.Headers.Add("SOAPAction", "https://ssl.ditonlinebetalingssystem.dk/remote/payment/capture");
req.ContentType = "text/xml; charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
using (Stream stm = req.GetRequestStream())
{
using (StreamWriter stmw = new StreamWriter(stm))
{
stmw.Write(soapenv);
}
}
WebResponse response = req.GetResponse();
StreamReader responseStream = new StreamReader(response.GetResponseStream());
string label = responseStream.ReadToEnd();
responseStream.Close();