VS 2010 - Interface To Web Service Isn't Working

Dec 20, 2011

I wrote a web service for a co-worker. The web service is in VB.NET, and it works fine for me. When I write a consumer and walk-through it, it returns me the correct data, and when I run the URL in a browser, the methods are exposed to me.

My co-worker wants to call this web service using JSON. He is debugging it in Firefox with Firebug. He gets a pop-up entitled "Authentication Required" and it says Enter username and password for <the URL> of the website (under which the folder of my webservice has been defined as an application in IIS), and there's a textbox for an id and password. Firebug says 401 unauthorized.

I am developer, not a SA, so I don't understand a lot of the hits I am getting when I google this error. I did change one thing in IIS, though. We have another web app on another server where we've employed the exact same model, and that web service works. So I am trying to compare the two. I changed Authentication so that Anonymous Authentication was Enabled and the others were Disabled. I was hopeful this would work, especially because Basic Authentication and Windows Authentication's Response Type were HTTP 401 Challenge, but that did not work, unless I need to restart something (do I?).

View 1 Replies


Similar Messages:

WCF / ASMX :: Use Portalapi Interface Api Or Web Service?

May 7, 2010

I need to use api interface that is running on jboss and I know the addressees to use.It's something like this

http://<server_name>/portalapi/<function_name>?<parameter1>=<value1>&<parameter2>=<value2>

So the question is how I can call this api from asp.net page or web service.I'm thinking of making one web service,buil ther all this methods that are using this api call's and then returning the info.

View 6 Replies

WCF / ASMX :: Convert WSDL File To Service Contract Interface?

Feb 15, 2011

I would like to convert WSDL file to Service Contract Interface (WCF).

View 1 Replies

VS 2010 - Web Service Runs Locally But When Deployed Has Error Could Not Create Type Service

May 24, 2012

I developed a web service in VS2010 on my local machine, wrote a consumer of it also locally, and that all works.

I copied the dll and the asmx file to our server, and I am getting an error when I try to invoke it from a browser (also still on the server machine) to make sure it correctly exposes its web methods, but it is not, it is saying "Could not create type 'Service'". That error comes from this line:

Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/WarrantyDuplicate.cs" Class="Service" %>
There other web services in the same folder on the server that all work fine so I don't believe it's an IIS setup thing.

This is my first web service in C# and when I created it in VS I did think it odd that the code behind file went into App_Code (as you can see from the line in the asmx file) and is just named dot-cs rather than asmx-dot-cs. But since it worked fine locally, I wasn't sure that mattered.

View 2 Replies

C# - Calling A Web Service - Code For Consuming A Service Is Not Working ?

Mar 16, 2011

I have the following code for consuming a service that is not working for me. what I can do to narrow down whats going wrong?

The address is: http://localhost:57667/ExampleService.svc/

When visiting directly I get the 'You have created a service... message'

The code that goes wrong is here. It causes the following error:

_url = "http://localhost:57667/ExampleService.svc";
TextReader textReader = new StringReader(HttpPostClient.Post(new Uri(_url), bodyData.ToString(), _exampleServiceRequestEncoding, Properties.Settings.Default.HttpPostClientExampleAvailabilityTimeout));

ERROR MESSAGE:When visiting this URL directly: http://localhost:57667/ExampleService.svc/ProcessRequest

The exception message is 'No component for key example.ExternalWebServiceStubs.Example.ExampleService was found'.
Castle.MicroKernel.DefaultKernel.get_Item(String key) at Castle.Facilities.WcfIntegration.WindsorInstanceProvider.GetInstance

View 2 Replies

Installing Microsoft Visual Studio 2010 Service Pack 1 In Microsoft Visual Web Developer 2010 Express

Mar 11, 2011

Can I install Microsoft Visual Studio 2010 Service Pack 1 in Microsoft Visual Web Developer 2010 Express?

View 1 Replies

VS 2010 Errors With Creating Web Service

Mar 5, 2011

