WebService Client Tools

Source: Internet
Author: User

     Public StaticObject invokewebservice (String namespaces,string URL, string method, object[] params, object[] paramnames) {O Bject result=NULL; Try{Service service=NewService (); Call Call=(call) Service.createcall (); Call.setoperationname (NewQName (namespaces, method)); Call.settargetendpointaddress (NewJava.net.URL (URL)); if(Paramnames! =NULL&& paramnames.length > 0) {                 for(inti=0; i<paramnames.length; i++) {String qName=paramnames[i].tostring ();                Call.addparameter (QName, Org.apache.axis.encoding.XMLType.XSD_STRING, Javax.xml.rpc.ParameterMode.IN);            }} call.setreturntype (Org.apache.axis.encoding.XMLType.XSD_STRING); Call.setusesoapaction (true);            Call.setsoapactionuri (URL); //System.out.println ("Start Calling interface");result =Call.invoke (params); //System.out.println ("Interface return information:" +result);}Catch(Exception e) {e.printstacktrace (); //System.out.println ("*****[" + New SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"). Format (new Date ()) + "[" + SendMsgClientService.class.getCanonicalName () + ". Invokewebservice.remoteexception] Administrative Bus call Axiswebservice Exception * * * * * * * * * * ;        }        returnresult; }

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.