|
Hi all,
I have a web service which I want to implement on multiple servers and which can communicate with each other. (Meaning reusing the same web service on the different servers) I am currently using a proxy class which i created with wsdl.exe in order to call the web service from any other component (web page, windows service, etc). That works fine, giving it the Url. Now the problem I have is communicating between one web service and another, as when I add the proxy class to the web service, in order to create an instance of a webservice and give it a URL, the namespaces, functions etc already have definitions for them.
To simplify:
Web page to web service communication
Web page has web service proxy class, an instance of web service is created, a url is given and the web service methods called - works fine
Web Service to Web service communication
I add the proxy class to the web service and it gives me errors, namespace already defined, etc etc, obviously because the proxy class is of the same web service I am trying to add the class to.
So effectively my question is this. In order to reuse my web service over multiple servers and call methods between these web services, what do I have to do?
Thank you very much in advance for any help
|
|
|
|
|
Hello friends,
I have an application that reads file properties and stores them in an Access database. It reads the following properties:
size, file's icon (if it has), dates (modified, accessed and created), file attributes (read only etc...), artist name, album title, album year, trackNumber durtion, genre, bitRate, frameRate, sampleRate, height, width, owner, author, title, subject, category, pages, comments,copyright, company, description, major version, minor version, revision number, product name, major product version, minor product version, product revision.
Any advice on how to do that. I decided to use the GetDetailsOf method, but it was only when I started coding, that I realized that the GetDetailsOf method returns strings, and that would mean that I have to manually parse the returned data to extract the required info. Also, I want to keep unmanaged code inside my app. to a minimum.
Problem 2:
The same app. has a Windows Explorer like interface and has pretty much the same purpose. I'm using a ListView and a TreeView control to provide the same UI as Explorer.
Now I need a way to preview the file that the user has selected, much like Windows Explorer. The file can be an Image file or an audio/video file.
The mechanism I'm using now for this feature is a UserControl which has a Preview() method in which I determine the type of the file based on extension and then add a proper control to my UserControl.
The real problem is how to preview a video. I'm currently using the Microsoft.DirectX.AudioVideoPlayback.Video class to provide this functionality. But it has many annoyances.
1. It doesn't have a parameterless const. So I cannot simply create an instance of the class without providing it a video file path.
2. Every time a new instance is created, it pops up a new window the size of the video, and to position it inside my controls bound, I have to assign to its Owner property. To do that, I need a class Instance and that again means a new window.
Please suggest.
|
|
|
|
|
Hello everyone,
I'm trying to make an questionnaire and I want to do this with enums.
For example:
enum Color{ Black, White }
enum Height{ cm_10, cm_20 }
With this information I want to show each enum in a panel, where you first have to answer the color and then the height, and it has to be extendable. But I don't get it working.
Can you help me, I would like to do it something as following:
private void askQuestion(Enum e)
{
String[] ss = Enum.GetNames(typeof(e));
putOnScreen(ss);
}
private void overall()
{
ArrayList ar = new ArrayList();
ar.Add(Color);
ar.Add(Height);
foreach(Enum e in ar)
{
askQuestion(e);
}
}
I guess it should be possible, but I don't know how.
|
|
|
|
|
If you put your questions inside enumerations, you haven't got an extensible mechanism. When I've developed this type of application in the past, I've always used a database. Roughly, this breaks down into:
Topics
Questions
Answers
AnswerTypes (textbox, multi-select, etc)
Scores for answer
This makes for a much more extensible questionnaire application.
|
|
|
|
|
You are totaly right about that. I'm going to make it with a database.
But if we asume that I would do it the way I described above (just to learn something), is this possible or possible but not done or something else?
|
|
|
|
|
It's possible - but not advisable. BTW - using ArrayList isn't a good idea. I assume you're not saddled with developing in .NET 1 or 1.1.
|
|
|
|
|
I'm used to developing in .NET 2.0 and 3.5
ArrayList was just a suggestion, I prefer just arrays, like Enum[] e = { enum1, enum2 };
But that didn't work.
If you say I shouldn't use it, I'll just go and work with a database.
|
|
|
|
|
|
Good afternoon all,
I'm learning to work with 'Lists'
I've set up a list of 'zooAnimals' and in the list i've added objects as they have been created.
zooAnimals = new List<Animal>();
newcat1 = new Cat(cat1, catPen, fircat);
newcat2 = new Cat(cat2, catPen, seccat);
newtig1 = new Tiger(tiger1, tigerPen, firtig);
newtig2 = new Tiger(tiger2, tigerPen, sectig);
zooAnimals.Add(newcat1);
zooAnimals.Add(newcat2);
zooAnimals.Add(newtig1);
zooAnimals.Add(newtig2);
I would like to now step through the list to perform certain actions when a button is pressed.
For example - the form has a number of buttons on it - 1 being for individual groups of animals to eat().
I tried with
foreach (Cat thisCat in zooAnimals)
{
if (thisCat.hunger == 7)
{
thisCat.hunger = thisCat.hunger - 5;
}
}
but this code throws an InvalidCast Exception......
Unable to cast object of type 'Zoo_Animals.Tiger' to type 'Zoo_Animals.Cat'.
Is there a way of stepping through the list to do this ?
Thanks in advance !
Neil
|
|
|
|
|
If you're using .NET 3.5 you can use
foreach(Cat thisCat in zooAnimals.OfType<Cat>())
{
...
}
otherwise you'll have to check each item
foreach(Animal animal in zooAnimals)
{
if(animal is Cat)
{
...
}
}
|
|
|
|
|
Thank you very much indeed - worked a treat !
|
|
|
|
|
J4amieC wrote: foreach(Cat thisCat in zooAnimals.OfType<cat>())
That's neat - and my trigger to start looking at 3.5 finally...
Knowledge is hereditary, it will find its way up or down.
Luc Pattyn
and since what every time when i want to add button to this control one add two times
posted in C# forum
|
|
|
|
|
Yeah, didn't know about the OfType extension too, looks really useful in this situation.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi
I have done a project on .Net using SQL compact edition ...once i take the build i am getting the Exception Memory corrupted ..Do any one have idea regarding this...Can anyone help me out
|
|
|
|
|
Hi,
I've a problem using VC++ 6.0 dlls in C#.net, I'm using dllimport
dlls consists of classes and I want to call functions contained in classes but they are not static functions.
I tried this code
[DllImport("XYZ.dll", EntryPoint = "?XYZ@XYZ@@XYZ")]
public static extern int XYZ();
when I tried to call XYZ function I got this exception:
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
How can I do this?
thanks in Advance,
Akram
|
|
|
|
|
I was able to send mail via simple smtp server
the problem is that as i understood gmail needs ssl authentication.
this is my code but it fails with the following message :
530 5.7.0 Must issue a STARTTLS command first
btw this project is done in vs2003 so im using only System.Net.Sockets and I cant use System.Net.Mail
mailSubject = ModifyMailContent(mailSubject);
mailBody = ModifyMailContent(mailBody);
int code;
using(TcpClient smtpSocket = new TcpClient(smtpServer, mailServerPort))
using(NetworkStream ns = smtpSocket.GetStream())
{
code = GetSmtpResponse(ReadBuffer(ns));
WriteBuffer(ns, "ehlo\r\n");
string buffer = ReadBuffer(ns);
code = GetSmtpResponse(buffer);
if(buffer.IndexOf("AUTH=LOGIN") >= 0)
{
WriteBuffer(ns, "auth login\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
WriteBuffer(ns, System.Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(username)) + "\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
WriteBuffer(ns, System.Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(password)) + "\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
}
WriteBuffer(ns, "mail from: <" + mailSender + ">\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
string[] splitRecipient = mailRecipient.Split(',');
foreach(string sEmailTo in splitRecipient)
{
WriteBuffer(ns, "rcpt to:<" + sEmailTo + ">\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
}
WriteBuffer(ns, "data\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
WriteBuffer(ns, "from:<" + mailSender + ">\r\n");
foreach(string sEmailTo in splitRecipient)
{
WriteBuffer(ns, "to:<" + sEmailTo + ">\r\n");
}
WriteBuffer(ns, "Subject:" + mailSubject + "\r\n");
WriteBuffer(ns, "\r\n" + mailBody + "\r\n.\r\n");
code = GetSmtpResponse(ReadBuffer(ns));
WriteBuffer(ns, "quit\r\n");
}
|
|
|
|
|
Hi Guys,
does anyone know how to add a trackbar into a menustrip?
Many thanks,
Phil
|
|
|
|
|
lane0p2 wrote: how to add a trackbar into a menustrip?
I didn't get you . can you be more specific ?
Thanks in advance !!
cheers,
Abhijit
|
|
|
|
|
Hi,
sorry for being vague.
if you add a menuStrip with the standard items, say within the Tools button you add another item called Opactiy, once you've clicked on this anther menu opens but this is a trackBar. so you could change the opacity by sliding the trackbar.
does this make sense?
Many thanks,
Phil
|
|
|
|
|
Sorry !!! I am still Confused . Can you please give any link of some screenshots.
cheers,
Abhijit
|
|
|
|
|
I need to aquire the bitrate(kps) for wmv files without the use of the media player, attempts to Parsing an ASF Stream in C#, C++ and VB have failed, including the examples/articles post on his site. My C++ is not that great but the example provided within the VS documentation will not compile.
Any assistance appreciated.
dotman1
|
|
|
|
|
hi. i was able to successfully place my table on the crystal report viewer however, I have too many columns that are crowded in. I want to make them fit on the page and make the text visible. How do I do that? Some column names also have quite long labels like, "Registered Address" or "Registered City Code". How do you make this visible and fit in one page. Say I have 12 columns?
|
|
|
|
|
Throw some columns out, use a very small font, change the layout..?
|
|
|
|
|
I already have set the font size to 7 but still its the same. They overlap. I can't omit the other columns because they are required information. For the layout, how do you set that? Are you referring to the list of layouts of the crystal report like "Drop Table?"
|
|
|
|
|
Hey,
I now this i kind of a broad question, if not completly trivial, but how would one program a c sharp application that would only need to open a sqlconnection once. For example:
SqlConnection mySqlConnection = new SqlConnection("server=(local)\\SQLEXPRESS;database=cache;Integrated Security=SSPI;");
SqlCommand mySqlCommand = mySqlConnection.CreateCommand();
mySqlConnection.Open();
This works fine and all but i can only access the Sql command inside that class and have to open a new sql connection if i am to use this command again... Hope this is explain good enough...
|
|
|
|
|