Problem referencing web service

J

John

Hi

I am trying to get web reference to my first (!) web service which is on a
remote host. I am getting the following error;

Server Error in '/' Application.

Runtime Error
Description: An application error occurred on the server. The current custom
error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

How can I tackle this problem? I have the below web.config file.

Thanks

Regards


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" />
<authentication mode="None" />
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true" />
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>
 
C

Craig Deelsnyder

Hi

I am trying to get web reference to my first (!) web service which is on a
remote host. I am getting the following error;

Server Error in '/' Application.

Runtime Error
Description: An application error occurred on the server. The current custom
error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

How can I tackle this problem? I have the below web.config file.

Thanks

Regards


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="Off" />
<authentication mode="None" />
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true" />
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

Are you sure it's not the web service on the other end w/ problems?
Sounds like they're throwing an exception on their end; are they a .NET
webservice? Cuz this error message could not be from your web.config
(you have custom errors off). If it's a .NET webservice, and you can
browse to the .asmx URL in your web browser, try that and see if it
comes up w/ the documentation page. You may not be able to do this as
they could disable that functionality.
 
J

John

Hi

The same problem comes in a web browser. How can I check remotely, where the
error in web service is? It worked fine on my local server.

Thanks

Regards
 
C

Craig Deelsnyder

Hi

The same problem comes in a web browser. How can I check remotely, where the
error in web service is? It worked fine on my local server.

Thanks

Regards


a

custom

application

however,

Are you sure it's not the web service on the other end w/ problems?
Sounds like they're throwing an exception on their end; are they a .NET
webservice? Cuz this error message could not be from your web.config
(you have custom errors off). If it's a .NET webservice, and you can
browse to the .asmx URL in your web browser, try that and see if it
comes up w/ the documentation page. You may not be able to do this as
they could disable that functionality.
Well, you can't, as I assume this is someone else's webservice? The
reason is they have customErrors set to RemoteOnly in the service's
web.config, so you can't see the actual error unless you browse to it on
the server's browser itself. I would contact whoever owns it and say
you're getting an error. More than likely, something is erroring on
their side, causing you to not be able to use it.

Otherwise, if it's your webservice on another box you control, goto that
box and browse the same way, or change customErrors to Off in the
webservice's web.config.
 
J

John

It is my web service and it works fine on my local server. Just doesn't work
when uploaded to the remote server. I have now tried a very simple project
(posted under separate thread) which also does not work at the remote server
but I can not see any error message to figure out what to do.

Thanks

Regards


 
J

John Saunders

John said:
It is my web service and it works fine on my local server. Just doesn't work
when uploaded to the remote server. I have now tried a very simple project
(posted under separate thread) which also does not work at the remote server
but I can not see any error message to figure out what to do.

You should be trapping your errors in one way or another. Do you have a
handler for the Error event in global.asax? It could trap the error and then
write it out somewhere.

Given that this is a web service, you'd probably want to write the error to
the system event log. You'll want to create a
System.Diagnostics.EventLogTraceListener in Application_Start, and add it to
the System.Diagnostics.Trace.Listeners collection. Then, in the Error
handler, you can use
"System.Diagnostics.Trace.WriteLine(Server.GetLastError().ToString())".

The only complication is that the event source must already exist, as the
ASPNET account by default has enough privileges to write an event, but not
enough to create a new event source. You would want to create an event log
installer first. Here's what you do:

1. Open global.asax _in the designer_
2. From the toolbox, drag an EventLog component (from the Components tab)
onto the design surface.
3. With the new event log selected, use the Property browser to set the Log
and Source properties. You should set the Log to "Application" and the
Source to one of your choice, perhaps the name of the Web Service.
4. If you right-click the event log component, you'll see a menu choice for
"Add Installer". Select this. This will add an appropriately-configured
event log installer to your project.
5. Build your web service

Now, after deploying the new web service assembly to your remote server,
you'll have to run the installutil utility against the new assembly, on the
remote server. For instance, use Terminal Services to connect to the remote
server, then use a command prompt to connect to the bin directory of your
web service and enter the command:

installutil -i <webServiceAssembly>.dll

That will run the event log installer to install the event source, and your
web service should be able to write to it. Note that you will only need to
run installutil if the event log installer properties change, or if you want
to remove the event log source.

I hope that helps.
--
John Saunders
johnwsaundersiii at hotmail

 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top