I am new to the whole ajax/jquery/web service scene. I am trying to create a web service to pass back data for a jquery post and currently have two errors. It appears there are examples the web but must in c and looking for something in vb. Below is my web service. See in bold the error descriptions and in red the items visual studio is highlighting.

WordsService.asmx
HTML Code:
<%@ WebService Language="VB" CodeBehind="~/App_Code/WordsService.vb" Class="WordsService" %>
WordsService.vb
Code:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Runtime.Remoting.Services
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Data
Imports System.Web.Script.Serialization
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="[URL]
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WordsService
Inherits System.Web.Services.WebService
Private _sConn As String = ConfigurationManager.ConnectionStrings("DB").ConnectionString

'1) Type 'ScriptMethod' is not defined.

'2) Value of type '1-dimensional array of String' cannot be converted to '1-dimensional array of 1-dimensional array of String' because 'String' is not derived from '1-dimensional array of String'.

<WebMethod(Description:="Gets the books matching part of a title."),
ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
Public Function GetBooksByTitle(ByVal strTitle As String) As String
Dim myConnection As SqlConnection = New SqlConnection(_sConn)
Dim objCommand As SqlCommand = New SqlCommand("SELECT * FROM table WHERE field like '%" _
+ (strTitle + "&' ORDER BY field;"))
Dim dsSearch As DataSet = New DataSet
Dim sdaSearch As SqlDataAdapter = New SqlDataAdapter(objCommand)
sdaSearch.Fill(dsSearch, "english")
myConnection.Close()
' Create a multidimensional jagged array
Dim JaggedArray()() As String = New String((dsSearch.Tables(0).Rows.Count) - 1) {}
Dim i As Integer = 0
For Each rs As DataRow In dsSearch.Tables(0).Rows
JaggedArray(i) = New String() {rs("BookNum").ToString, rs("Title").ToString, rs("Author").ToString}
i = (i + 1)
Next
' Return JSON data
Dim js As JavaScriptSerializer = New JavaScriptSerializer
Dim strJSON As String = js.Serialize(JaggedArray)
Return strJSON
End Function
End Class

Here is the article I am currently following for example: How To Create A JSON Web Service In ASP.NET.

View 3 Replies

VS 2010 - How To Prevent Web Service Restart

Nov 10, 2011

I've created a web service using VS 2010 and .Net 3.5, deployed on Win7. No hiccups regarding performance or functionality. However, after adding performance counters I realized that the web service is restarted every few thousand calls (which happens after a few seconds).

The application pool has already been changed to not use recycling but this behavior persists.

View 4 Replies

VS 2010 - Stub For A Web Service That Will Be Returning XML

Jun 23, 2011

I'm going to be calling a webservice that will return me data in xml format. Since the web service is not ready yet, I want to test locally by calling a function that returns the xml. So if I have a sample xml file on my hard-drive, how do I just open it and read it and create an xml string from it? I don't care at this point about parsing anything out; I will do that in the caller and have that written. I just want all the xml back.

View 9 Replies

VS 2010 Web Service - Single Sign On (SSO)

Jun 20, 2011

I've only worked with web services a little bit. I am working on a project now using another developer's code as a template. It is code for a single sign on (SSO).

Here is a code excerpt:

Code:
namespace xxxxxxxSSO {
/// <summary>
/// Summary description for xxxx
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]

[Code] ....

Also let me say, I have been coding in VB6/VB.NET for the past six years and am learning C# (that is what the other developer's code is written in).

setAppCredentials() is the beginning of a lot of sub-calls and I have gotten that all to work when I was running the service from within its own Visual Studio project.

Where I am having the problem is setting credentialHeader.Username and credentialHeader.Password. credentialHeader is nothing when I call validateCredentials().

I didn't see how I had these exposed to me in order to set them. So the developer said Create a client that consumes that service and set the values there and call your method.. But I still don't see how it's exposed to my consumer. I have this line of code in the consumer

Code : Dim myWebService As New localhost.xxxMemberService

