/** * <p> * Constructor that creates the {@link Dispatch} for use. * </p> * <p> * If you need to customize the ws properties, it is suggested to preconstruct a {@link Dispatch} * object and use the default no-arg constructor followed by a {@linkplain #setDispatch(Dispatch)} call * </p> * @param config */ public STSClient(STSClientConfig config) { QName service = new QName(targetNS, config.getServiceName()); QName portName = new QName(targetNS, config.getPortName()); isBatch = config.isBatch(); wsaIssuerAddress = config.getWsaIssuer(); wspAppliesTo = config.getWspAppliesTo(); Service jaxwsService = Service.create(service); jaxwsService.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, config.getEndPointAddress()); Dispatch<Source> dispatch = jaxwsService.createDispatch(portName, Source.class, Mode.PAYLOAD); Map<String, Object> reqContext = dispatch.getRequestContext(); String username = config.getUsername(); if (username != null) { // add the username and password to the request context. reqContext.put(BindingProvider.USERNAME_PROPERTY, config.getUsername()); reqContext.put(BindingProvider.PASSWORD_PROPERTY, config.getPassword()); } setDispatch(dispatch); }
/** * <p> * Constructor that creates the {@link Dispatch} for use. * </p> * <p> * If you need to customize the ws properties, it is suggested to preconstruct a {@link Dispatch} * object and use the default no-arg constructor followed by a {@linkplain #setDispatch(Dispatch)} call * </p> * @param config */ public STSClient(STSClientConfig config) { QName service = new QName(targetNS, config.getServiceName()); QName portName = new QName(targetNS, config.getPortName()); isBatch = config.isBatch(); wsaIssuerAddress = config.getWsaIssuer(); wspAppliesTo = config.getWspAppliesTo(); Service jaxwsService = Service.create(service); jaxwsService.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, config.getEndPointAddress()); Dispatch<Source> dispatch = jaxwsService.createDispatch(portName, Source.class, Mode.PAYLOAD); Map<String, Object> reqContext = dispatch.getRequestContext(); String username = config.getUsername(); if (username != null) { // add the username and password to the request context. reqContext.put(BindingProvider.USERNAME_PROPERTY, config.getUsername()); reqContext.put(BindingProvider.PASSWORD_PROPERTY, config.getPassword()); } setDispatch(dispatch); }
wspAppliesTo = config.getWspAppliesTo();
wspAppliesTo = config.getWspAppliesTo();
wspAppliesTo = config.getWspAppliesTo();