Java calls the WebService written in C #

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.