code: private void updateSoapAddress() {
        final SOAPAddressRewriteMetadata metadata = getSOAPAddressRewriteMetadata();
        if (metadata.isModifySOAPAddress()) {
           //- code-first handling
           List<ServiceInfo> sevInfos = getServer().getEndpoint().getService().getServiceInfos();
           for (ServiceInfo si: sevInfos){
              Collection<EndpointInfo > epInfos = si.getEndpoints();
              for(EndpointInfo ei: epInfos){
                 String publishedEndpointUrl = (String)ei.getProperty(WSDLGetUtils.PUBLISHED_ENDPOINT_URL);
                 if (publishedEndpointUrl != null){
                    ei.setAddress(publishedEndpointUrl);
                 } else {
                    //- wsdl-first handling
                    if (ei.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)) {
                       String epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ei.getAddress(), metadata);
                       ei.setAddress(epurl);
                    }
                 }
              }
           }
        }
     }
docs: For both code-first and wsdl-first scenarios, reset the endpoint address
  so that it is written to the generated wsdl file.