|
Can you somehow use reflection on web services? Perhaps all of your services (like service1, service2, etc. from your example) could export a property that returns a MethodInfo[] will all its methods, and you could call them (add, subtract, multiply, and divide) from that array? Does your main service know that all sub-services implement only those four methods, or could they implement some arbitrary unknown method that you want to export, like say sqrt? If the methods are known, then you could, upon finding a service, make a call to all the possible methods, and the ones that error MAY not be exported by that service, but the ones that work will for sure be available. So, for example, you set up service4, then your mainService would find service4, then make a call to service4.add(1, 1), which would error. Then you make a call to service4.divide(1, 1), which would possibly not error, in which case you would know that method is exported. I'm not familiar with web services, so I'm just throwing out ideas...
Jeff
|
|
|
|
|
Use an object as your parameter: (I typed this quickly but obviously use Properties)
public class Foo{
public string Method;
public int Num1;
public int Num2;
}
[WebMethod]
public void FooBar(Foo foo){}
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks for the quick reply,
to clear things up, essentially I am trying to do this (I know the coding is wrong, just want to give the idea)
String address="htt://localhost:2299/Service1.asmx" (read from config)
Double num1=2,num2=3(read from config)
Service ser=new Service(address)
Double result=ser.method(num1,num2)
In the past, I can only invoke that service's methods if i add a web reference to it, but this would mean that I need to recompile the main project everytime I add a new service. I would know exactly which service to call and what methods it has.
--------------------------
So far I have managed...
string myURL = "http://localhost:2299/Service1.asmx";
SoapClient sc = new SoapClient();
sc.set_ClientProperty("ServerHTTPRequest",true);
sc.mssoapinit(myURL + "?WSDL","","","");
but again, I don't know how to invoke it's method (or even if it's possible) this way.
Thanks
|
|
|
|
|
I have built different application and I want to put all together as a suite. Any ideas?
a novice
|
|
|
|
|
Ofori Boadu wrote: I have built different application and I want to put all together as a suite. Any ideas?
Add them both to the same setup project.
|
|
|
|
|
Take a look at this article it describes how you could addeach application as a feature in an installer.
"You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
|
|
|
|
|
Oftentimes when applications are allowed into a suite they trash the place and you're left with a rather large repair/cleanup bill.
|
|
|
|
|
Several forms are displayed and each of them contains a plot. Just like the different figures in Matlab. Each them contains one button to edit the figure properties. When I click the edit button on the non-activated form, no reponse from the edit button for the first click! That means I always have to click or actiavate the non-activated form first, then the edit button can response. or I have to click twice the edit button to make it work (only for the first time). Obviously, this is not convenient. How to avoid the this problem?
thanks.
|
|
|
|
|
Why did you reask the same question two minutes later?
|
|
|
|
|
Its the curse of the slow loading times. It goes slow, or times out, so you click post again.
But unknown to you, your post has already made it onto the forum, but the page hadn't loaded on your machine.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
If you look close the text is not exactly the same, so he really did post twice.
|
|
|
|
|
I tried for the first time, it said it is too busy and sorry...
then I change a little bit and resend it again..
that is the true!!
|
|
|
|
|
And i beleive you, i've done it myself.
You only ever see this type of double-post when you spot something and change it (i usually see a spelling mistake or something while i wait for it to load, i now must restrain myself, and wait) - otherwise the "you have already posted this message" screen comes up, and blocks your message.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Just an FYI that if it happens to please delete one of the posts.
Thanks!
|
|
|
|
|
Several forms are displayed and each of them contains a plot. Just like the different figures in Matlab. Each them contains one button to edit the figure properties. When I click the edit button on the non-activated form, the no reponse from the edit button for the first click! That means I always have to click or actiavate the non-activated form first, then the edit button can response. Obviously, this is not convenient. How to avoid the this problem?
thanks.
|
|
|
|
|
Are you still having trouble with this?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Yes!
I can not solve this problem.
I think this is the common problem and I believe there should be the solution, but I can not find it.
I think most people can easily meet this problem once he use more forms and switch the process to different forms. But so far no one give me one solution for this.
thanks.
|
|
|
|
|
Hi.
I have a client for a web service written in C#. It's task is to send some files as SOAP attachments to the web service.
It works fine, but occasionally, if the files are large, the service throws a TimeoutException.
I saw that it is possible to set the timeout value to infinite(default is 15 seconds), thus avoiding the exception.
My question(s): Is it a "bad practice" to do this? I mean, if it solves these kind of problems, why isn't the timeout set to infinite by default? Are there any bad repercussions if I always do this?
Thanks.
|
|
|
|
|
blackjack2150 wrote: why isn't the timeout set to infinite by default?
Isn't it obvious? What if something goes wrong? The service will be waiting forever. By setting a timeout period, you guarantee that the service will eventually give up and resources can be reclaimed. Infinite timeouts are a bad idea. You would need to judge how long to set your timeout period based on the amount of time you expect is required to upload a file.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Web services are not designed to transfer large files. A simple solution is to have the web service return a URI to a file that can be downloaded outside of the SOAP wrapper.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Web services are not designed to transfer large files. A simple solution is to have the web service return a URI to a file that can be downloaded outside of the SOAP wrapper.
Well, this particular web service has two. There's no other way. By large file I mean up to 4 MB. But in the future they intend to allow sending files up to 30MB.
|
|
|
|
|
blackjack2150 wrote: There's no other way
There are infinite amounts of other methods, I suggest that you strongly recommend one of the more acceptable ones before adjusting timeouts.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
You'll learn more by trying it.
|
|
|
|
|
Hi,
I have large amount of Binary data from which i need to generate HEX. What would be the best approach and more efficient way, if you have any samples please give me.
|
|
|
|
|
Do you mean you have for example a text file full of 0's and 1's that you need to turn into a text file of Hex?
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|