Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

As a practice exercise, I've published a (very simple) web service,

http://www.myshoptour.com/WebServices/HelloWorldMST.asmx

The test page works great, but I am having problems consuming it in my website. My code is as follows:

Try
Dim wsProd As New wsHelloWorldMSTprod.HelloWorldMSTSoapClient()
wsProd.Open()
Select Case rblSelectHelloWorldType.SelectedIndex
Case 0
strOut = wsProd.HelloWorld1()
Case 1
strOut = wsProd.HelloWorld2()
Case Else
End Select
wsProd.Close()
Catch ex As Exception
End Try

The line with the "new" seems to be the problem. It does nothing. Seems like it does not return. I am unable to trace into it.

Can someone please tell me what I am doing wrong (and show me the correct code)?

Thanks in advance. And sorry if this is in the wrong category - it has been a while since I've posted here. I'm getting back into web development after a much needed break!

What I have tried:

The first time I published it, I was able to consume it fine. Then I made a simple change to the web service and published it again. Since then, consuming it in my website does not work.
Posted
Updated 1-Jan-17 17:53pm
v2
Comments
Afzaal Ahmad Zeeshan 1-Jan-17 17:11pm    
What problem are you facing? Is there an error, or code not generating expected results?
Nancy K 1-Jan-17 17:54pm    
I added this to the question above:
The line with the "new" seems to be the problem. It does nothing. Seems like it does not return. I am unable to trace into it.

1 solution

I finally got it to work, like this:
Originally:
Dim wsProd As New wsHelloWorldMSTprod.HelloWorldMSTSoapClient()
Fix:
Dim wsProd As New wsHelloWorldMSTprod.HelloWorldMSTSoapClient("HelloWorldMSTSo‌​ap")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900