(Back to VB!,) but I still don't see credentialHeader exposed.

The only other thing I see in the webservice code that might be relevant is this:

Code:
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]

[Code] ....

which is in a file called referenes.cs.

View 5 Replies

VS 2010 - Adding Reference To Web Service

Feb 2, 2012

I have a number of .Net web sites built in VS2010 using Framework 4.0that reference a web service to send emails.

My most recent site I created as a web application as opposed to a web site. In the Solution Explorer you can add a 'Service Reference' and, if you click the Advanced button you can then add a reference to a web service.

I did that and now the (web application) site won't build - it says it cannot load the Ajax dll. If I remove the reference to the web service, the site builds okay - if I add the reference back in, the site will not build.

Do I need to abandon the idea of using a 'Web Application' and turn it into a 'Web Site'?

View 9 Replies

VS 2010 - Connect Web Service To Access Database?

Mar 21, 2011

I´m learning how to use a web service with flash.

Now I need to connect the web service to my db.

This is what I tried:

Code:

Public Function HelloWorld() As String
Dim orgcon As New OLEDBConnection("Provider=Microsoft.jet.oledb.4.0;data source=c:dataDB.MDB")
Dim OrgDA As New OleDbDataAdapter("select * from organization order by orgname", orgcon)
Dim Orgds As New System.Data.DataSet
OrgDA.Fill(Orgds, "Organization")
Dim hwstring As String
hwstring = orgds.tables(0).rows(0).item(3).tostring
Return hwstring
End Function

The flash just gives me an error that there was an error opening the web service. For some reason I can´t debug it in vwd.

View 7 Replies

VS 2010 - Web Service To Write To Windows Application Log

Nov 29, 2012

I am writing a web service for a customer. I tested it locally fine using a consumer, but he is having an issue calling it from his jquery, so he asked for logging.I figured I would use the Windows Event Log for this purpose. after I added the event log and was testing it locally via the consumer, I had an error saying The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security. So what I did to solve that was restart Visual Studio with administrator privelege so the event logs could be searched. And I am writing to my event log locally with no other issues.

My question is, when my customer intalls this new version of my web service, will it be able/unable to search the logs and if unable, how can it be given admin privelege so it is able, or again is that a bad idea?

View 1 Replies

VS 2010 - Error Changing Framework Of Windows Service

Nov 17, 2011

I have a deadline to install my windows service NOW. I developed it in VS2010 and chose the .NET 4.0 framework. The server where I am installing it, which is a server that hosts our live web sites, does not have .NET 4.0 installed. So I have to change the framework to 3.5. I have this error now when I try to build:

Error13Type System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a in the data at line 120, position 4 cannot be located. Line 122, position

5.C:DevprojectsDocFtpToVendorDocumentFtpProjectInstaller.resx1225DocumentFtpIt is in ProjectInstaller.resx and also Service1.resx. Is it because the version=4.0.0.0, and if so how do I change that? And if not, what is the cause?

View 9 Replies

VS 2010 - Multiple FileSystem Watchers In Windows Service

Oct 14, 2011

Now I want to create several filesystemwatchers in my Windows Service and have them monitor different folders but do basically the same thing when files are created. That is, they will be calling the same routines. So my code so far is this:

