cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yanmin Sheng <>
Subject Can anybody take a look at CXF-4836?
Date Mon, 11 Mar 2013 05:56:58 GMT
We create such client which will set target address info and binding
info in RequestContext of BindingProvider.

String mtom11URL = "http://localhost:9080//MyBusiness/MTOM11Service";

MTOMInterface port = null;
BindingProvider bp = null;

System.out.println("Looking up SOAP 1.1 MTOM service");

QName serviceName = new QName("","MTOM11Service");
QName portName = new QName("", "MTOM11Port");
// Setup the necessary JAX-WS artifacts
Service svc = Service.create(serviceName);
port = svc.getPort(portName, MTOMInterface.class);

// Set the target URL
bp = (BindingProvider) port;
Map<String, Object> requestCtx = bp.getRequestContext();

// Enable MTOM
SOAPBinding binding = (SOAPBinding) bp.getBinding();

However, it reports such error:

MTOM11Port not found.

I know that the added following code can fix this error:
svc.addPort(portName, SOAPBinding.SOAP11HTTP_MTOM_BINDING, mtom11URL);

Well, this error should not report even the addPort method is not called.
I know the added check in ServiceImpl is to avoid run time error and
report it as early as possible. But I think it is not needed. The
reasons are:
1. User can get run time error later;
2. User can set target addess info and bind info in other ways (as my
example shows)

I remove the check from the ServiceImpl then my client code works well.

View raw message