?
Solved

How to make ASP .NET Web Service work in a Shared Hosting?

Posted on 2011-02-26
5
Medium Priority
?
695 Views
Last Modified: 2012-06-21
Hello,

I am trying to put a basic Hello World Web Service in my Go Daddy Shared hosting.
It is a basic default Hello World Web Service that Visual Studio 2010
automatically generates: it works in my local web machine: i can invoke and can see the
xml.

I have transferred the Service1.asmx and the Service1.cs file( in the App_Code folder ).
I can view the web service page, but I cannot invoke the web service method, and as a result I cannot
see the xml file where the "Hello World" string will be in side the <string> element.

Please see screen shot ... We can see though we can see the web service page, there is no invoke button.

As the web page has suggested to change the name space, I have changed the namespace to my website address,
but still I cannot see or do an invocation and as a result cannot see the generated xml. My question is

1)  what should I do so that I can see the return xml value from the
web service?
2) what should I do so that I can render the data of the web service in a web page ( for example, in mywebservicepage.aspx)?

Please suggest. HowToSeeTheReturnedXmlOrDisplaycontentWebpage HowToSeeTheReturnedXmlOrDisplaycontentWebpage
App_Code/Service1.cs
==========================

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;

//[WebService(Namespace = "http://tempuri.org/")]
[WebService(Namespace = "http://www.mySiteName.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class Service1 : System.Web.Services.WebService
{
    public Service1 () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string HelloWorld() {
        return "Hello World.................";
    }
    
}
---------------------------------------------------------------------------------------------
Service1.asmx
===================
<%@ WebService Language="C#" CodeBehind="~/App_Code/Service1.cs" Class="Service1" %>

Open in new window

0
Comment
Question by:ashley2009
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:rg20
ID: 34989690
What do you get when you click the Hello World link at the top of your page?
0
 
LVL 3

Author Comment

by:ashley2009
ID: 34991775
Hello,

thank you for reading my problem statement. After I click the Hello World link, I go to a page that does not have an invoke button. Please observe the attached image.

I am not sure how to reference this web service in a .cs page so that I can render Hello World in an aspx
web page. Please give suggestions/advice so that I can fetch the data from the web service and can render it in an aspx page. For your information, I am my server is a shared hosting server at Go Daddy. HowToSeeTheReturnedXmlOrDisplaycontentWebpage


0
 
LVL 9

Expert Comment

by:rg20
ID: 34992990
My apologies, I seen the screenshots and got them reversed in my mind

The remote testing of a webservice is a security risk and therefore is not allowed in the browser, but you can override that

http://vidmar.net/weblog/archive/2004/07/16/380.aspx

You can also use a 3rd party tool to test it though.
0
 
LVL 3

Accepted Solution

by:
ashley2009 earned 0 total points
ID: 35146621
Hello rq20,

thank you for trying to help. The problem has been fixed for over a week, and, sorry, as I am posting solution after so long. The correct solution is at Expert Exchange:

http://www.experts-exchange.com/Programming/Languages/.NET/Q_22084691.html

and the current answer id is:

12/07/06 02:20 PM, ID: 18097671

By reading the answer, I put the service.asmx in my shared hosting at Godaddy's web folder and put the .cs file in App_Code folder. Then I created a new website and created .aspx file, did pre compilation, which generated dlls. Then I put the dlls in the Bin folder, and now I can see my service.asmx file and also the .aspx web page which accesses the web method from the web service.

As i solved the problem by doing internet Google research, I am going to choose my answer as correct answer.

This problem is now solved, and I am closing this problem.
0
 
LVL 3

Author Closing Comment

by:ashley2009
ID: 35178732
As i solved the problem by doing internet Google research, I am going to choose my answer as correct answer.

This problem is now solved, and I am closing this problem.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question