Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Background

The impetus for this library is for consistency and ease of management.  Multiple clients interface with KFS' web services so developing a shared library to handle that reduces code replication and modification of that code is done in one place.

Source Code Repository

svn+ssh://svnd@repo.its.hawaii.edu/misint/kfs-webservice-client

To be moved to github soon

Clients

eTravel -  calls getAccountByPrimaryId and isActive

Workflow - calls getAccountByPrimaryId, getAccountSupervisorDelegateByPrimaryId, and getAccountDelegateByPrimaryId

ePayment - calls getPayeeACHAccountByPrimaryId

Generating JAX-WS Artifacts

Use SoapUI to do generate the stubs.  Go to this wiki page for step by step instructions.

The auto generated stubs for the ACH service weren't copied as is to this library. The primary interface classes were modified to be more human readable. For the ACH web service, ACHWebServicePortType.java was renamed (and modified to reflect the current @WebService name) to UhACHWebService.java and ArrayOfPayeeACHAccountWebType.java was renamed to PayeeACHAccount.java. SoapUI will generate a class named UhACHWebService.java but it's just a sample client application so that class doesn't need to be copied into this library.

For the account web service, all classes were copied over as is except for UhAccountWebService (because it's a sample client application) and UhAccountWebServicePortType.java was renamed (and modified to reflect the current @WebService name) to UhAccountWebService.java.

Troubleshooting

eTravel and ePayment have unit tests for the web services so that's the quickest and easiest way to test the web services because they give more information on what is actually wrong.  The log files for either app don't show the level of detail in the logs that the unit tests do.

Marshalling error

See KFSUP-13 for more info and

Between KFS4 and KFS6, the uri changed for the AchWebService from http://util.java to http://businessobject.pdp.kfs.its.hawaii.edu so this library had to be rebuilt to account for that difference. 

org.springframework.remoting.jaxws.JaxWsSoapFaultException: Unmarshalling Error: unexpected element (uri:"http://util.java", local:"PayeeACHAccountWebType"). Expected elements are <{http://businessobject.pdp.kfs.its.hawaii.edu}PayeeACHAccountWebType> ; nested exception is javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element (uri:"http://util.java", local:"PayeeACHAccountWebType"). Expected elements are <{http://businessobject.pdp.kfs.its.hawaii.edu}PayeeACHAccountWebType> 
	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.doInvoke(JaxWsPortClientInterceptor.java:503)
	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.invoke(JaxWsPortClientInterceptor.java:487)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at com.sun.proxy.$Proxy12.getPayeeACHAccountbyPrimaryId(Unknown Source)
	at edu.hawaii.its.epmt.webservice.client.WebServiceClientTest.existantPayeeAccount(WebServiceClientTest.java:33)

Failed to Create Service

See SADMIN-5084 and SADMIN- 7236 for more info

We're constantly running into this problem during the quarterly upgrades for Java.  When this error occurs, it's almost guarantee that the root ca certs are not in the JDK's cacerts keystore.  The SAs have just been copying the cacerts from the old version to the new version instead of importing the certs directly into the cacerts keystore.

2015-08-18 11:14:24,866 [http-172.16.4.183-9584-2] [user cahana | sessionId 71C6CE1E3DD3AE6A8177E567ABF32862] DEBUG edu.hawaii.travel.kfs.KFSUhWebServiceUtil - javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
	at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:152)
	at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63)
	at javax.xml.ws.Service.<init>(Service.java:77)
	at javax.xml.ws.Service.create(Service.java:707)
	at org.springframework.remoting.jaxws.LocalJaxWsServiceFactory.createJaxWsService(LocalJaxWsServiceFactory.java:134)
	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.prepare(JaxWsPortClientInterceptor.java:288)
	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.invoke(JaxWsPortClientInterceptor.java:376)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at com.sun.proxy.$Proxy10.isPayeeACHActive(Unknown Source)
	at edu.hawaii.travel.kfs.KFSUhWebServiceUtil.isPayeeACHActive(KFSUhWebServiceUtil.java:115)
	at edu.hawaii.travel.request.TravelRequestWorker.fetchNewTravelerInfo(TravelRequestWorker.java:270)
	at edu.hawaii.travel.request.TravelRequestWorker.fetchNewTravelerInfo(TravelRequestWorker.java:178)

301 Moved Permanently

See KFSUP-10 for more info

The issue was caused by incorrect registry url endpoints defined in KFS.  To resolve, KFS needs to be built with the correct endpoints.

2017-06-21 10:59:05,887 [http-172.16.4.183-9584-3] [user cahana | sessionId 57108BAE3F4AD933F48EB273EC65ACE6] WARN  org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {KFS}UhAccountWebService#{KFS}getAccountByPrimaryId has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Response was of unexpected text/html ContentType.  Incoming portion of HTML stream: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://test6.kfs.hawaii.edu/kfs-tst6/remoting/UhAccountWebService">here</a>.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at test.kfs.hawaii.edu Port 443</address>
</body></html>

Service Construction Exception

See stackoverflow post for more info

This problem arose when the delegation web service method was blowing up.  I recreated the stubs through SoapUI, updated the references to those stubs and the error below was thrown. To resolve, I added the number 2 at the end of each XmlType annotation "name" attribute in all of the Get*.java classes.

Caused by: org.apache.cxf.service.factory.ServiceConstructionException
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:339)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:432)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:179)
	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
	at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
	at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:458)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:330)
	... 73 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 10 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{KFS}getSubAccountByPrimaryId". Use @XmlType.name and @XmlType.namespace to assign different names to them.
	this problem is related to the following location:
		at edu.hawaii.its.kfs.coa.jaxws_asm.GetSubAccountByPrimaryId
	this problem is related to the following location:
		at edu.hawaii.its.kfs.coa.businessobject.GetSubAccountByPrimaryId
		at public edu.hawaii.its.kfs.coa.businessobject.GetSubAccountByPrimaryId edu.hawaii.its.kfs.coa.businessobject.ObjectFactory.createGetSubAccountByPrimaryId()
		at edu.hawaii.its.kfs.coa.businessobject.ObjectFactory
		at protected javax.xml.bind.JAXBElement edu.hawaii.its.kfs.coa.businessobject.UhSubAccountWebType.accountCrosswalkIdent
		at edu.hawaii.its.kfs.coa.businessobject.UhSubAccountWebType
		at private edu.hawaii.its.kfs.coa.businessobject.UhSubAccountWebType edu.hawaii.its.kfs.coa.jaxws_asm.GetSubAccountByPrimaryIdResponse._return
		at edu.hawaii.its.kfs.coa.jaxws_asm.GetSubAccountByPrimaryIdResponse

 

 

  • No labels