|
Trying to build a SOAP web service using complex types and hit a road block. I am using VS to create a web reference to the SOAP service. ASP.NET 2.0, C#.
Getting the following error on the client:
System.NullReferenceException: Object reference not set to an instance of an object.
On the line setting the name on the SOAP client below, info.Organization.Name = "Test Org";
Here is what I have so far:
SOAP Web Service
[WebMethod]
public string CoverageRequest(RequestorInformation info)
{
return info.Organization.Name;
}
public class RequestorInformation
{
public Organization Organization;
}
public class Organization
{
public Organization() {}
private string _Name;
public string Name
{
get { return _Name; }
set { _Name = value; }
}
}
SOAP Client
VerifyInsurance.RequestorInformation info = new VerifyInsurance.RequestorInformation();
info.Organization.Name = "Test Org";
VerifyInsurance verify = new VerifyInsurance();
verify.CoverageRequest(info);
|
|
|
|
|
The Organization present in the object info is null.
Try this
VerifyInsurance.RequestorInformation info = new VerifyInsurance.RequestorInformation();
info.Organization = new Organization();
info.Organization.Name = "Test Org";
VerifyInsurance verify = new VerifyInsurance();
verify.CoverageRequest(info);
This should work.
|
|
|
|
|
My requirement is to create a msi package for a web application and deploy it to the target machine which already has the virtual directory and app pool configured. Now evertime when i try to install the web application thru the msi package, the setup should not ask for any inputs from the user(meaning no UI interface should be involved) and the msi should be successfully installed.
Can anyone please help me out?? I have googled a lot. Not finding a proper solution
|
|
|
|
|
You can developed one custom installer for that. Few years back I developed one quite similar tool. you can have a look into this
Custom Control using C# For Virtual Directory in IIS[^]
You can use this as a reference to create a custom tool.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks Abhijit. But then, in my target machine the Virtual directory and Application pool are already configured and i just have to create the msi package and install it in the target machine without any wizard for getting the inputs from the user during the installation process.
|
|
|
|
|
I am looking for a solution that would allow us to specify where the compiled code is located at, as well as all the servers are located at and it publish it out to there with a click of a button. This solution could also compile the code if not already prior to publishing it out there, but that is optional.
I am researching now how to see if this is possible in TFS.
Any ideas?
|
|
|
|
|
We have done the same requirement through CruiseControl .Net. You can google for Cruise COntrol to implement
|
|
|
|
|
I found this a few minutes ago and I'm currently installing it.
Thank you for the reply. I'll give it a test and see what it's like.
|
|
|
|
|
hey folks,
is there any .net webservice or something similar how I can check if some email is registered on facebook, twitter, linkedin, myspace?
Thx, Laziale
|
|
|
|
|
Hi,
I am developing project VirtualClassroom in C#,Asp.net framework 3.5,
How can i open the files like office document directly in asp.net page while taking online class...i am unable to open any document directly in asp.net page for online sharing of virtual classroom screen...
Please share some idea...
|
|
|
|
|
u mean to open the document which is in the client system? from server sied u cant, u need to use javascript, but it may not support in all browsers.. whats ur exact requirement???
|
|
|
|
|
hey sumit.... please contact me on <er.mukeshyadav@gmail.com>
Yush prakash u too...
|
|
|
|
|
hello sir,
i also want to build live video streaming application in my virtual classroom project ?
Could you please suggest me something?
|
|
|
|
|
I need virtual class room project in asp.net
|
|
|
|
|
Dear All,
I have a gridview with a dropdownlist inside a templatefield :
<asp:GridView ID="gvColumns" runat="server" AutoGenerateColumns="False" <br />
DataKeyNames="excelkolom"><br />
<Columns><br />
<asp:BoundField DataField="excelkolom" HeaderText="Excel kolommen" /><br />
<asp:TemplateField HeaderText="Database kolommen"><br />
<ItemTemplate><br />
<asp:DropDownList ID="ddlDbColumns" runat="server" AutoPostBack="true" <br />
DataSourceID="SqlDataSourceKhimportAll" DataTextField="Databasekolommen" <br />
DataValueField="Databasekolommen" <br />
OnSelectedIndexChanged="ddColumns_SelectedIndexChanged"><br />
</asp:DropDownList><br />
</ItemTemplate><br />
</asp:TemplateField><br />
</Columns><br />
</asp:GridView>
I want to get the text of the dropdownlist of the selected row:
string selection = gvColumns.Rows[gvColumns.SelectedRow.RowIndex].Cells[1].Text;
Im getting this error:
Object reference not set to an instance of an object.
How can i fix this?
Thanks in advance.
|
|
|
|
|
You have to use Gridview.FindControl() Method. Please do some research on it,you will able to resolve it by yourself.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
You should try
String TextOfDropDownList = ((DropDownList)gvColumns.Rows[gvColumns.SelectedRow.RowIndex].FindControl("ddlDbColumns")).SelectedItem.Text hope it helps!!
|
|
|
|
|
I have a question in asp.net, in the page code behind when filling a gridview with data for example, i send a reference of the gridview to a controller class to fill it with data to avoid writing a lot of code in the page's code behind for example i write in the page load the following:
Controller.GetData(DataGridView);
does this mean i'm sending too much data from the client to the server? Is there a difference in performance between this and between filling the data in the page's code behind? in my opinion there's no difference, as this code already runs on the server and controls are created on the server, so no effect on the amount of data transferred from client to server. any ideas?
lamia
|
|
|
|
|
lamia nabil wrote: does this mean i'm sending too much data from the client to the server
What are you talking about ? ??
Is it a web service where you are sending the DataGridView ?
If it is just a class, then the object is already loaded in memory. You can process the memory wherever you want.
|
|
|
|
|
Hi,
No, it's not a web service, it's a regular web application, i'm newly working in web applications and some collegues argued with me about this,claiming that this will increase the load on the server and lower the performance beside that it's not correct to send controls between presentation and bussines layers, but i thought if i send a reference of all controls (in an arraylist) in my page to the bussines layer and filling the data goes there, i would minimize code written in the page to bind all controls, but actually i didn't see any one doing this before, so i'm not sure if this was a good idea.
lamia
|
|
|
|
|
|
Well, Actually there is no difference. The only thing is that, we always try to separate the presentation layer with data.
It is just because of the separation of code. Say you have implemented 2 or more layers. Your intension is just to separate the Layers so that they could be reusable.
If you send the control, the data layer will be totally dependent on the presentation layer, and thus if this is what you do, then it will be better to have all the data layer classes in the App_Code of your project.
Actually, we all start creating Layers for separation of code, but gradually it becomes so much dependent that we cant plugin the other layer if the presentation layer is changed.
I think if you like to reduce the code, try creating a new Class in your APP_Code and place those code there. From Data layer, you call only for data and manipulation of controls could be made in your application layer.
By this, I definitely mean that there will be no difference if you send though. But at least this is not a good idea...
If you want to read on how to Refactor code, and reduce Dependency between layers, you might have a look into one of my article :
Simplify Code Using NDepend[^]
I think it will give you the idea on what I am talking about.
Cheers.
|
|
|
|
|
Thanks a lot for ur help.
Cheers.
lamia
|
|
|
|
|
how can we impliment online recharge for prepaid mobile in asp.net. Please reply as i need this urgently.
|
|
|
|
|
arunpal wrote: how can we impliment online recharge for prepaid mobile in asp.net
Is this is your work assignment ? What have you tried till now ? Please don't come up with any abstract question. This is not an easy task. You need some web services which will communicate with mobile to update the info. You need to contact with mobile connection provider.
arunpal wrote: Please reply as i need this urgently
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|