|
Hi guys i was wondering if there is a way i could open a command prompt in a windows form and send it parameters?
Phoenix
|
|
|
|
|
namespace: System.Diagnostics
Process.Start
and
ProcessInfo
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
cmd /k
I have no idea why you would want to send parameters. Do you mean environmental variables maybe?
|
|
|
|
|
|
Hey thanx for the speedy replies guys. i'll check out all suggestions and let you know how it goes.
Basically what i want to do is run some oracle procedures, functions etc. from the command line. But what to make it more attractive.
Phoenix
|
|
|
|
|
I have managed to add a Web Reference to my project (VS 2008), however the java web service is expecting a header like this:-
<soap:Header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>username</wsse:Username>
<wsse:Password Type="wsse:PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
The code I am using to call a method on the java web service looks something like this:-
MyProject.userService service = new MySolution.MyProject.userService();
ICredentials credentials = new NetworkCredential("myusername", "mypassword");
service.Credentials = credentials;
long id = 298;
service.doStuff(id);
Not surprisingly the last line currently gives a SoapHeaderException with the message 'The Request must include an authentication token'
How do I go about setting the Soap Header?
thks
Simon
|
|
|
|
|
Simon Lime wrote: How do I go about setting the Soap Header?
Did you bother reading MSDN about the SoapHeader class? There is a good example there.
|
|
|
|
|
|
ooo
You will have to tinker then! Create a dummy webservice that exposes the same structure, and use that to model your client on.
Good luck
|
|
|
|
|
Thanks, that sounds like a plan!
Am v new to c# (in case you hadn't guessed), think I've got my work cut out!
|
|
|
|
|
-derive a class from the SoapHeader class
-create members that map to the xml elements in the header
-instantiate the new class inside your Web Service proxy class
-use the attribute [SoapHeader] on desired web method (of the proxy class)
You'll have to make a lot of tinkering until you will get that header. Use a network sniffer to capture the raw SOAP message and analyze it.
Look for examples on the net.
Read this article:
http://www.codeproject.com/KB/cpp/authforwebservices.aspx[^]
|
|
|
|
|
Thanks for the tip.
All I have done to create my Web Service proxy class is to add a Web Reference. I guess I need to extend my proxy class somehow so that I can specify a SoapHeader attribute.
|
|
|
|
|
|
hi Everybody,
I am new to SIP and C#. Now i attempting to create video conferencing Using SIP and C#.
But i dont know how to create SIP server and how to stream video .
Could you please tell me how to do that?
or
Give me some links about video conferencing
sorry for my poor english
Thank you ,
Senthil.P
|
|
|
|
|
Google might be better suited to answer a vague and broad question like that.
|
|
|
|
|
Hello everyone,
I currently clean-up resource in an HttpListenerContext instance in this way.
- Get Request.InputStream, and Close it;
- Get Response.OutputStream, and Close it.
My question is,
Is it the correct way to clean-up resouces? Since I did not fonud a Dispose or Close method for this class. Are there any more elegant way to clean-up resouce for HttpListenerContext?
thanks in advance,
George
|
|
|
|
|
Why are you cleaning up something that you did not instantiate? HttpListenerContext does have a private Close method, and hence it will be cleaned up by the creator of that instance.
|
|
|
|
|
Thanks leppie,
My situation is, I am writing an Http service and handles requests from clients. I do not want to run out of handles for my Http service, so I want to release resources like InputStream/OutputStream handles ASAP.
My concern is, if I do not explicitly Close them after using, when will the streams be closed?
- If it is left to GC to close, it will be bad, since GC runs in an non-determistic manner.
- If they will be released by some parties very quickly, it will be great.
Any comments?
regards,
George
|
|
|
|
|
It depends how you host the HTTP services. Who creates the HttpListenerContext?
|
|
|
|
|
|
George_George wrote: Any comments to my original question after reading the code?
Not really, the GC should do a proper job. Do you see it otherwise?
|
|
|
|
|
Hi leppie,
I know GC can do the job, but what I want to do is to do something like using block, which will release resource ASAP. Since there is no Close/Dispose method for HttpListenerContext, so I manually release Request.InputStream and Response.OutputStream. My question is whether my solution is correct and whether there are any better solutions?
Any comments?
regards,
George
|
|
|
|
|
You can try, but I dont think it will serve any benefit. Run some representative load tests on both cases.
|
|
|
|
|
Any tool could be used to monitor? I prefer to use Perfmon, but if you have better tools, please refer here.
regards,
George
|
|
|
|
|
Process Explorer I prefer, you can see the .NET performance monitors nicely
|
|
|
|