Talk about the development of WebService-application (a)---mobile phone attribution to search

Source: Internet
Author: User
Tags wsdl

Continue on a WebService foundation, here introduce some common application development, mainly let everybody practice practiced hand. Follow-up will also introduce the common development methods in the future work, using CXF, AXIS2 and other third-party framework for development.

I believe you can often see some sites have mobile phone attribution to query, weather and other information, then where is this information? In fact, some units provide free webservice services, then where to find these free services, you can go to the Web Services (free) query to a lot of free webservice services, you can also visit this blog is a popular free WebService service list, It collects a lot of free webservice services.

Development steps:

1. Create client-side engineering phone-jdk-client, such as:

2. The tool automatically generates some client code, the method is described in the previous article, here is not to repeat.

3. Write the Test code:

Package Com.devins.ws.phone;import Cn.com.webxml.mobilecodews;import Cn.com.webxml.mobilecodewssoap;public class phonebelongquery {public static void main (string[] args) {Mobilecodews factory = new Mobilecodews (); Mobilecodewssoap Mobilecodewssoap = Factory.getmobilecodewssoap (); String mobilecodeinfo = Mobilecodewssoap.getmobilecodeinfo ("13316198876", null); System.out.println (Mobilecodeinfo);}}

4. Implementation results:

13316198876: Guangdong guangzhou Guangdong Telecom CDMA Card


Similarly, can also use the same way to get weather information, train time information, and so on, as a client development, I believe that as long as there is a corresponding WSDL document can be developed accordingly. But I believe there will be some friends, the above test code some doubts, such as: Why I will know the beginning to New Mobilecodews ()? Why do I know that calling the Getmobilecodeinfo () method, and so on, here personally feel the need for a more in-depth understanding and analysis of the WSDL document, consider the next chapter to do another introduction. In the case of a WSDL document that is not yet well-developed, it is possible to use this method to determine the above two doubts in a personal experience, for classes that start with new can look at the last part of the WSDL document <wsdl:service name= "Mobilecodews"; The subsequent invocation of what method is believed to be a developer can also be judged from the method name and the required entry parameters.



Talk about the development of WebService-application (a)---mobile phone attribution to search

Related Article

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.