Why aren't web service methods available remotely?

  • Thread starter Thread starter axel22
  • Start date Start date
A

axel22

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;
}

}
 
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
 
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.
 
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!
 
Hi,

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
 
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>
 
Back
Top