<commit_before>/*
 * $Log: IbisWebServiceSender.java,v $
 * Revision 1.4  2007-05-29 11:07:33  europe\L190409
 * implementation of HasPhysicalDestination
 *
 * Revision 1.3  2004/08/31 15:51:15  <NAME> <<EMAIL>>
 * added ToDo
 *
 * Revision 1.2  2004/08/09 13:55:31  <NAME> <<EMAIL>>
 * changed ServiceListenerName to ServiceName
 *
 * Revision 1.1  2004/07/15 07:40:43  <NAME> <<EMAIL>>
 * introduction of http package
 *
 * Revision 1.1  2004/06/01 13:53:22  <NAME> <<EMAIL>>
 * eerste versie
 *
 */
package nl.nn.adapterframework.http;

import java.net.MalformedURLException;
import java.net.URL;

import org.apache.soap.SOAPException;

import nl.nn.adapterframework.configuration.ConfigurationException;
import nl.nn.adapterframework.core.HasPhysicalDestination;
import nl.nn.adapterframework.core.ISender;
import nl.nn.adapterframework.core.SenderException;
import nl.nn.adapterframework.core.TimeOutException;
import nl.nn.adapterframework.receivers.ServiceDispatcher_ServiceProxy;
import nl.nn.adapterframework.util.AppConstants;

/**
 * Posts a message to another IBIS-adapter as a WebService.
 *
 * <p><b>Configuration:</b>
 * <table border="1">
 * <tr><th>attributes</th><th>description</th><th>default</th></tr>
 * <tr><td>classname</td><td>nl.nn.adapterframework.http.IbisWebServiceSender</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setName(String) name}</td>  <td>name of the sender</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setIbisHost(String) ibisHost}</td><td>name (or ipaddress) and optinally port of the host where the ibis to be called is running</td><td>localhost</td></tr>
 * <tr><td>{@link #setIbisInstance(String) ibisInstance}</td><td>name of the ibis instance to be called</td><td>name of the current instance</td></tr>
 * <tr><td>{@link #setServiceName(String) serviceName}</td><td>Name of the receiver that should be called</td><td>"serviceListener"</td></tr>
 * </table>
 * </p>
 *
 * @author <NAME>
 * @since 4.2
 */
public class IbisWebServiceSender implements ISender, HasPhysicalDestination {
	public static final String version = "$Id: IbisWebServiceSender.java,v 1.4 2007-05-29 11:07:33 europe\L190409 Exp $";

	private String name;
	private String ibisHost = "localhost";
	private String ibisInstance = null;
	private String serviceName = "serviceListener";
	private ServiceDispatcher_ServiceProxy proxy;
	
	public void configure() throws ConfigurationException {
		if (ibisInstance==null) {
			ibisInstance=AppConstants.getInstance().getResolvedProperty("instance.name");
		}
		try {
			proxy = new ServiceDispatcher_ServiceProxy();
			proxy.setEndPoint(new URL(getEndPoint()));
		} catch (MalformedURLException e) {
			throw new ConfigurationException("IbisWebServiceSender cannot find URL from ["+getEndPoint()+"]", e);
		}
	}

	public void open() throws SenderException {
	}

	public void close() throws SenderException {
	}

	public boolean isSynchronous() {
		return true;
	}

	public String sendMessage(String correlationID, String message)
		throws SenderException, TimeOutException {<commit_msg>corrected version string<commit_after>/*
 * $Log: IbisWebServiceSender.java,v $
 * Revision 1.5  2007-05-29 11:08:14  europe\L190409
 * corrected version string
 *
 * Revision 1.4  2007/05/29 11:07:33  <NAME> <<EMAIL>>
 * implementation of HasPhysicalDestination
 *
 * Revision 1.3  2004/08/31 15:51:15  <NAME> <<EMAIL>>
 * added ToDo
 *
 * Revision 1.2  2004/08/09 13:55:31  <NAME> <<EMAIL>>
 * changed ServiceListenerName to ServiceName
 *
 * Revision 1.1  2004/07/15 07:40:43  <NAME> <<EMAIL>>
 * introduction of http package
 *
 * Revision 1.1  2004/06/01 13:53:22  <NAME> <<EMAIL>>
 * eerste versie
 *
 */
package nl.nn.adapterframework.http;

import java.net.MalformedURLException;
import java.net.URL;

import org.apache.soap.SOAPException;

import nl.nn.adapterframework.configuration.ConfigurationException;
import nl.nn.adapterframework.core.HasPhysicalDestination;
import nl.nn.adapterframework.core.ISender;
import nl.nn.adapterframework.core.SenderException;
import nl.nn.adapterframework.core.TimeOutException;
import nl.nn.adapterframework.receivers.ServiceDispatcher_ServiceProxy;
import nl.nn.adapterframework.util.AppConstants;

/**
 * Posts a message to another IBIS-adapter as a WebService.
 *
 * <p><b>Configuration:</b>
 * <table border="1">
 * <tr><th>attributes</th><th>description</th><th>default</th></tr>
 * <tr><td>classname</td><td>nl.nn.adapterframework.http.IbisWebServiceSender</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setName(String) name}</td>  <td>name of the sender</td><td>&nbsp;</td></tr>
 * <tr><td>{@link #setIbisHost(String) ibisHost}</td><td>name (or ipaddress) and optinally port of the host where the ibis to be called is running</td><td>localhost</td></tr>
 * <tr><td>{@link #setIbisInstance(String) ibisInstance}</td><td>name of the ibis instance to be called</td><td>name of the current instance</td></tr>
 * <tr><td>{@link #setServiceName(String) serviceName}</td><td>Name of the receiver that should be called</td><td>"serviceListener"</td></tr>
 * </table>
 * </p>
 *
 * @author <NAME>
 * @since 4.2
 */
public class IbisWebServiceSender implements ISender, HasPhysicalDestination {
	public static final String version="$RCSfile: IbisWebServiceSender.java,v $ $Revision: 1.5 $ $Date: 2007-05-29 11:08:14 $";

	private String name;
	private String ibisHost = "localhost";
	private String ibisInstance = null;
	private String serviceName = "serviceListener";
	private ServiceDispatcher_ServiceProxy proxy;
	
	public void configure() throws ConfigurationException {
		if (ibisInstance==null) {
			ibisInstance=AppConstants.getInstance().getResolvedProperty("instance.name");
		}
		try {
			proxy = new ServiceDispatcher_ServiceProxy();
			proxy.setEndPoint(new URL(getEndPoint()));
		} catch (MalformedURLException e) {
			throw new ConfigurationException("IbisWebServiceSender cannot find URL from ["+getEndPoint()+"]", e);
		}
	}

	public void open() throws SenderException {
	}

	public void close() throws SenderException {
	}

	public boolean isSynchronous() {
		return true;
	}

	public String sendMessage(String correlationID, String message)
		throws SenderException, TimeOutException {
{'fraction_non_alphanumeric': 0.1417946645109135, 'fraction_numerical': 0.03751010509296686, 'mean_word_length': 5.312244897959184, 'pattern_counts': {'":': 0, '<': 140, '<?xml version=': 0, '>': 140, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4626525', 'n_tokens_mistral': 2166, 'n_tokens_neox': 1986, 'n_words': 462}