Suppose you have an EJB
package com.example;
@Stateless
@WebService
OrganizationService {...}
First you should write a webservices.xml file for it as follows, since its sections will be referenced back from weblogic-webservices.xml where the actual endpoint configuration is done.
webservices.xml (Caution: by adding webservices.xml webservice annotations in classes are overridden!):
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
<webservice-description>
<!-- just a label, can be anything you want -->
<webservice-description-name>MyServiceName</webservice-description-name>
<port-component>
<!-- just a label, can be anything you want -->
<port-component-name>MyServicePort</port-component-name>
<!-- Target namespace from wsdl -->
<wsdl-port xmlns:ex="http://example.com/target/name/Space">ex:MyService</wsdl-port>
<!-- Fully qualified class name of the ejb interface/bean providing the service -->
<service-endpoint-interface>com.example.OrganizationService</service-endpoint-interface>
<service-impl-bean>
<!-- The class name of the bean providing the service -->
<ejb-link>OrganizationService</ejb-link>
</service-impl-bean>
</port-component>
</webservice-description>
</webservices>
Then in the weblogic-webservices.xml you can define whatever endpoint you want.
weblogic-webservices.xml:
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-webservices xmlns="http://www.bea.com/ns/weblogic/weblogic-webservices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-webservices http://www.bea.com/ns/weblogic/weblogic-webservices/1.0/weblogic-webservices.xsd">
<webservice-description>
<!-- This must match the name given in webservices.xml -->
<webservice-description-name>MyServiceName</webservice-description-name>
<webservice-type>JAXWS</webservice-type>
<port-component>
<!-- This must match the name given in webservices.xml -->
<port-component-name>MyServicePort</port-component-name>
<service-endpoint-address>
<webservice-contextpath>/myContextPath</webservice-contextpath>
<webservice-serviceuri>/myServiceURI</webservice-serviceuri>
</service-endpoint-address>
</port-component>
</webservice-description>
</weblogic-webservices>