Java simple webService Interface Adjustment

Source: Internet
Author: User

/* Pay attention to loading xfire-all-1.2.6.jar */
Import org. codehaus. xfire. client. Client;
/* Parse the returned xml using dom4j */
Import org. dom4j. Document;
Import org. dom4j. extends entexception;
Import org. dom4j. Element;
Import org. dom4j. io. SAXReader;
 
Public class Test {
Public static final String WebService_URL = "http: // 111.11.11.111: 8888/desk/service. asmx? Wsdl ";
Public static void main (String [] args ){
Client client1 = null;
Try
{
Client1 = new Client (new URL (WebService_URL ));
Object [] strResult1 = null;
// If the interface has a method name and a parameter needs to be included, specify the parameter in the form of an Object [] array in invoke.
StrResult1 = client1.invoke ("interface method name", new Object [] {parms1, parms2 ,.....
});
System. out. println ("Calling Interface return xml format -->" + strResult1 [0]);
}
Catch (MalformedURLException e)
{
E. printStackTrace ();
}
Catch (Exception e)
{
E. printStackTrace ();
}
}
}
 
This article is from the "Youth bag" blog

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.