# javax.xml.ws.spi

***

**1. Create a Custom Endpoint Impl w/ META-INF/services**

```java
// META-INF/services/javax.xml.ws.Endpoint
com.example.MyEndpointImpl
```

**2. Create a Custom Endpoint Factory via Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**3. Create a Custom Endpoint Factory via Java API**

```java
Bus.setTransportFactory(httpt, new HttpTransportFactory() {
  @Override
  public Endpoint createEndpoint(URL url, String bindingId, BindingProvider adapter) {
    // Customize endpoint creation
  }
});
```

**4. Create a Custom Binding Factory via Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      java.xml.ws.BindingProvider$Factory
    </env-entry-name>
    <env-entry-type>java.xml.ws.BindingProvider$Factory</env-entry-type>
    <env-entry-value>com.example.MyBindingProviderFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**5. Create a Custom Binding Factory via Java API**

```java
Bus.setExtension(new BindingProvider$Factory() {
  @Override
  public <T extends BindingProvider> T createBindingProvider(Binding binding,
                                                             MessageContext messageContext) {
    // Customize BindingProvider creation
  }
});
```

**6. Create a Custom Metro Service Delegate**

```java
public class MyServiceDelegate extends ServiceDelegate {

  public MyServiceDelegate(Bus bus) {
    super(bus);
  }

  @Override
  public void initialize(URL url) {
    // Customize service initialization
  }
}
```

**7. Define a Custom Endpoint Impl w/ @WebService**

```java
@WebService(endpointInterface = MyService.class)
public class MyServiceImpl implements MyService {
  // Implement service methods
}
```

**8. Define a Custom Binding Factory w/ @BindingType**

```java
@BindingType(soapBinding.class)
public class MyBindingFactory extends BindingFactory {
  // Override BindingFactory methods
}
```

**9. Define a Custom Endpoint Factory w/ @EndpointFactory**

```java
@EndpointFactory
public static abstract class MyEndpointFactory extends EndpointFactory {
  // Override EndpointFactory methods
}
```

**10. Define a Custom Port Info w/ @PortInfo**

```java
@PortInfo(interfaceName = MyService.class, bindingName = "MyServiceBinding")
public interface MyServicePort {
  // Extend port interface
}
```

**11. Create a Custom SOAP Handler**

```java
public class MySoapHandler implements SoapHandler<SoapMessageContext> {

  @Override
  public boolean handleMessage(SoapMessageContext messageContext) {
    // Handle SOAP message
    return true;
  }
}
```

**12. Define a Custom Hand Chain Processor**

```java
public class MyHandlerChainProcessor extends HandlerChainProcessor {

  @Override
  public List<Handler> getHandlerChain(PortEndpoint endpoint, EndpointContext context) {
    // Customize SOAP handler chain
    return new ArrayList<>();
  }
}
```

**13. Define a Custom Transport Binding**

```java
public class MyTransportBinding extends Binding {

  @Override
  public <T extends Message> Response<T> invoke(Request<T> request) {
    // Invoke SOAP request
    return null;
  }
}
```

**14. Define a Custom NameSpace Mapper**

```java
public class MyNamespaceMapper implements NamespaceMapper {

  @Override
  public Map<String, String> getNamespaceToPrefixMap() {
    // Customize namespace prefix mapping
    return null;
  }
}
```

**15. Define a Custom SOAP Fault Mapper**

```java
public class MySoapFaultMapper implements SoapFaultMapper {

  @Override
  public SOAPFault map(Throwable throwable) {
    // Customize SOAP fault mapping
    return null;
  }
}
```

**16. Define a Custom Operation Formatter**

```java
public class MyOperationFormatter implements OperationFormatter {

  @Override
  public Operation formatOperation(WrapperInfo wrapped) {
    // Customize operation formatter
    return null;
  }
}
```

**17. Define a Custom MTOM Attachment Provider**

```java
public class MyMtomAttachmentProvider implements MtomAttachmentProvider {

  @Override
  public AttachmentPart getAttachment(MessageContext context) {
    // Provide custom MTOM attachment
    return null;
  }
}
```

**18. Define a Custom Bundle File Mapper**

```java
public class MyBundleFileMapper implements BundleFileMapper {

  @Override
  public URL map(Bundle.Entry entry) {
    // Customize bundle file mapping
    return null;
  }
}
```

**19. Define a Custom ServletContext Listener**

```java
public class MyServletContextListener implements ServletContextListener {

  @Override
  public void contextInitialized(ServletContextEvent event) {
    // Initialize Web service context
  }
}
```