Code:
// 10/14 - Create N fsw's as specified in the config file.
int nbrFsw = Convert.ToInt32(ConfigSettings.ReadSetting("NumberOfWatchers"));
List<FileSystemWatcher> listOfFsw = new List<FileSystemWatcher>();
for (int i = 0; i < nbrFsw; ++i) {
FileSystemWatcher fsw = new FileSystemWatcher();

[Code] ....

Is there a potential problem that all fsw's that get created are calling the same "on created" event handler? Or will this work nicely?

My requirement is this. I need to watch Output folders and when pdf files are created here I upload the files to a server. These Output folders are in web app deployments. I need to do this function for more than one deployment on the same machine, thus my need for more than one fsw.

This will ultimately be a web service but I am trying this out in a windows program, hence the presence of lblMessages which is on a windows form...

View 10 Replies

Visual Studio :: Creating Web Service With Web Developer 2010 Express

Nov 15, 2010

My instructions for creating a new web service with VWD 2010 Express call for using the installed template, "AST.NET Web Service". But this template is not listed.

I would like to create a simple web service in visual basic, place it in IIS 7 on my desktop, and then consume it probably using a proxy class.

Is there another way to create a new web service in VWD 2010 Express?

View 1 Replies

Visual Studio :: Unit Test C# Web Service With 2010 Ultimate?

Oct 25, 2010

I have webservice running, how to test those web methods using the Test features of Visual Studio 2010.

As with normal web reference i am not able to create the classes and call the webmethods inside the test class.

View 1 Replies

VS 2010 - How To Pass Username And Password And Test Service Connectivity

Aug 24, 2011

I have added a web reference using the wsdl file that was provided to me. I also created an instance from the proxy class as follows :

Code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim DLObj As New WebReference.DrivingLicenseInfoServiceService

But after this am totally confused on the next steps and how to pass username and password and test the service connectivity.I have attached the autogenerated code.

View 12 Replies

VS 2010 - StyleSheet Not Working When Publishing

Mar 2, 2012

In the page element of my Style sheet, I have the width set to 1100 pixels. In VS, it works perfectly. When I debug it, no problem. But when I publish it to IIS, it reverts back to the default... 960 I think.

CSS Code:
.page{    width: 1100px;    background-color: #fff;    margin: 20px auto 0px auto;    border: 1px solid #496077;}

View 3 Replies

VS 2010 - Maxlength For TextBox Not Working

Jun 20, 2012

If I set the maxlength field for a textbox, and have the textmode set to SingleLine, the amount of text is limited to the specified number of characters. If you change TextMode to MultiLine, the number of characters is no longer constrained.

View 2 Replies

AJAX :: Web Service Not Working In IE8?

Jul 9, 2010

I somehow managed to get the AjaxControlToolkit working from my network drive. I've since tried to add a textbox with auto-complete functionality as per the quick and easy tutorial below. The code works in Firefox and Google Chrome but not in IE8 (Not tried any others yet)

[URL]

I dont get an error or anything just the textbox appears and works as an ordinary textbox instead of one with auto-complete functionality.

what could be stopping this in the IE8 browser?

View 1 Replies

Visual Studio :: Intellisense Not Working In 2010?

Apr 14, 2010

As I wanted to try out the new VS, I started and began working on a C# web project that I had previously started in VS2008. So far, so good. But then I noticed that Intellisense is not working at all. I have done some searching, but all I could find were some problems with the release candidate version crashing.Does anyone have any insight as to what might be causing this and how to resolve it?

View 3 Replies

Visual Studio :: 2010 Project Not Working In Iis?

Mar 19, 2010

i get this error.What should i do ?

I even tried webapplication setup project is it not ready to deploy with RC ?

<compilation debug="true" targetFramework="4.0">

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

View 2 Replies

VS 2010 Access Control Only Working For ASPX

Oct 2, 2012

I have created an access rule for my website, it looks like it works fine when trying to access .aspx files, but not for any other extensions. I was wondering if there is trick to apply the access rule for all files types.

Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>

[URL] ....

I tried to add the following code to my main config file but still will only work for .aspx only

Code:
<modules>
<add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule" />
<remove name="UrlAuthorization" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
<remove name="DefaultAuthentication" />
<add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" />
</modules>

View 7 Replies

VS 2010 - Entity Framework Not Working As Expected

Sep 24, 2012

On my underlying DB I have 3 tables. 1 of those tables comprises of just the primary keys of the other 2 tables. When I built the Model, it recognised this and so didn't actually generate an entity for this table, but instead made a many to many relationship between the other 2 tables.Now when I save changes against the context. (new records) under the hood the table with just primary keys are not populated. How do I get this table populated?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved