Use axis to send xml packets, return and parse the message instance, axisxml

Source: Internet
Author: User

Use axis to send xml packets, return and parse the message instance, axisxml

I learned a little about webservice some time ago, so I 'd like to share my achievements with you. For the sake of ability, I can only make a small instance. Sorry!

The idea of this example is: (1) construct the packet to be sent with the String type; (2) use axis to call the service to send the packet; (3) parse the returned packet.

The following is the package used by axis:

The following is the instance code:

1 // test instance 2 public class test {3 4 public static void main (String [] args) {5 // TODO Auto-generated method stub 6 test t = new test (); 7 // send 8 String requestXml = "<? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"?> <Service xmlns = \ "http://www.chinatax.gov.cn/spec/\" xmlns: xsi = \ "Courier"> 

Of course, the format of the sent message varies according to the document type definition provided by others, so the method of parsing the message is different, but the general idea is as follows, so the code is only for reference.

 

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.