public static XCAIRespondingGatewayPortType getXCAIRespondingGatewayPortSoap12(String endpointAddress) { XCAIRespondingGatewayPortType port = getXCAIRespondingGatewayPortSoap12(); configurePort((BindingProvider)port, endpointAddress, false, true, true); return port; }
public static ImagingDocumentSourcePortType getImagingDocumentSourcePort(String endpointAddress, String logDir) { ImagingDocumentSourcePortType port = getImagingDocumentSourcePort(); configurePort((BindingProvider)port, endpointAddress, true, true, logDir); return port; } }
public static DocumentRepositoryPortType getDocumentRepositoryPortSoap12(String endpointAddress, String logDir) { DocumentRepositoryPortType port = getDocumentRepositoryPortSoap12(); configurePort((BindingProvider)port, endpointAddress, true, true, logDir); return port; }
public static Map<String, SlotType1> addOrOverwriteSlot(RegistryObjectType ro, String slotName, String... val) throws JAXBException { Map<String, SlotType1> slots = getSlotsFromRegistryObject(ro); addOrOverwriteSlot(ro, slots, slotName, val); return slots; } /*
public static DocumentRegistryPortType getDocumentRegistryPortSoap12(String endpointAddress, String logDir) { DocumentRegistryPortType port = getDocumentRegistryPortSoap12(); configurePort((BindingProvider)port, endpointAddress, false, true, logDir); return port; }
public static RespondingGatewayPortType getRespondingGatewayPortSoap12(String endpointAddress) { RespondingGatewayPortType port = getRespondingGatewayPortSoap12(); configurePort((BindingProvider)port, endpointAddress, false, true, true); return port; }
/** * Configures the port with the default handlers, endpoint and mtom.<br/> * <br/> * <b>ATTENTION:</b> If <i>mtom</i> is enabled, you need to provide a handler that forces MTOM * to be done manually. There is a bug in the JDK classes which prevents MTOM and handlers to * work at the same time. For more information about this issue, see <a * href="https://java.net/jira/browse/WSIT-1320">this link</a>. * * @param bindingProvider the current binding provider * @param endpointAddress the target address * @param mtom enables mtom * @param mustUnderstand sets the must understand flag in certain headers, see {@link EnsureMustUnderstandHandler} * @param addLogHandler add the log handler using default directory <JBOSS_LOG_DIR>/xdslog/sentMessages */ public static void configurePort(BindingProvider bindingProvider, String endpointAddress, boolean mtom, boolean mustUnderstand, boolean addLogHandler) { SOAPBinding binding = (SOAPBinding) bindingProvider.getBinding(); binding.setMTOMEnabled(mtom); if (mustUnderstand) { addHandler(bindingProvider, new EnsureMustUnderstandHandler()); } if (addLogHandler) { addHandler(bindingProvider, new SentSOAPLogHandler()); } Map<String, Object> reqCtx = bindingProvider.getRequestContext(); reqCtx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress); }
private RegistryResponseType dispatchSubmitObjectsRequest(SubmitObjectsRequest submitRequest, URL xdsRegistryURI) throws MalformedURLException, JAXBException, XDSException { DocumentRegistryPortType port = DocumentRegistryPortTypeFactory.getDocumentRegistryPortSoap12(xdsRegistryURI.toString()); log.info("####################################################"); log.info("####################################################"); log.info("XDS.b: Send register document-b request to registry:"+xdsRegistryURI); log.info("####################################################"); log.info("####################################################"); log.info("org.jboss.security.ignoreHttpsHost:"+System.getProperty("org.jboss.security.ignoreHttpsHost")); RegistryResponseType rsp = null; try { rsp = port.documentRegistryRegisterDocumentSetB(submitRequest); } catch ( Exception x) { throw new XDSException( XDSException.XDS_ERR_REG_NOT_AVAIL, "Document Registry not available: "+xdsRegistryURI, x); } return rsp; }
private String getSourceID(ProvideAndRegisterDocumentSetRequestType req) { List<JAXBElement<? extends IdentifiableType>> objs = req.getSubmitObjectsRequest().getRegistryObjectList().getIdentifiable(); IdentifiableType obj; for (int i = 0, len = objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { return InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSSubmissionSet_sourceId, (RegistryPackageType)obj); } } return null; }
@Override public boolean handleFault(SOAPMessageContext ctx) { log.warn("################ handleFault"); logMessage(ctx); return true; }
public static String marshallObject(Object o, boolean indent) throws JAXBException { StringWriter sw = new StringWriter(); Marshaller m = jaxbCtx().createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, indent); m.marshal(o, sw); return sw.toString(); }
public static XCAIRespondingGatewayPortType getXCAIRespondingGatewayPortSoap12(String endpointAddress, String logDir) { XCAIRespondingGatewayPortType port = getXCAIRespondingGatewayPortSoap12(); configurePort((BindingProvider)port, endpointAddress, false, true, logDir); return port; } }
public static ImagingDocumentSourcePortType getImagingDocumentSourcePort(String endpointAddress) { ImagingDocumentSourcePortType port = getImagingDocumentSourcePort(); configurePort((BindingProvider)port, endpointAddress, true, true, true); return port; }
public static DocumentRepositoryPortType getDocumentRepositoryPortSoap12(String endpointAddress) { DocumentRepositoryPortType port = getDocumentRepositoryPortSoap12(); configurePort((BindingProvider)port, endpointAddress, true, true, true); return port; }
public static String addOrCheckedOverwriteSlot(RegistryObjectType ro, Map<String, SlotType1> slots, String slotName, String val, boolean ignoreCase) throws JAXBException { if (slots == null) slots = getSlotsFromRegistryObject(ro); SlotType1 oldSlot = (SlotType1)slots.get(slotName); if (oldSlot != null) { List<String> values = oldSlot.getValueList().getValue(); if (values != null && values.size() > 0 && ! (ignoreCase ? val.equalsIgnoreCase(values.get(0)) : val.equals(values.get(0))) ) { return values.get(0); } } addOrOverwriteSlot(ro, slots, slotName, val); return null; } public static void addOrOverwriteSlot(RegistryObjectType ro, Map<String, SlotType1> slots, String slotName, String... val) throws JAXBException {
public static DocumentRegistryPortType getDocumentRegistryPortSoap12(String endpointAddress) { DocumentRegistryPortType port = getDocumentRegistryPortSoap12(); configurePort((BindingProvider)port, endpointAddress, false, true, true); return port; }
public static RespondingGatewayPortType getRespondingGatewayPortSoap12(String endpointAddress, String logDir) { RespondingGatewayPortType port = getRespondingGatewayPortSoap12(); configurePort((BindingProvider)port, endpointAddress, false, true, logDir); return port; } }
/** * Configures the port with the default handlers, endpoint and mtom.<br/> * <br/> * <b>ATTENTION:</b> If <i>mtom</i> is enabled, you need to provide a handler that forces MTOM * to be done manually. There is a bug in the JDK classes which prevents MTOM and handlers to * work at the same time. For more information about this issue, see <a * href="https://java.net/jira/browse/WSIT-1320">this link</a>. * * @param bindingProvider the current binding provider * @param endpointAddress the target address * @param mtom enables mtom * @param mustUnderstand sets the must understand flag in certain headers, see {@link EnsureMustUnderstandHandler} * @param logDir Directory where SOAP message are logged. use null to disable SOAP messsage logging. */ public static void configurePort(BindingProvider bindingProvider, String endpointAddress, boolean mtom, boolean mustUnderstand, String logDir) { SOAPBinding binding = (SOAPBinding) bindingProvider.getBinding(); binding.setMTOMEnabled(mtom); if (mustUnderstand) { addHandler(bindingProvider, new EnsureMustUnderstandHandler()); } if (logDir != null) { addHandler(bindingProvider, new SentSOAPLogHandler(logDir)); } Map<String, Object> reqCtx = bindingProvider.getRequestContext(); reqCtx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress); }
private String getSourceID(ProvideAndRegisterDocumentSetRequestType req) throws XDSException { List<JAXBElement<? extends IdentifiableType>> objs = req.getSubmitObjectsRequest().getRegistryObjectList().getIdentifiable(); IdentifiableType obj; for (int i = 0, len = objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { return InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSSubmissionSet_sourceId, (RegistryPackageType)obj); } } throw new XDSException(XDSException.XDS_ERR_REPOSITORY_METADATA_ERROR, "Missing XDSSubmissionSet.sourceId!", null); }
@Override public boolean handleMessage(SOAPMessageContext ctx) { log.debug("##########handleMessage LogHandler:"+ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)); logMessage(ctx); return true; }