Aquí hay un ejemplo de cómo puedes hacer una llamada SOAP a un endpoint arbitrario en Java, usando la librería javax.xml.soap:

import java.net.URL;
import javax.xml.soap.*;

public class SoapCallExample {
    public static void main(String args[]) throws Exception {
        // Define the endpoint URL
        URL endpoint = new URL("http://example.com/soap-endpoint");

        // Create a SOAP connection
        SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection soapConnection = soapConnectionFactory.createConnection();

        // Crear un mensaje SOAP
        MessageFactory messageFactory = MessageFactory.newInstance();
        SOAPMessage soapMessage = messageFactory.createMessage();

        // Agregar el header SOAP
        SOAPHeader header = soapMessage.getSOAPHeader();
        header.detachNode();

        // Agregar el cuerpo SOAP
        SOAPBody body = soapMessage.getSOAPBody();
        SOAPElement bodyElement = body.addChildElement("getRandomNumber", "example");
        bodyElement.addChildElement("min").addTextNode("1");
        bodyElement.addChildElement("max").addTextNode("100");

        // Enviar el mensaje SOAP al endpoint
        SOAPMessage response = soapConnection.call(soapMessage, endpoint);

        // Extraer la respuesta
        SOAPBody responseBody = response.getSOAPBody();
        SOAPElement responseElement = (SOAPElement) responseBody.getChildElements().next();
        int randomNumber = Integer.parseInt(responseElement.getValue());

        // Imprimir la respuesta
        System.out.println("The random number is: " + randomNumber);

        // Cerrar la conexión
        soapConnection.close();
    }
}
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence