Click here to Skip to main content
15,914,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
My Client has provide us with the Web Service URl with UserName and password.Im Trying to consume Non .Net Web service in Asp.net using VB.Net through code behind . My code is -
VB
Dim request As HttpWebRequest
Dim response As HttpWebResponse = Nothing
Dim reader As StreamReader

Try

    request = HttpWebRequest.Create("https://webserviceurl")
     request.Method ="POST";
    request.Timeout = 15 * 10000
    request.Credentials = New NetworkCredential("UserName","Password")
    request.ContentLength = 0
    response = DirectCast(request.GetResponse(), HttpWebResponse)
    reader = New StreamReader(response.GetResponseStream())
    Console.WriteLine(reader.ReadToEnd())
Finally
    If Not response Is Nothing Then response.Close()
End Try


But Iam getting the error Number: 500

Please kindly guide me to resolve this issue.

Thanks in advance.
Posted
Updated 3-Dec-13 3:49am
v3
Comments
Sergey Alexandrovich Kryukov 3-Dec-13 9:26am    
This is VB.NET, not "VB". Add the tag "VB.NET" to the question. Do you have WSDL?
—SA
Veera anil 3-Dec-13 9:42am    
yep we have wsdl

As you have WSDL (thank you for answering my question), this is all what you need, in addition to the service itself. Please see:
http://en.wikipedia.org/wiki/WSDL[^].

Basically, you create a stub for the service using the "wsdl.exe" utility: http://msdn.microsoft.com/en-us/library/7h3ystb6%28v=vs.100%29.aspx[^].

You create a stub generated and use it in your project.

Here is the short walk-through manual: http://www.sitepoint.com/net-web-services-5-steps-2/[^].

You can find many other samples or descriptions of the steps on the Web, please see: http://bit.ly/1hvDidt[^].

—SA
 
Share this answer
 
The data return from the web service should be in the JSON Format. Because almost all language which are support data transmission are supporting the JSON.
Then you can easily consume the cross language web service .
 
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