camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avonm <mauro.a...@insiel.it>
Subject Re: R: http proxy and mtom attachments
Date Mon, 07 Mar 2011 11:28:39 GMT
the client is as follows (and this kind of invocation works for calling other
non MTOM services through the proxy)


public final class RaggiPortType_RaggiPort_Client {

	private static final QName SERVICE_NAME = new QName(
			"http://it.insiel.raggi/", "raggiService");

	private RaggiPortType_RaggiPort_Client() {
	}

	public static void main(String args[]) throws Exception {

		RaggiService ss = new RaggiService();
		RaggiPortType port = ss.getRaggiPort();

		BindingProvider bp = (BindingProvider) port;
		SOAPBinding binding = (SOAPBinding) bp.getBinding();
		binding.setMTOMEnabled(true);

		String address = bp.getRequestContext()
				.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY).toString();

		address = "http://localhost:8765/jtrouter/";

		bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
				address);

		{
			System.out.println("Invoking inviaRadiografia...");
			java.lang.String _inviaRadiografia_codPaziente =
"_inviaRadiografia_codPaziente1400875";

			DataSource source = new FileDataSource(new File(
					"D:/dati_mauro/personale/sfondi/queensland-heaven.jpg"));
			DataHandler _inviaRadiografia_radiografia = new DataHandler(source);

			boolean _inviaRadiografia__return = port.inviaRadiografia(
					_inviaRadiografia_codPaziente,
					_inviaRadiografia_radiografia);
			System.out.println("inviaRadiografia.result="
					+ _inviaRadiografia__return);

		}

		System.exit(0);
	}

}


--
View this message in context: http://camel.465427.n5.nabble.com/http-proxy-and-mtom-attachments-tp3407911p3412261.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message