所以我想要做什麼(讀取:失敗)的簡短摘要:我創建一個Web服務,接受客戶的信用卡信息,他們有在我的表單(「用戶名」,「密碼」,「TransType」等)中輸入到文本框中,並將它們傳遞給處理我們信用卡交易的另一家公司的web服務。NotImplementedException是未處理,但刪除拋出新的'NotImp ..'行
using IntegrityWebService.SmartPaymentsService;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace IntegrityWebService
{
public partial class Form1 : Form
{
private string MagData;
//public static string transactResponse;
public Form1()
{
InitializeComponent();
}
private void btnSubmit_Click(object sender, EventArgs e)
{
SmartPaymentsSoapClient transact = new SmartPaymentsSoapClient();
transact.ProcessCreditCard(UserName, Password, TransType, CardNum, ExpDate, MagData, NameOnCard, Amount, InvNum,
PNRef, Zip, Street, City, State, CVNum, ExtData);
}
所以這裏是我在那裏「拋出新的NotImplementedException();」行,但我擺脫了它,仍然存在問題。真的不知道我在這裏做錯了什麼。它突出了上面前兩行中的「交易」。這是我需要聲明的東西嗎?任何能給我任何幫助的人都會感到困惑和沉重。我很遺憾接受了我的老闆的這個挑戰,他知道我以前從未做過任何web服務/ SOAP工作。
/*private void ProcessCreditCard(TextBox userName, TextBox password, ComboBox transType, TextBox cardNum, TextBox expDate, string magData, TextBox nameOnCard, TextBox amount, TextBox invNum, TextBox pNRef, TextBox zip, TextBox street, TextBox city, TextBox state, TextBox cVNum, TextBox extData)
{
}*/
}
爲什麼我仍然得到NotImplementedException錯誤?
*「爲什麼我仍然得到NotImplementedException錯誤?」 *因爲一些代碼行的地方拋出它,你正在執行該行。查看堆棧跟蹤並找出位置。如果你的Web服務不再實現'ProcessCreditCard'方法,那麼看起來似乎是合理的,那麼當你嘗試調用它時,可能會拋出一個* not implemented exception *。 –