By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

How to pass multiple values to web service in VB.net

P: 1
I have created a form in VB.net, where on-click of a button multiple variables are passed to a web service. My code is as below :

Expand|Select|Wrap|Line Numbers
  1. Imports MySql.Data.MySqlClient
  2. Imports OutlookAddIn2.mantistest
  3. Dim QService As New MantisConnectPortTypeClient
  4.  
  5.  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  6.         Dim value1 As String
  7.         Dim value2 As String
  8.         Dim value3 As String
  9.         Dim value4 As String
  10.         Dim viewstate As String
  11.  
  12.  
  13.         value1 = Project_Name.SelectedItem.ToString()
  14.         value2 = ComboBox2.SelectedItem.ToString()
  15.         value3 = ComboBox3.SelectedItem.ToString()
  16.         value4 = TextBox4.Text
  17.         Dim s As String = String.Format("Value 1: {0}  value2 : {1} value3: {2} value4: {3}", value1, value2, value3, value4)
  18.         Windows.Forms.MessageBox.Show(s)
  19.  
  20.         TextBox1.Text = QService.mc_issue_add(username:="**", password:="**", issue:="view_state:{0} project{1}")
  21.  
  22.     End Sub
The input parameters of my web service are :
  1. Project
  2. Category
  3. Priority
  4. Status

When I try to put them in following ways I get the following errors :

Code : issue:=("Category:{0} project{1}",value1, value2)
Error : value1 saying that a named argument is expected.
Code : TextBox1.Text = QService.mc_issue_add(username:="**", password:="**", view_state:=value1, Project:=value2)
Error : Argument not specified for parameter issue of public function QService.mc_issue_add(Username as String, Password as String, issue as mantistest.Issuedata)As string

Where have I gone wrong? I have tried using other arguments with single input values and it works fine. Appreciate any assistance.
May 26 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.