Jump to content

WebService c#

vorticalbox

So i have just started uni this module is web services where we have to right a client and a server. the labs are written in visual basic and i rather use c# however this first lab is giving me grief.

 

visual basic code

Dim service As New WebServiceX.StockQuoteSoapClient (“StockQuoteSoap”) Dim serviceReturn As String Try       serviceReturn = service.GetQuote(txtTicker.Text)       MessageBox.Show(serviceReturn) Catch ex As Exception      MessageBox.Show("A stock quote for this ticker was not available.") End Try

My code for c#

WebServiceX.StockQuoteSoapClient service = new WebServiceX.StockQuoteSoapClient();            string serviceReturn;            try{                serviceReturn = service.GetQuote(txtTicker.Text);                MessageBox.Show(serviceReturn);            }catch            {                MessageBox.Show("No quote for this ticker");            }

However i am getting "An unhandled exception of type 'System.IvailedOperationException' in System.servicemodel.dll

 

in additional information it says it could not load because more than one end point config was found.

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Ok fixed it just needed to add the quoted text in my c# 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×