473,386 Members | 1,668 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,386 software developers and data experts.

Why aren't web service methods available remotely?

I've made a web service in c# and published it with IIS. I can access
it's methods locally,
but when a colleague tried to access the Web Service over the Internet
using my IP address,
he succeeded in getting the xml interface, but he couldn't invoke any
methods.
I on the other hand can do it on my computer.
What do I do?
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://localhost/Published")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public int getNumber() {
return 186;
}

}

Nov 5 '06 #1
6 1796
Axel,

Repeately posting the almost same problem is not such a good idea to
microsoft newsgroups. You have to accept that they are 24 hours up, but
absolutely not by the same persons. As well do you have in the (western
world) weekends to wait a little bit longer.

However, have a look at my answers on your previous question first.

Cor

<ax****@gmail.comschreef in bericht
news:11**********************@e3g2000cwe.googlegro ups.com...
I've made a web service in c# and published it with IIS. I can access
it's methods locally,
but when a colleague tried to access the Web Service over the Internet
using my IP address,
he succeeded in getting the xml interface, but he couldn't invoke any
methods.
I on the other hand can do it on my computer.
What do I do?
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://localhost/Published")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public int getNumber() {
return 186;
}

}

Nov 5 '06 #2
Hm, the last problem was regarding sql connections, did
I already ask about this before? If so, then I apologize,
for it must have escaped me.

Nov 5 '06 #3
If your co-worker can set a webreference to your service with:

http://yourmachinename/yourserviceap...page.asmx?WSDL

Then he / she should be able to generate a webservice proxy class and make
method calls on it.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ax****@gmail.com" wrote:
I've made a web service in c# and published it with IIS. I can access
it's methods locally,
but when a colleague tried to access the Web Service over the Internet
using my IP address,
he succeeded in getting the xml interface, but he couldn't invoke any
methods.
I on the other hand can do it on my computer.
What do I do?
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://localhost/Published")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public int getNumber() {
return 186;
}

}

Nov 5 '06 #4
This is so strange. He cannot invoke any methods while
browsing the service, but when he includes a web reference
to it, he can do so. I should have tried so in the first place.

Thnx!

Nov 5 '06 #5
Hi,

ax****@gmail.com wrote:
This is so strange. He cannot invoke any methods while
browsing the service, but when he includes a web reference
to it, he can do so. I should have tried so in the first place.

Thnx!
If by "browsing", you mean navigating to the ASMX address using the web
browser, it's exact that you cannot invoke the methods when the browser
is not using "localhost". This is actually described when you click on
the method name, there is this sentence:

"The test form is only available for requests from the local machine"

Is that what you mean?

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 6 '06 #6
This is not complete, there are more items and attributes you can look up at
MSDN, but if "browsing" webservice access is what you want:

<system.web>
<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
</webServices>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ax****@gmail.com" wrote:
This is so strange. He cannot invoke any methods while
browsing the service, but when he includes a web reference
to it, he can do so. I should have tried so in the first place.

Thnx!

Nov 6 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Michael Riggio | last post by:
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP? Thanks, -Mike
5
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the...
0
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
4
by: Blaxer | last post by:
I have read approximately 30 articles now on various methods to make your vb.net application automatically update itself and I can't see how they apply to a vb.net windows services projects. The...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
3
by: =?Utf-8?B?QS4gUm9iaW5zb24=?= | last post by:
I have been looking high and low and can't seem to find anything a little more detailed on the whole RS utility. What I'm looking for specifically is some type of programming reference. Also, I...
3
by: =?Utf-8?B?bGVvMg==?= | last post by:
Hi All, I have a question which might be a beginner's question. I have a webservice whose webmethod has to call a window's service and get back the results. What is the best way to implement...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.