**20. Define a Custom Handler Fault Interceptor**

```java
public class MyHandlerFaultInterceptor implements HandlerFaultInterceptor {

  @Override
  public void handleFault(SoapHandler<SoapMessageContext> handler, SoapMessageContext messageContext) {
    // Handle handler fault
  }
}
```

**21. Define a Custom Transport**

```java
public class MyTransport implements Transport {

  @Override
  public Message[] getMessages(Endpoint endpoint) {
    // Get transport messages
    return null;
  }
}
```

**22. Define a Custom Message Factory**

```java
public class MyMessageFactory implements MessageFactory {

  @Override
  public Message createMessage() {
    // Create custom message
    return null;
  }
}
```

**23. Define a Custom WSDLElement**

```xml
<wsdl:operation name="myOperation">
  <wsdl:input>
    <wsdl:message name="myInput" wsaw:Action="myAction">
      <wsdl:part name="param" type="xsd:string"/>
    </wsdl:message>
  </wsdl:input>
</wsdl:operation>
```

**24. Use a Custom Introspector**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**25. Define a Custom WSDL Port**

```xml
<wsdl:port name="myPort" binding="tns:myBinding">
  <wsdl:address location="http://example.com/myService"/>
</wsdl:port>
```

**26. Use a Custom Endpoint Impl w/ Static Method**

```java
public static class MyEndpointImpl implements MyService {

  @Override
  public String myMethod() {
    return "Hello World!";
  }
}
```

**27. Define a Custom WSDL Service**

```xml
<wsdl:service name="myService">
  <wsdl:port name="myPort" binding="tns:myBinding">
    <wsdl:address location="http://example.com/myService"/>
  </wsdl:port>
</wsdl:service>
```

**28. Use a Custom SOAP Message Handler**

```xml
<handler-chains>
  <handler-chain>
    <handler>com.example.MySoapHandler</handler>
  </handler-chain>
</handler-chains>
```

**29. Define a Custom WSDL Binding**

```xml
<wsdl:binding name="myBinding" type="tns:myService">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
</wsdl:binding>
```

**30. Use a Custom Port Info w/ @WebServiceClient**

```java
@WebServiceClient(name = "MyService", targetNamespace = "http://example.com/myService")
public class MyServiceClient {
  // Implement service client methods
}
```

**31. Define a Custom WSDL Message**

```xml
<wsdl:message name="myMessage">
  <wsdl:part name="param" type="xsd:string"/>
</wsdl:message>
```

**32. Use a Custom Hand Chain Processor w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**33. Define a Custom SOAP Header**

```xml
<soapenv:Header>
  <myHeader xmlns="http://example.com/myHeader">
    <myField>Hello World!</myField>
  </myHeader>
</soapenv:Header>
```

**34. Use a Custom WSDL Operation**

```xml
<wsdl:operation name="myOperation">
  <wsdl:input>
    <wsdl:message name="myInput"/>
  </wsdl:input>
</wsdl:operation>
```

**35. Define a Custom WSDL Port Type**

```xml
<wsdl:portType name="myPortType">
  <wsdl:operation name="myOperation">
    <wsdl:input message="tns:myInput"/>
  </wsdl:operation>
</wsdl:portType>
```

**36. Use a Custom Namespace Mapper w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**37. Define a Custom WSDL XML Schema**

```xml
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="myElement" type="xsd:string"/>
</xsd:schema>
```

**38. Use a Custom SOAP Fault Mapper w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**39. Define a Custom MTOM Attachment Provider w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**40. Use a Custom Operation Formatter w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**41. Define a Custom Bundle File Mapper w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**42. Use a Custom ServletContext Listener w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**43. Define a Custom Handler Fault Interceptor w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**44. Use a Custom Transport w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**45. Define a Custom Message Factory w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**46. Use a Custom WSDLElement w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**47. Define a Custom Introspector w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**48. Use a Custom WSDL Port w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**49. Define a Custom WSDL Service w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>
```

**50. Use a Custom SOAP Message Handler w/ Descriptor**

```xml
<jndiEntry>
  <env-entry>
    <env-entry-name>
      com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory
    </env-entry-name>
    <env-entry-type>com.sun.xml.internal.ws.transport.http.HttpAdapter$Factory</env-entry-type>
    <env-entry-value>com.example.MyHttpAdapterFactory</env-entry-value>
  </env-entry>
</jndiEntry>

```
