天天看點

C#調用axix2釋出的Web服務(參數為int時,異常:未處理 System.Web.Services.Protocols.SoapException Message="unknown

服務端

public boolean init(int i);

用戶端

int i = 1;

bool b1 = true;

bool ret;

bool spec;

service.init(i, b1, out ret, out spec);

注意:一定要将b1設定為true,否則會抛出異常,因為參數i是int類型,而非string類型,我推測可能其他非string類型的參數,如double,float等也都是這樣的

未處理 System.Web.Services.Protocols.SoapException

  Message="unknown"

  Actor=""

  Node=""

  Role=""

  StackTrace:

    位于 System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)

    位于 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

    位于 TBCMonitor.TBCWebService.Service.initIndexno(Int32 batchCode, Boolean batchCodeSpecified, Boolean& return, Boolean& returnSpecified)

    位于 TBCMonitor.ui.AttachLabelForm.btnGetOrder_Click(Object sender, EventArgs e)

    位于 System.Windows.Forms.Control.OnClick(EventArgs e)

    位于 System.Windows.Forms.Button.OnClick(EventArgs e)

    位于 System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)

    位于 System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)

    位于 Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)

    位于 System.Windows.Forms.Form.ShowDialog()

    位于 TBCMonitor.ui.MainForm.picAttachLabel_Click(Object sender, EventArgs e)

    位于 System.Windows.Forms.Control.OnClick(EventArgs e)

    位于 System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)

    位于 System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)

    位于 Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)

    位于 System.Windows.Forms.Application.Run(Form fm)

    位于 TBCMonitor.Program.Main()