|
I am using webservice in my application. Inside that I have a function to register the remoting service. Following is my code:
RegisterRemoting();
private void RegisterRemoting()
{
try
{
WellKnownClientTypeEntry entry = RemotingConfiguration.IsWellKnownClientType(typeof(IManager));
if (entry == null)
{
RemotingConfiguration.RegisterWellKnownClientType(typeof(IManager), AmortisationGeneral.GetAppSettings("RemotingService"));
Hashtable properties = new Hashtable();
properties["name"] = "HttpBinary";
properties["useDefaultCredentials"] = true;
BinaryClientFormatterSinkProvider clientFormatter = new BinaryClientFormatterSinkProvider();
HttpChannel channel = new HttpChannel(properties, clientFormatter, null);
ChannelServices.RegisterChannel(channel, false);
}
}
catch(Exception ex)
{
ex.Message.ToString();
return;
}
}
The uri is coming from an appsettings key which is as follows:
<appSettings>
<add key="RemotingService" value="http://localhost/Services/FinancialRemotingSite/eFirst.Origin.Financials.Amortisation.Manager.AmortisationManager.rem"/>
</appSettings>
When I try to test the url as specified in the value tag, I was getting the following error:
System.ArgumentNullException: No message was deserialized prior to calling the DispatchChannelSink.
Parameter name: requestMsg
Is this something that the remoting service has not been installed properly in my local system? I am using VS 2005. I have tried almost all of the solutions found in google, but didn't solve the issue. Would be great if anybody provides some help on this.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi,
Is it a good practice -
to first create a DB, then data layer and business layer and then web services that communicates between the business layer and the front end of all the different websites - like admin, corporate, product website?
The idea is to minimize the direct interaction of front end layer with the back end and instead place web services in between?
or please let me know if there is better approach(No MVC for now..)
|
|
|
|
|
I think better approach may be to go backwards to what you written. So first you create a GUI for a functionality. Then you write some logic of the GUI, that calls service, which in turn calls business layer method/methods and business layer performs operations on database.
In this approach important thing is not to implement all layers at once. First you design GUI. Because GUI is most important in the application (this is what user sees and he really doesn't care, that underneath there is super database design if GUI sucks).
When you have GUI, you can prepare some logic for it. Here you decide what services you need and create interfaces of these services. You don't implement services yet. You just create some implementation that returns constant data. When logic of GUI is completed you can start implementing services for real. Implementation of services gives you idea of what business layer should contain and you do the same with business layer as with services earlier: simple implementation without real logic.
In the end you create data access layer. And database. And they are result of what you really need, not what you think you'll need.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
I quite like this backwards approach but most of the developers always say it's best to write DB first. But never mind, the problem that i can see in this architecture is -
if there is a problem in web service then all the sites go down at the same time. How can i overcome this problem? I don't think it will be a good idea to develop different web service for each websites.
|
|
|
|
|
There are arguments pro and con for both top down and bottom up methods but the only correct answer is what works for you situation, your project, your team, your goals.
Not every project requires the use of Web Services. You have to weight the costs and benefits. If the application you are building is an internal app on a single platform, then Web Services are more of a hindrance. If, on the other hand, your business logic may be used by other companies, or divisions within the company, then it may be worthwhile.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes, if that's what your situation calls for. I would put an API between the business layer and the Web Services though.
My general rule of software development: "Design should be top-down, but implementation should be bottom-up."
modified on Tuesday, August 2, 2011 9:13 AM
|
|
|
|
|
In my opinion you can remove the impact of the entire design choice by having a good up front design that handles all aspects you mentioned.
You talk about the technical design, but you need a functional design first. A functional design focuses on use cases, workflows etc...
EG.:
Functional: A user says he wants a dialog that holds a person's information and that has buttons to save the information, copy the information and close the dialog. He also explains what that 'information' is, in detail. (name, first name, age, etc...) The user mentions how this information is used in other parts of the application and or system or even in other applications or systems. You can give some direction to the user here like do you want to have a remote service for this? (indicating pro's and con's)
Technical: Based on the information of thze technical information you can design the application technically, will we use services, forms/wpf or web UI's? What dataobjects can we define? How many tiers do we need, etc... This can go as far as defining the SQL statements necessary and writing propotypes.
Hope this is what you wanted.
V.
|
|
|
|
|
In implementing the app, yeah. It's good.
In design mode or user talks or functionality it is the other way around.
First talk to the users, see what(functionality) they want, how they want it(technical data such as web app, win app...).
Then, after all data about the app is gathered, start with the DB. That's how I do it.
I may be wrong, but don't tell anybody.
All the best,
Dan
|
|
|
|
|
Hi experts,
there is a project called MyProject . It compiles to a file called MyProjectAssembly.exe .
Since it has to support multiple languages, there is also a resource file MyProject.resx , which contains string-typed keys and string-typed values.
I can, in code, gain access to the strings via
string translatedValue = MyProject.KeyForTranslatedValue
Now there are some strings that I don't know the keys for at compile time. Therefore I have the application process KeyForTranslatedValue and get the translated string via
string translatedValue = Properties.Resources.ResourceManager.GetString("KeyForTranslatedValue");
The mentioned Properties.Resources.ResourceManager cannot find the string and therefore returns null . It seems to be able to retrieve some other resources (numbers, icons, ...) that are language-independent and are stored in Project Explorer -> RightClick -> Properties -> Resources.
Is this normal behaviour?
Can I redirect Properties.Resources.ResourceManager to the langugage-dependent resources? Would that be stupid?
Should I use a separate ResourceManager for the language-dependent resources?
Ciao,
luker
|
|
|
|
|
The ResourceManager.GetString method has an overload that takes in the resource culture as the second parameter. You may want to experiment with that.
|
|
|
|
|
I would like to move the selected row information from one datagrid to another.However datagrid1 only has two columns and datagrid2(the one that needs to recieve the specified data) has four columns.The information displayed in datagrid2 needs to be in the last two columns and not the first two.Hope someone can help me....Thank you in advance.
|
|
|
|
|
hello
i am writing an application that one of the thing that it should do is to open another application using that application command line arguments. the problem is that the command line arguments contain user and password details, and if i use utilities like process explorer i can see all the argumnents that ware used to start the process, including user and password.
i am looking for a way to hide/mask the process arguments, so that there will no way to find the user and password after starting the process.
altenatively, i will try to hide the process fromm the process list.
Thanks
|
|
|
|
|
You can consider encrypting sensitive arguments from the calling program and descrypting the arguments from the called program using the same encryption scheme and key.
|
|
|
|
|
this might work if i am writing the called program, but in my case, i am trying to open an existing application, that i didnt wrote.
|
|
|
|
|
There is nothing you can do about it then. If the called program doesn't expose a COM interface to do the work without using the command line, you're just going to have to live with it or replace the called program with something that fits the security requirements.
|
|
|
|
|
If the called program requires that passwords be passed in as plain-text parameters, then there is nothing much you can do about it.
|
|
|
|
|
I wish to open from 1 - 20 instances of the same form.
I then wish to place them in order of the instance in which they were called, at specific locations.
Therefore, I need to know what number the instance is that is associated with the form, and refer back to the form when needed.
How do I get the numerical instance associated with the form created.
Any help will be appreciated.
Thanks in advance,
Michael
|
|
|
|
|
I would consider creating a List containing pointers to the form instances as they are opened. If you need to reverse the process, i.e. figure out the number when you have the form, then save the number in the Tag field.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
A Dictionary<int, Form> ?
modified on Wednesday, August 3, 2011 7:49 AM
|
|
|
|
|
You have two good answers, already, but I'll go ahead and ask whether the 1-20 Form instances are:
1. created when you launch the application: i.e., in the Main Form's 'Load or 'Shown Events, or as a result of parsing command line parameters ?
2. if created at run-time after the Main Form is shown, is their creation executed once and only once ... or, are they liable to be 'disposed,' and then a new set is created ?
If created at application launch, there are several strategies you could pursue, including:
1. making all the created Forms have the Main Form as their owner: then you can use the 'OwnedForms Form Collection of the Main Form to access them sequentially ... as long as the Main Form doesn't own other Forms of a different Type.
2.using the Application.OpenForms Form Collection, after the duplicate Forms have been shown, and iterating through it, testing for if (currentForm is FormForCopying) to discriminate copied Forms from other Forms.
A simpler strategy, independent of whether you create the Forms at launch, or at run-time:
1. Take your existing Form definition used for copies, make it sub-class Form, then add a public property to it of type int with getter and setter: as you create the copies assign the value you want to the public property.
I'd probably go with the strategy suggested in either Walt or Shameel's answers ... unless ... there were other compelling reasons to add additional properties, methods, special events, etc. to the copied Forms.
If one of your 'issues' is you want the end-user to be able to re-position the copied Forms on-demand at run-time, perhaps after moving them about, or whatever, you might consider caching their original positions the first time you display them, so that you can 'pop' them back into their original position without calculation ... assuming none have been deleted or added.
You could apply the same strategy for preserving the original positions of the copied Forms that you choose to preserve the numerical index of the Forms.
best, Bill
"In the River of Delights, Panic has not failed me." Jorge Luis Borges
|
|
|
|
|
hi!
im using wmi for my coded project, and i need to get some data in system properties. can anyone help me how to get the values for the initial size and maximum size of the virtual memory and how to change their values.
thanks!
|
|
|
|
|
<pre lang="xml">How do you dynamically assign a datagrid's headers in c#?
Consider the following XAML:
<data:DataGrid x:Name="dataGrid" AutoGenerateColumns="False" Margin="1,1,1,1" >
<data:DataGrid.Columns>
<data:DataGridTextColumn
Header="Substantive"
Binding="{Binding Path=Substantive}"
IsReadOnly="True"
/>
<data:DataGridTextColumn
Header=""
Binding="{Binding Path=Month[0]}"
IsReadOnly="True"
/>
<data:DataGridTextColumn
Header=""
Binding="{Binding Path=Month[1]}"
IsReadOnly="True"
/>
</data:DataGrid.Columns>
</data:DataGrid>
In the C# code, how would I define the headers that are blank?</pre>
|
|
|
|
|
hi
i have C# program that work with access database. (i have datetime field in access - Short Date)
How to make sure that the program will not crash with the wrong date format ?
for example:
in my computer the date in this format: dd/MM/yyyy
and if i run my program on computer that has this format: MM/dd/yyyy
the program will crash or will show me abnormal result
is there any generic solution ?
can i get any C# code for this ?
thanks in advance
|
|
|
|
|
This might help
http://msdn.microsoft.com/en-us/library/w2sa9yss.aspx[^]
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
You can and should get rid of all regional setting stuff and avoid all string representations for dates, use the proper data types in your code AND in your database. This implies you use SQL parameters, not literal data.
For MS Access, use OleDbParameter (which requires the ? symbolic name in the SQL statement, where other databases would allow real symbolic names for the parameters; the question marks and parameters are synchronized in chronological order).
Example:
string SQL="UPDATE [references] SET name=?,address=?,zip_code=?,date=? WHERE referenceID = 1115224993"
OleDbCommand cmd=new OleDbCommand(...);
...
cmd.Parameters.Add("date", OleDbType.Date).Value=DateTime.Today;
...
See, no date strings at all.
|
|
|
|
|