public void addService ( TDefinitions descriptionType ) { String interfacens ; String interfacename ; QName qname ; String name ; if ( soapFactory == null ) soapFactory = new org . xmlsoap . schemas . wsdl . soap . ObjectFactory ( ) ; TService service = wsdlFactory . createTService ( ) ; descriptionType . getAnyTopLevelOptionalElement ( ) . add ( service ) ; name = this . getControlProperty ( MessageControl . SERVICE_NAME ) ; service . setName ( name ) ; interfacens = this . getNamespace ( ) ; interfacename = this . getControlProperty ( MessageControl . BINDING_NAME ) ; qname = new QName ( interfacens , interfacename ) ; TPort port = wsdlFactory . createTPort ( ) ; service . getPort ( ) . add ( port ) ; port . setName ( name + "Port" ) ; port . setBinding ( qname ) ; org . xmlsoap . schemas . wsdl . soap . TAddress tAddress = soapFactory . createTAddress ( ) ; port . getAny ( ) . add ( soapFactory . createAddress ( tAddress ) ) ; String address = this . getURIValue ( this . getRecord ( MessageControl . MESSAGE_CONTROL_FILE ) . getField ( MessageControl . WEB_SERVICES_SERVER ) . toString ( ) ) ; // Important - This is the web services URL tAddress . setLocation ( address ) ; }
AddService Method .