public static String getInterfaceTargetNamespace ( ClassInfo classInfo , String seiClassName , String implementedTargetNamespace , InfoStore infoStore ) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass ( classInfo , JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) ; if ( annotationInfo == null ) { return "" ; } boolean isProvider = isProvider ( classInfo ) ; // if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue if ( isProvider ) { AnnotationValue attrValue = annotationInfo . getValue ( JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) ; String attrFromAnnotation = attrValue == null ? null : attrValue . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromAnnotation ) ? implementedTargetNamespace : attrFromAnnotation ; } if ( null == infoStore || StringUtils . isEmpty ( seiClassName ) ) { return implementedTargetNamespace ; } // if can get the SEI className, go here. // Here, the SEI package name instead of implementation class package name should be used as the default value for the targetNameSpace ClassInfo seiClassInfo = infoStore . getDelayableClassInfo ( seiClassName ) ; String defaultValue = getNamespace ( seiClassInfo , null ) ; if ( StringUtils . isEmpty ( defaultValue ) ) { defaultValue = JaxWsConstants . UNKNOWN_NAMESPACE ; } annotationInfo = seiClassInfo . getAnnotation ( JaxWsConstants . WEB_SERVICE_ANNOTATION_NAME ) ; if ( null == annotationInfo ) { // if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do) if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultValue ) ; } return defaultValue ; } // if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service String attrFromSEI = annotationInfo . getValue ( JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromSEI ) ? defaultValue : attrFromSEI ; }
get the targetNamespace from SEI . If it is webServiceProvider just return the targetNamespace attribute from annotation . If it is webService and no SEI specified return the implementedTargetNamespace ; If it is webService and SEI specified with no targetNamespace attribute should report error? If it is webService and SEI specified with targetNamespace attribute just return the targetNamespace attribute value .