/** *
Title:
*Description:
*Copyright: Copyright (c) 2006
*Company: numéro t/a Smart Analytics
* @author Ciaran Jessup * @version 1.0 */ /* * Modified: * 23 Jun 2006 cj */ //----------------------------------------------- package c.t.s.xfire; import javax.wsdl.PortType; import javax.wsdl.WSDLException; import org.codehaus.xfire.service.Service; import org.codehaus.xfire.transport.TransportManager; import org.codehaus.xfire.wsdl11.builder.WSDLBuilder; /** * @author ciaranj * */ /** * @author ciaranj * */ public class CustomJaxbWSDLBuilder extends WSDLBuilder { private static final String CUSTOM_JAXB_WSDLBUILDER_PARTNER_LINK_TYPE = "customJaxbWSDLBuilder.partnerLinkType"; private static final String CUSTOM_JAXB_WSDLBUILDER_ROLE = "customJaxbWSDLBuilder.role"; public CustomJaxbWSDLBuilder(Service service, TransportManager transportManager) throws WSDLException { super( service, transportManager ); } /* (non-Javadoc) * @see org.codehaus.xfire.wsdl11.builder.WSDLBuilder#createConcreteInterface(javax.wsdl.PortType) */ public void createConcreteInterface(PortType portType) { // Perform the normal WSDL Construction tasks super.createConcreteInterface(portType); //Add in the partner link defined for this service. Service service= getService(); String roleName= (String) service.getProperty( CUSTOM_JAXB_WSDLBUILDER_ROLE ); String partnerLinkTypeName= (String) service.getProperty( CUSTOM_JAXB_WSDLBUILDER_PARTNER_LINK_TYPE ); if( partnerLinkTypeName == null || partnerLinkTypeName.trim().equals("") ) partnerLinkTypeName= service.getName().getLocalPart() + "PartnerLinkType"; if( roleName == null || roleName.trim().equals("") ) roleName= service.getName().getLocalPart(); PartnerLinkType partnerLinkType= new PartnerLinkType( partnerLinkTypeName ); partnerLinkType.addRole( roleName, portType ); try { Utils.addPartnerLinkType(getDefinition(), partnerLinkType); } catch(WSDLException we) { we.printStackTrace(); } } }