TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Soumya Rao
NA
6
4.4k
How to pass multiple values to web service in VB.net
May 27 2016 3:38 AM
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 :
Imports
MySql.Data.MySqlClient
Imports
OutlookAddIn2.mantistest
Dim
QService
As
New
MantisConnectPortTypeClient
Private
Sub
Button1_Click(sender
As
Object
, e
As
EventArgs)
Handles
Button1.Click
Dim
value1
As
String
Dim
value2
As
String
Dim
value3
As
String
Dim
value4
As
String
Dim
viewstate
As
String
value1 = Project_Name.SelectedItem.ToString()
value2 = ComboBox2.SelectedItem.ToString()
value3 = ComboBox3.SelectedItem.ToString()
value4 = TextBox4.Text
Dim
s
As
String
=
String
.Format(
"Value 1: {0} value2 : {1} value3: {2} value4: {3}"
, value1, value2, value3, value4)
Windows.Forms.MessageBox.Show(s)
TextBox1.Text = QService.mc_issue_add(username:=
"**"
, password:=
"**"
, issue:=
"view_state:{0} project{1}"
)
End
Sub
The input parameters of my web service are :
Project
Category
Priority
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
This is the function for that particular module in the webservice
Function
mc_issue_add(
ByVal
username
As
String
,
ByVal
password
As
String
,
ByVal
issue
As
mantistest.IssueData)
As
<System.ServiceModel.MessageParameterAttribute(Name:=
"return"
), System.Xml.Serialization.SoapElementAttribute(DataType:=
"integer"
)>
String
Where have I gone wrong? I have tried using other arguments with single input values and it works fine. Appreciate any assistance.
Reply
Answers (
1
)
filter record from listbox
not able to make connection to remote server in c#