Java calls the WebService interface provided by PeopleSoft

Source: Internet
Author: User
Tags soapui wsdl

Used to Soapui,apache-cxf,eclipse.

1. Address validity provided using the SOAPUI test

WSDL Address: http://192.168.56.101:8800/PSIGW/PeopleSoftServiceListeningConnector/PSFT_HR/C_HR_CLUB.1.wsdl

Creating SoapUI Projects File->new SoapUI Project

Click OK.

Display the interface, double-click Request1, click the Green button, execute, see response result

The right side is the response result.

2. Generate Java Client code

Now to invoke the interface on the Java side, first, in the Soapui interface, file->preferences, configure global settings.

Use CXF to generate Java code.

Under D:\SRC\COM\CXF see (through the cmd command, Wsdl2java is the same)

3. Import this package into eclipse

The test code is as follows:

Import Com.cxf.ApplyJoinClub;
Import Com.cxf.CHRCLUB;
Import Com.cxf.CHRCLUBPortType;
Import Com.cxf.GetJoinClubStatus;

public class Stringtest {

Public static void Main (string[] args) {
//spring Management
//applicationcontext ctx = new Classpathxmlapplicationcontext ("Applicationcontext-cxf.xml");
//chrclubporttype cc = Ctx.getbean ("Testservice", chrclubporttype.class);
applyjoinclub AA = new Applyjoinclub ();
aa.setname ("zzz");
aa.setemail ("[email protected]");
aa.setclubid ("101");
//java tests
chrclub C = new Chrclub ();
Chrclubporttype CCC = C.getchrclubport ();
Getjoinclubstatus GJ = ccc.capplyjoinclub (aa);
System.out.println ("----" +gj.getrescode () + "=" +gj.getresdescr () + "=" +gj.getresdescrlong ());

}

}

Remember: The parameter name returned by PS cannot be used: Faultcode,faultstring,detail, because CXF internally, use these parameters to determine the response condition.

Java calls the WebService interface provided by PeopleSoft

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.