473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Webservice not working

I have created a web service on my local machine (C:\Inetpub\wwwroot\Converter) using vb.net version 1.1.

Purpose of webservice: this webservice will be invoked by a third party website (say abc.com). User will add a message in a webpage of abc.com this message will be sent to the Webservice.

Below mentioned is the code that I have written for a web service to store the parameters/message sent by third party application.

-- Service1.asmx page
Expand|Select|Wrap|Line Numbers
  1. Imports System.Web.Services
  2. Imports System.Web
  3. Imports System.Data.SqlClient
  4. Imports System.Collections.Specialized
  5. Imports System.Web.Services.Protocols
  6.  
  7. <System.Web.Services.WebService(Namespace:="http://www.MyWebsiteAddress.com/Converter/Service1")> _
  8. Public Class Service1
  9.     Inherits System.Web.Services.WebService
  10.  
  11.     ' WEB SERVICE EXAMPLE
  12.     ' The HelloWorld() example service returns the string Hello World.
  13.     ' To build, uncomment the following lines then save and build the project.
  14.     ' To test this web service, ensure that the .asmx file is the start page
  15.     ' and press F5.
  16.  
  17.  
  18.     <WebMethod()> _
  19.     Public Sub ProcessRequest(ByVal userKey As String, ByVal message As String, ByVal listen As String) // Mentioned here are the parameters will be sent to this web service
  20.       Dim strcon As String
  21.         strcon = "server=ip; database=dbname; uid=XXX; pwd=XXX"
  22.         Dim objConn As New SqlConnection(strcon)
  23.         Dim objTrans As SqlTransaction
  24.         objConn.Open()
  25.         objTrans = objConn.BeginTransaction
  26.         Dim strSQL As String = ""
  27.         strSQL = "insert into TableName (UserKey,Message,Voicelink)values"
  28.         strSQL = strSQL + "('" & userKey & "','" & message & "','" & listen & "')"
  29.         Dim cmd As New SqlCommand(strSQL, objConn)
  30.         cmd.Transaction = objTrans
  31.         cmd.CommandType = Data.CommandType.Text
  32.         cmd.ExecuteNonQuery()
  33.         objTrans.Commit()
  34.  
  35.     End Sub
  36.  
  37. End Class
  38.  
After testing the web service on a local envoirement I found that it is working properly. I uploaded service1.asmx, service1.asmx.vb files to the root directory of source code of online development web server and uploaded Converter.dll and Converter.pdb file to the bin folder of web server.
After doing this process i tested the webservice by http://MyWebsiteName.com/Service1.asmx and recived error "The test form is only available for requests from the local machine.".. To resolve this error I added below mentioned code in the web.cong file of application not in the web.config of Webservice.
Expand|Select|Wrap|Line Numbers
  1. <webServices>
  2.      <protocols>
  3.          <add name="HttpGet"/>
  4.         <add name="HttpPost"/>
  5.     </protocols>
  6.  </webServices> 
  7.  
after adding the above code webservice was working properly through the browser.

Now the third party application has asked to enter the link of webservice which will receive the hit when user add the message, so I have given it as http://MyWebsiteName.com/Service1.asmx.

But when I try to send the message from third party application as a part of testing in a real envoirenment I should get a hit to the above mentioned URL (Web Service), But, I'm not getting a hit(Data is not saved into the database).

So, I think, either my web service is not deployed properly (the porcess I have done of coping the files and .DLL to the development server is not sufficent to get the hit from third party) or the code written in SUB ProcessRequest is not able to recieve the query string parameters from the thrid party application.

Please note that I'm creating the web service in Microsoft Visual Studio .NET 2003 using VB.net

Please help its urgent.

Thanks,

Swapnil
May 14 '10 #1
1 2008
Frinavale
9,735 Expert Mod 8TB
SwapnilD:
But when I try to send the message from third party application as a part of testing in a real envoirenment I should get a hit to the above mentioned URL (Web Service), But, I'm not getting a hit(Data is not saved into the database).
Since you are able to consume to web service in your own code (I'm assuming you tested this properly), I would say that the 3rd party application isn't consuming your web service properly.

-Frinny
May 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
2
by: Scott | last post by:
Hi there, I am writing a webservice and am wanting to use Server.MapPath to get the path to some files on the server that is hosting the webservice. I am using VB.NET atm, but am learning C#, so...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
2
by: prad | last post by:
Hi, I am working with webservices in asp.net framework 2.0. when i run the webservice it didnot give any errors and it was working well but when I add it to one of my projects as add web...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
4
by: =?Utf-8?B?QmlsbEF0V29yaw==?= | last post by:
Hi, We recently converted a 1.1 project to 2.0 and this included a webservice which accepted XML for one of the parameters. Since converting to 2.0 I am getting the following message: --- A...
5
by: Jonathan Kay | last post by:
Hi, I'd like to my WCF webservice to work both on SSL and without. Unfortunately searching has led to dead ends, references to changes that only work on the old previous beta versions and I...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
2
by: Mike Endys | last post by:
Hi all, have problem to use login to the web service. Im thinking about the web service that provides datas and files to the WinForm Client. I want the client log-in to the application... here...
1
by: aaaash | last post by:
hi I have write my code in javascript file.here onclick and change function are not working in IE but working in firefox.. plz give solution for this as soon as possible.. Thanks in advance.....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.