Showing posts with label attempting. Show all posts
Showing posts with label attempting. Show all posts

Saturday, March 31, 2012

WEB SERVER error - connection could not be established

Can anyone help with the problem below?
Thanks.
-----------

Dear All,

I was attempting to open up one of my Web applications when I
received this message:
The Web server reported the following error when
attempting to create or open the Web project located at
URL: 'http:localhost/TravelLifeQuote'.'A connection could not be
established.

I tried reinstalling the IIS server, that did not help in terms of
establishing the connection. I also tried followed the recommended
help steps i.e. typing in 'aspnet_regiis /i' but unfortunately this
showed no effect.

Does anyone know how this problem can be solved. Your help would be
greatly appreciated.

Regards,

ReplyI tried reinstalling the IIS server, that did not help in terms of
establishing the connection. I also tried followed the recommended
help steps i.e. typing in 'aspnet_regiis /i' but unfortunately this
showed no effect.

---

Please try deleting the contents of the:
\Documents and Settings\<user>\VSWebCache\

Directory.

This might help.

Saturday, March 24, 2012

Web Service Limitation ?

Hi All,

I am attempting to call a Web Service that has a nested repeating element of the same type as it's parent. Below is a simplified example represented as a class. After successfully creating a WebReference, I attempted to create the service and got the old 'File or assembly name ..., or one if it's dependancies, was not found.' After much research, it appears to be a serializer problem because the exception occurs during the creationg of the service. I am able to call this WebService from other type of clients. Is this a problem of the Framework, Visual Studio or Visual Basic? I am using Framework 1.1, Visual Studio 2003. Can VisualStudio 2005 handle this.

Class Case
CaseDescription as String
CaseNumber as String
ChildCases as Case()
End Class

Ok, I figured this one out. When I added the web reference the following incorrect code was generated in the Reference.vb class. The ChildCases() declaration was incorrectly generated with double parentheses. See corrected code below. I also had to add [] around Case as it is a keyword.

Generated Code:

<System.Xml.Serialization.XmlArrayItemttribute(

GetType(Case), IsNullable:=false)> _
Public ChildCases()()As [Case]

Corrected Code:

<System.Xml.Serialization.XmlArrayItemttribute(

GetType([Case]), IsNullable:=false)> _
Public ChildCases()As [Case]

Thanks

Monday, March 12, 2012

Web Services - Unauthorized

I am attempting to create my first web service. I am now stuck at the following error.

Exception Details:System.Net.WebException: The request failed with HTTP status 401: Unauthorized.

I believe I have included the necessary code for assistance. If anything else is needed please let me know and I will reply ASAP.

Test.asmx<%@dotnet.itags.org. WebService Language="VB" CodeBehind="~/App_Code/Test.vb"Class="Test" %>
/App_Code/Test.vbImports System.WebImports System.Web.ServicesImports System.Web.Services.Protocols<WebService( _Namespace:="http://serverName.dev.intranet/")> _Public Class TestInherits System.Web.Services.WebService <WebMethod()> _Public Function PI()As Double Return System.Math.PIEnd Function <WebMethod()> _Public Function HelloWorld()As String Return"Hello World"End FunctionEnd Class
Client.aspx.vb...Sub btn1_Click( _ByVal senderAs Object, _ByVal eAs EventArgs)Dim srvAs New intranet.dev.serverName.Test srv.Credentials = System.Net.CredentialCache.DefaultCredentials lblTest.Text = srv.PIEnd Sub...
 
web.config...<authentication mode="Windows"/><identity impersonate="false"/>...
 
Thank you for your help.

Update -

When I run this on the development server (http://serverName.dev.intranet) it fails. When I run it on my local machine (http://localhost:port/...) it works. I hope that helps pinpoint the problem.

Thank you again for all of your help.


Usually this error means that the client application is not sending any credentials or the credentials are wrong. But I think you are setting the credentials correctly in your btn1_Click event handler. Most likely the permissions on the folder where the web service is located are not properly setup for IUSR_xxx.

Can you provide a description of your serverName.dev.intranet environment? Is it a shared hosting plan? Do you have full access to a dedicated server? etc.


It is an shared hosting environment on a corporate intranet. I do not have full access to the server settings.

You are probably correct about the folder permissions. Without having access to the server how can I get this to work?


If you know a network username andpassword that is guaranteed to have permissions to that folder you can try using aNetworkCredential.

See if the following article helps:How to: Configure an XML Web Service for Windows Authentication


I have attempted the Network Credential option and it also did not work. I have read/write permissions so I assumed my credentials would work but that was incorrect.

I will try it on another server and see if that works.