First of all, you must understand that WebService is similar. For the user, he cannot see what your WebService is written for, because it is both soap and WSDL-like, so why do we need such a name... is to facilitate the majority of familiar with C # later with Java brothers and sisters search.
The people who use C # Know That vs is used to generate a WebService call, which makes it easy for people who only use Java to believe it (...), A dialog box, an address, and a finish button are all done. well, now you are using Java, and you are beginning to suffer... now, let me tell you an Eclipse plug-in that is almost the same as vs. It is easy to call WebService using this plug-in.
This is called xfire. Click the URL below and you will get everything.
Http://xfire.codehaus.org/Eclipse+Plugin
Very good, so you installed it and used it. I found this is really as easy as Vs, and I also took the initiative to generate a lot of classes for you like vs. It's just the same as what I wrote. Hi, it's really good.
How can we call it?
Assume that the name of the WebService you want to call is helloworld, and there is a webmethod named sayhey (string name ). find out the classes that are automatically produced. There should be a class named helloworldclient. the followingCodeDemonstrate how to use:
Helloworldclient serviceclient = new helloworldclient ();
Helloworldsoap = serviceclient. gethelloworldsoap ();
String result = soap. sayhey ("notus ");
In general, xfire will generate a class using the WSDL address you provide. Unlike vs, you need to call your webmethod in two steps.
If you install the above steps Step by step, it is good, and finally you are doomed to no way to run successfully-_-because, because this is not true after all vs, before running, you need to make a setting.
The properties configuration window is displayed from the right-click menu of your project. Select the xfire item in the left column, and all the class libraries related to the xfire running will be listed on the right, in this way, everything is fine.
Congratulations! The first step is coming!
Below is a detailed descriptionArticle, Recommended to you. this article tells me that some classes need to be checked in the configuration when I am worried about why I cannot run it... and then pulled me out of the pain.
Http://blog.csdn.net/igate/archive/2008/04/12/2286147.aspx
Why am I not giving this address directly? I know that my wheel has no good people. I am doing this to back up the data. In case the csdn blog crashes one day...
In addition, the title is easier for you to search for in C #, instead of having to suffer as much as I do... What Maven, ant, what, and what should be done?