use of ihe.iti.xds_b._2007.DocumentRepositoryService in project nhin-d by DirectProject.
the class DocumentRepositoryProxy method initProxy.
private void initProxy() {
try {
URL url = DocumentRepositoryProxy.class.getClassLoader().getResource("XDS.b_DocumentRepositoryWSDLSynchMTOM.wsdl");
QName qname = new QName("urn:ihe:iti:xds-b:2007", "DocumentRepository_Service");
DocumentRepositoryService service = new DocumentRepositoryService(url, qname);
if (handlerResolver != null)
service.setHandlerResolver(handlerResolver);
proxy = service.getDocumentRepositoryPortSoap12(new MTOMFeature(true, 1));
BindingProvider bp = (BindingProvider) proxy;
SOAPBinding binding = (SOAPBinding) bp.getBinding();
binding.setMTOMEnabled(true);
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
} catch (Exception e) {
LOGGER.error("Error initializing proxy.", e);
}
}
use of ihe.iti.xds_b._2007.DocumentRepositoryService in project nhin-d by DirectProject.
the class DocumentRepositoryUtils method getDocumentRepositoryPortType.
/**
* Construct a DocumentRepositoryPortType object using the provided
* endpoint.
*
* @param endpoint
* The XDR endpoint.
* @param wsdlPath
* The path to the WSDL.
* @return a DocumentRepositoryPortType object.
* @throws Exception
*/
public static DocumentRepositoryPortType getDocumentRepositoryPortType(String endpoint, URL wsdlPath) throws Exception {
QName qname = new QName("urn:ihe:iti:xds-b:2007", "DocumentRepository_Service");
DocumentRepositoryService service = new DocumentRepositoryService(wsdlPath, qname);
service.setHandlerResolver(new RepositoryHandlerResolver());
DocumentRepositoryPortType port = service.getDocumentRepositoryPortSoap12(new MTOMFeature(true, 1));
BindingProvider bp = (BindingProvider) port;
SOAPBinding binding = (SOAPBinding) bp.getBinding();
binding.setMTOMEnabled(true);
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
return port;
}
Aggregations