I have created a webservice that basically does an insert into two tables in a database. I have also created a ASP.Net page with a form. I want to submit the form data to the webservice I have created. I am new to .Net. All the code I have found online is binding
a grid or such to a webservice. Does anyone have any sample for submitting data to a webservice? I am using webmatrix for my development tool. I have created a proxy with the namespace wsNoteCard. This is pinted to the webservice "http://localhost:8080/wbsrvNotecard.asmx".
The function is called InsertUser the parameters you can see string string string string string string string string string string string string string string string string dateTime string string string string string I have a button that I click on the form.
Anyone have a decent place to start?
Hi This is how I have implemented calling web service from forms... I have a button for UPDATE which calls a Server Function ButtonUpdate_OnClick(......) Inside the function looks like this Dim UpdateTable as New MyWebService() Dim UpdateResult as String UpdateResult
= UpdateTable.MyWebMethod(Field1,Field2,Field3,Field4,.....) UpdateReault should now hold any return message from your Webservice - Saved, Failed etc Mat
I figured this one out finaly. I used Tools/Web Proxy Generator to create the proxy(how do I do this for IIS I have not yet discovered). Here is the code that noew works The proxy I finally created call Note. Sub Button1_Click(sender As Object, e As EventArgs)
'************************************************************** ' Declaration '************************************************************** dim fldLastLogon as date = "01/01/1999" dim fldPhone1 as string = "" dim fldext1 as string = "" dim fldPhone2 as string
= "" dim fldext2 as string = "" dim fldcounty as string = "" dim fldanswer as string = "" dim fldfax as string = "" dim fldname as string = "" dim fldquestion as string = "" '****************************************************************** ' Create webservice
instance 'Declaration format: Dim variablename As New Namespace.Class '****************************************************************** dim wsNote as new Note.notecard() '**************************************************************** ' Call web service
'**************************************************************** wsNote.InsertUser(fldDioceseName.value, fldAddress1.value, fldAddress2.value, fldCity.value, left(fldState.DataTextField,2), fldZipCode.value, fldPhone1, fldExt1, fldPhone2, fldExt2, fldFax,
fldUserName.value, fldFirstName.value, fldLastName.value, fldPassword.value, fldLastLogon, fldName, fldEmail.value, fldQuestion, fldAnswer, cint(fldDayId.value))
wer2chosen
Member
15 Points
3 Posts
consuming webservice from server side form
Aug 20, 2003 04:42 AM|LINK
MatN
Member
105 Points
21 Posts
Re: consuming webservice from server side form
Aug 20, 2003 04:22 PM|LINK
wer2chosen
Member
15 Points
3 Posts
Re: consuming webservice from server side form
Aug 22, 2003 04:52 PM|LINK