Client Source files
The CXF library includes a utility that allows one to generate client Java source files to assist in communicating with the Community Services. If you notice in the section above we reference a serviceClass with a value of org.lds.ngis.api.MisApiServiceSoap which doesn't exist until we generate it.
The steps are easy enough.
- Open a command prompt at the base directory of the ngis-client project.
- Run the command 'mvn -Pwsdl2java' which will update all of the client files from the wsdl location specified in the pom.xml.
Or you can do it the manual way if you like.
- Download CXF from Apache at http://cxf.apache.org/download.html. (We have had success with 2.1.4 but that doesn't mean newer versions won't work as well.)
- Extract the CXF files.
- Once extracted open a command prompt window to the path of the bin directory in the extracted CXF files.
- Run the command below with any modification as needed. Notice I am generating the files to my temp\cxf directory, which needs to exist.
- wsdl2java -client -d d:\temp\cxf -p org.lds.ngis http://tech.lds.org/CMIS-Services/Services/MisService?wsdl
- Copy the files into your project at [Web Project Base]/src/main/java/org/lds/ngis/api
When a user logs in all of the user's member information needs to be loaded including the user's Member Record Number (MRN), assignments (Bishop, Ward Clerk, etc.), and Unit/Organization (Highlands Ward, Uintah Stake, etc.). In ngis-client this was accomplished through the following source. We are hoping that this method of loading the member data will become common practice among all community applications. All files below require LDS Account credentials.
- serviceBeanContext.xml - Override the ldsAcccountDetailsFactory
<bean id="ldsAccountDetailsFactory" class="org.lds.ngis.security.MemberDetailFactory" />
- MemberDetailFactory.java - Factory used to populate additional member data into the MemberDetail object. Calls the MemberService's findMember method.
- MemberDetail.java - Detail bean used to store the membership information.
- NgiService.java - Interface for the NgiServiceImpl.java which is in the Service Layer of the Stack Architecture.
- NgiServiceImpl.java - Implementation of Service Layer Interface. Invokes SOAP web service method to validate a member by an MRN. Returns the ValidatedMember object.