when svc.getLookupList(reqobj) will call i get following error.
"There was no endpoint listening at http://rets.newjerseymls.com/rets that could accept the message. This is often caused by an incorrect address or SOAP action."
using the VS(2008) Data configuration wizard, and it found the web service and displayed various items from the service. I want to make a simple call to this web service (mainly to learn how to do it). Here is some sample code I found, but I just don't know how to implement it.
I named my web service reference LiveSearchService. What code do I need to implement, what libraries, to retrieve any information from this web service?
in the client app, i want to handle SOAP exceptions thrown by web service. Currently, when exceptions are thrown by the web service, Detail.OuterXml property of SOAPException class shows below XML data. In code below, what's the correct method to reference namespace, values, etc to get to the error-code, error-field-name, error-message and error-description value?
I have a webservice - called MyCompany.WebService1
I reference this using a web reference in my ASP.net web application.
Theres a method called "GetDeal" in this web service, that returns a "Deal" Object.
The deal object currently looks (for example) like this:
[code]....
This class is in a different assembly: MyCompany.Model
The web service references this assembly.
In my web app, I can call the GetDeal method. This returns Service1.Deal (service1 is just the name of the web reference)
I can access both properties above. I have now changed the Deal class, and added a couple more properties.
However, I can't see these new properties in my web application. I've updated the web service in the web application. I rebuilt the web service several times, tried removing the MyCompany.Model reference and re-addding it etc...
I can't figure out what has changed... This was working - I have changed the model before, and it's updated the reference correctly...
I downloaded a sample Rolodex from here: [URL] the file to download is at the bottom of the page and it is called 'RolodexDatalist.zip (6.71 kb)' So I changed the HTML to it points to my SQL Server DB. I changed the ConnectionString to this:
Now, everything points to my DB! I thought, ok great, this should be pretty easy. However, when I debug, I get this error message: 'Null reference was unhandled by user code. Object reference not set to instance of an object. Troubleshooting Tips: use the "new" keyword to set an instance of an object.' This line is yellow:
Dim conStr As String = ConfigurationManager _ .ConnectionStrings("conStr").ConnectionString Here is the code-behind: Imports System.Data Imports System.Data.SqlClient Imports System.Collections.Generic Partial Class VB Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load If Not IsPostBack Then ViewState("CurrentAlphabet") = "ALL" Me.GenerateAlphabets() Me.BindDataList() End If End Sub Private Sub BindDataList() Dim conStr As String = ConfigurationManager _ .ConnectionStrings("conStr").ConnectionString Dim con As New SqlConnection(conStr) Dim cmd As New SqlCommand("spx_GetContacts") cmd.Connection = con cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.AddWithValue("@Alphabet", ViewState("CurrentAlphabet")) con.Open() dlContacts.DataSource = cmd.ExecuteReader() dlContacts.DataBind() con.Close() If ViewState("CurrentAlphabet").ToString().Equals("ALL") Then lblView.Text = "all Contacts." Else lblView.Text = "Contacts whose name starts with " & _ ViewState("CurrentAlphabet").ToString() End If End Sub Private Sub GenerateAlphabets() Dim alphabets As New List(Of Alphabet)() Dim alphabet As New Alphabet() alphabet.Value = "ALL" alphabet.isNotSelected = Not alphabet.Value _ .Equals(ViewState("CurrentAlphabet")) alphabets.Add(alphabet) For i As Integer = 65 To 90 alphabet = New Alphabet() alphabet.Value = [Char].ConvertFromUtf32(i) alphabet.isNotSelected = Not alphabet.Value _ .Equals(ViewState("CurrentAlphabet")) alphabets.Add(alphabet) Next rptAlphabets.DataSource = alphabets rptAlphabets.DataBind() End Sub Protected Sub Alphabet_Click(ByVal sender As Object, ByVal e As EventArgs) Dim lnkAlphabet As LinkButton = DirectCast(sender, LinkButton) ViewState("CurrentAlphabet") = lnkAlphabet.Text Me.GenerateAlphabets() Me.BindDataList() End Sub End Class
http://www.somepage.com/main.aspx. In this page, when I click on a link it takes me to a page http://www.somepage.com/cental.aspx?cid=200. So in the cental.aspx.cs page I did the following in the page load:
if(request.querystring["comp"].tostring() != null) { //do some thing [code].....
So I got an error like: object reference not set to an instance of reference.My problem is, I am using the same page. So when I go from some page, I will have "comp". but other times not. So when there is no "comp", how do I handle it in request.querystring?
we have an existing ASP.net application that is undergoing expansion. The new functionality is all written in Silverlight 4. As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place. To do this I created a standard .net Class Library and added my edmx files there. Naturally, the business entities created by this cannot be used in Silverlight. So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files. I changed the name space to be the same.
So I have the following assembly / namespaces
Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)
Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)
With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects. Really it's a beautiful thing.
Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files. These messages are things like MyObjectRequest; they are classes that have properties that can set to the ID of the record in the database you want to get, a search string for filtering by last name, first name, etc. (This is in the style of the Web Service Factory if you're familiar with that.)
Finally I turned the whole message into a generic using a base class called EntityRequest
[code]...
I corrected this error and everything went well for a week until I had to make my first change to the service interface. I added a new operation contract, clicked the handy Update Service Reference on my client and boom.
3) Finally adding the reference of service contract project in a Hosting project (Console Application) with complete configurations.
I am adding one more windows app project as a client.When i am trying to add the service reference using the address "http://localhost:8000/Tasks", VS 2008 displays the below error.
There was an error downloading 'http://localhost:8000/Tasks'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8000
Metadata contains a reference that cannot be resolved: 'http://localhost:8000/Tasks'.
Could not connect to http://localhost:8000/Tasks. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8000.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8000
If the service is defined in the current solution, try building the solution and adding the service reference again.
In ASP.NET should we call Session.Abandon() when an unhandled exception occurs?There are many end users that hit "refresh" or "back" in the web browser in order to resubmit the request.I would like to prevent this behavior by resetting the context.TIA.
in my default.aspx page i have a dropdown List and a textbox with a submit button below that there are 2 listbox... and the dropdown list holds the names of the listbox
my logic here is to select an item from the dropdown list and put some text in the text box and submit the form which will add an item to the listbox selected.. but when i do this i get an error saying Object reference not set to an instance of an object. i tried to figure out the problem and found that when i remove the reference to the Site Master Page it works fine and when i undo and apply my reference back to the Site Master Page i get the same error.
I am using grid view as mentioned below, it is giving me error "object reference not set", but if comment allowpaging and pagesize lines, it works. let me know whats wrong I am doing?
when i am adding service reference the Following erro shows Up..where as the same works on the Other machine. The url when tested in Internet explorer works but only while adding shows the error. The request failed with HTTP status 403: Forbidden. The HTTP request was forbidden with client authentication scheme 'Anonymous'.
I could really use some help on this one. I've been fighting it now for several days and we are supposed to start testing early next week.I am subscribing to 4 web services all hosted by the same company. The integration with 1, 2 and 3 all went fine, but on the fourth I keep getting the very unhelpful error:
System.Web.Services.Protocols.SoapException = {"Server was unable to process request. ---> Object reference not set to an instance of an object."} [code]...
I am little bit confused in value type and ref. type memory allocation.
Consider following case:
public struct Employee { public int Emp_no; public string Emp_name; }; //Createing object of struct Employee objEmp = new Employee; objEmp.Emp_no = 1012; objEmp.Emp_name = "emp name";
So I have query regarding :
Q1. 'struct' is a value type and 'string' is reference type of data type. Then if I use 'objEmp.Emp_name' is stored where? The location is in heap or in stack memory? What type of this 'Emp_name' variable?
Q2. If I run garbage collection explicitly then what will happen with 'objEmp' object?
Im trying to bind a list with datetime objects to my repeater.
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { DateTime actualDate = e.Item.DataItem as DateTime; }
When I want access the itemdatabound event on the repeater Then I get an errormessage which says that DateTime is a valuetype and not a reference type.My solution is that a wrap the datetime in a custom object (reference type) and pass that to the repeater datasource instead of the datetime. But Im wondering if there are other solutions where the repeater takes valuetypes (DateTime objects).
I'm getting a null reference exception whenever I try to databind this datatable to the Gridview. I know for sure that the datatable has data. I've checked it.
[Code]....
I get the error when it gets to the last line here..
I have a TextArea html helper method I'm calling in a foreach loop. Basically, when I initially load the View it works fine, but when i reload the View and load postback data, the same TextArea throws a NullReferencException and yet the variable I'm using in the TextArea as the name of the TextArea is not null. I've attached a picture below for demonstration:
if it's difficult to see, the blue arrow below is pointing to the variable used to name the TextArea. Again, it works on initial load, but it errors out on postback when the page is reloaded. I'm not sure what's going on.
I am getting System.OutOfMemoryException exception in my Web Application (ASP.NEt with C# and MySql ) hosted on IIS.
The problem is popping up randomly once every few days when i enter username and password to enter..
What is the actual reason of this Error and suggest somthing to kill this problem permanently..
Server Error in '/' Application.
Exception of type 'System.OutOfMemoryException' was thrown.
Description:
An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
My controller calls a class in my model which is getting data from a REST web service. The class in the model then passes the data back to the controller using an IList, like so:
[Code]....
My problem is this: The data that is held in the IList isn't there until the user has done a search in the View, submiting a form. This is a basic search function with 2 textboxes and a submit button in a form. When the user clicks submit, the controller action is called, the web service is then called, and the data in the IList gets populated. The problem is that in the View I am using a strongly typed view and my model reference in the foreach loop throws a Null Reference Exception because there is no data in it, because a search has not been conducted yet... [Code]....
So, how can I have the above foreach loop in my view if there isn't any data in the model until a search has been conducted? Is there a better way that I should be doing this?
Essentially, what's the best method for passing data back to a view that is based on a form submittion?