|
Environment – VS2010, Window 7;iis7.0
We have created a Web service (EDI_Translate) and we are consuming this webservice in C# console application. This console application calls the web service in a loop continuously in different thread. The web server handles the request sequentially (like first in first out) but we want web server to handle the request parallely to boost the performance. What should be done in webservice code or web server in order to handle the request paralley by webservice code .
Ramesh Kumar Singh
Software Engineer
Ness Technologies
India
|
|
|
|
|
Without knowing anything at all about what the webservice actually does or how it does it how do you expect anyone to accurately answer this?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Calling the service in a loop sounds pretty serial to me. I suspect that the client is making requests in that form, and the server is not serialising them. Web services are (I think) intrinsically parallel. Try starting two clients and see if they interleave.
|
|
|
|
|
Hello everyone this is my first post so be gentle.
I've implemented a solution to download file,
the problem is that specific pdf files can't be downloaded with lots of bytes per package therefore I want to decrease the number of packages but in order to reduce the waiting time until download completion I want to download the file in sections which means to download parts of the file simultaneously when I implemented it I got an exception "Stream does'nt support multiple IO accesses" probably I'm doing something wrong can someone tell me what should I correct or how should I do it?
for (int i = 0; i < numberOfParts; i++)
{
httpRequest.AddRange("splittedDownload",Convert.ToInt32(i * size / 5),Convert.ToInt32((i+1) * size / 5-1));
httpResponse = (HttpWebResponse)httpRequest.GetResponse();
streams.Add(new MyStream(httpResponse.GetResponseStream(),i+1));
IAsyncResult result = streams[i].Input.BeginRead(buffer, 0, paketSize, AsyncDownload, streams[i]);
}
Thanks.
|
|
|
|
|
You can't read a network stream with random access because the data you are trying to access doesn't exist yet. I don't think HTTP supports downloading files in sections, but I'm not sure about that – it supports starting a download from a particular point (that's how browsers can resume a download so you might be able to fire multiple requests for parts of a file.
Chances are though that the waiting time is to do with your connection speed and not this.
|
|
|
|
|
Thank you for the reply,
I've used AddRange in order to start downloading from specific place I think this is the method in order to do it please correct me if I'm wrong but the first request goes well but when I tried to start the second Async operation I get the exception.
I checked the pdf issue and I can see that I can download rar files in packets of 1024 bytes (I didn't check it with bigger packets) but pdf files are recieved corrupted if I download more than 2 bytes every time so it effects the download speed (the same file with 1024 bytes is downloaded in 26 seconds now with 2 bytes it grows to 37 seconds and this is small file,about 2.5 MB) so I think this is the right solution, can you please tell me what is may be wrong in my code in my last correspondence?
Thank you very much.
|
|
|
|
|
The number of bytes you read at a time should not affect the output. You are doing something wrong in your reading code if that is the case (perhaps writing the buffer size, not the actual number of bytes read, at each step). It should be something like
byte[] buf = new byte[buf_size];
int read;
while(0 < read = stream.Read(buf, buf_size)){
outStream.Write(buf, 0, read);
}
A common mistake is to write buf_size bytes to the output, not read bytes.
2.5MB in 26 seconds is roughly 800kbps, that is quite plausible for a transfer from the public internet.
|
|
|
|
|
Thanks, that was the problem
now I can download the 2.5MB file in about 13 seconds
anyway I would like to know what I did wrong with the download in parts (just to learn for the next time) but its not that urgent anymore.
Thank you very much
|
|
|
|
|
Hello Everybody,
I am drawing text, rectangle and Line. In which have i am tring to zoom Text but i m confused how to zoom text as per as zoom level.
Eg : Rectangle r = new Rectangle (x,y,width * zoomlevel,height * zoomlevel);
How to Zoom Text for ZoomLevel.
Thanks
If you can think then I Can.
|
|
|
|
|
You need to create a scaled version of the text's font.
|
|
|
|
|
The easiest way to do this is very simple: apply a Scaling factor to the graphics object you are drawing on. Create a Panel, and two buttons, then handle the appropriate events:
float sx = 1.0F;
float sy = 1.0F;
Font font = new Font("Verdana", 10.0F);
private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.ScaleTransform(sx, sy);
g.DrawRectangle(Pens.Blue, new Rectangle(50,50,150, 150));
g.DrawLine(Pens.Red, 0,0, 200,200);
g.DrawString("Hello there this is text", font, Brushes.Green, new Point(20,20));
}
private void butZoomIn_Click(object sender, EventArgs e)
{
sx *= 2;
sy *= 2;
panel1.Invalidate();
}
private void butZoomOut_Click(object sender, EventArgs e)
{
sx /= 2;
sy /= 2;
panel1.Invalidate();
}
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Oh, good call, I forgot about that.
|
|
|
|
|
Good Day all
i have a SQL Job and i want to change the times in the job programmatically from C#. The application that will change the Job Settings will be accessing the job remotely.
Is is possible ?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Just curious, same question you asked here[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Yes you are right, this is because i want to see different types of View from different type of People. its not like i posted the same question in the same website.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: its not like i posted the same question in the same website.
Yes, I agree.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
You mean when it is scheduled to run?
Are you writing a SQL management tool? If not I don't see the point.
The point of having a scheduled job is to schedule it because it isn't dynamic (relatively speaking). And there are other ways to deal with dynamic problems.
I am rather certain you can create jobs via some API though. That would include setting the times. I would google for it.
|
|
|
|
|
Hi all,
i want to develop one addin for MS Word. document created under my addin can not open without my addin(i.e. if user don't have my addin, default screen to download addin will open....after install user can view the document). is it possible with Word addin? how?
Thanks,
Ankur
!- F - R - I - E - N - D - S -!
|
|
|
|
|
I would start by defining a new file extension for documents created with my add-in. When Windows encounters an unknown file type, it asks the user to identify an application to use for opening it, or offers to search the Web for a suitable application. Your download site will have to publish its ability to provide a suitable program for opening that type of file, and I have no idea how that is done, but I'm sure you can find that information using Google.
Will Rogers never met me.
|
|
|
|
|
Dear sir
Myself Pardeep working in the private sector. I am beginer in the C# environment. I got a task to stich(join) two images with removing overlap area one of the image. First i am tried a lot for loading two images in c#. I did't get any desirable help. please help me.I am waiting for your feedback.
Thank you.
|
|
|
|
|
I guess you need to start with the Image [^] Class.
The best things in life are not things.
|
|
|
|
|
- Load the two images with Image.Load
- Calculate or take as user input the overlap amount/direction
- Create a new Bitmap* for the combined image, taking into account the overlap when calculating the size
- Get the graphics object for the new bitmap (Graphics.FromImage, iirc)
- Draw the first two images into the combined bitmap with Graphics.DrawImage
*: unless you're combining metafiles or another vector format, but 'image' usually implies raster.
|
|
|
|
|
helo guys... I am frequently wathcing the following line in tutorials online. What does this line mean? thnx
public int? Year;
|
|
|
|
|
int is non nullable
int? is nullable
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
to elaborate on Mycroft's reply. This is often used when talking to the database. Suppose you have a column that contains a number, but the column can be null. In that case you would need to check if the value was DBNUll.Value and if so convert your variable (that maps to that column) to -1 or 0 or something. When using the ? construct you don't need to convert it and can directly map the variable to the database column. Some goes if you want to write a value to that column.
The ? is an 'override' so you can put null values in non-nullable variables (int, double, DateTime, ... but not strings, they can be null)
Hope this helps.
[EDIT]PS: don't be afraid to use it, but don't use it if you don't have to.[\EDIT]
V.
|
|
|
|