Created
January 5, 2012 20:04
-
-
Save stan229/1566965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ihe.iti.xds_b._2007; | |
import javax.jws.WebMethod; | |
import javax.jws.WebParam; | |
import javax.jws.WebResult; | |
import javax.jws.WebService; | |
import javax.jws.soap.SOAPBinding; | |
import javax.xml.ws.BindingType; | |
import javax.xml.ws.soap.MTOM; | |
import oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType; | |
@WebService(name = "DocumentRepository_PortType", targetNamespace = "urn:ihe:iti:xds-b:2007") | |
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING) | |
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) | |
public interface DocumentRepositoryPortType { | |
/** | |
* | |
* @param body | |
* @return | |
* returns oasis.names.tc.ebxml_regrep.xsd.rs._3.RegistryResponseType | |
*/ | |
@WebMethod(operationName = "DocumentRepository_ProvideAndRegisterDocumentSet-b", action = "urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b") | |
@WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0", partName = "body") | |
public RegistryResponseType documentRepositoryProvideAndRegisterDocumentSetB( | |
@WebParam(name = "ProvideAndRegisterDocumentSetRequest", targetNamespace = "urn:ihe:iti:xds-b:2007", partName = "body") | |
ProvideAndRegisterDocumentSetRequestType body); | |
/** | |
* | |
* @param body | |
* @return | |
* returns ihe.iti.xds_b._2007.RetrieveDocumentSetResponseType | |
*/ | |
@WebMethod(operationName = "DocumentRepository_RetrieveDocumentSet", action = "urn:ihe:iti:2007:RetrieveDocumentSet") | |
@WebResult(name = "RetrieveDocumentSetResponse", targetNamespace = "urn:ihe:iti:xds-b:2007", partName = "body") | |
public RetrieveDocumentSetResponseType documentRepositoryRetrieveDocumentSet( | |
@WebParam(name = "RetrieveDocumentSetRequest", targetNamespace = "urn:ihe:iti:xds-b:2007", partName = "body") | |
RetrieveDocumentSetRequestType body); | |
} | |
package ihe.iti.xds_b._2007; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import javax.xml.namespace.QName; | |
import javax.xml.ws.Service; | |
import javax.xml.ws.WebEndpoint; | |
import javax.xml.ws.WebServiceClient; | |
@WebServiceClient(name = "DocumentRepository_Service", targetNamespace = "urn:ihe:iti:xds-b:2007", wsdlLocation = "WEB-INF/wsdl/wsdl/XDS.b_DocumentRepository.wsdl") | |
public class DocumentRepositoryService | |
extends Service | |
{ | |
private final static URL DOCUMENTREPOSITORYSERVICE_WSDL_LOCATION; | |
static { | |
URL url = null; | |
try { | |
url = new URL("file:D:/IHE_BHIX_WAS8_Workspace/XDS_Glassfish/WebContent/WEB-INF/wsdl/wsdl/XDS.b_DocumentRepository.wsdl"); | |
} catch (MalformedURLException e) { | |
e.printStackTrace(); | |
} | |
DOCUMENTREPOSITORYSERVICE_WSDL_LOCATION = url; | |
} | |
public DocumentRepositoryService(URL wsdlLocation, QName serviceName) { | |
super(wsdlLocation, serviceName); | |
} | |
public DocumentRepositoryService() { | |
super(DOCUMENTREPOSITORYSERVICE_WSDL_LOCATION, new QName("urn:ihe:iti:xds-b:2007", "DocumentRepository_Service")); | |
} | |
/** | |
* | |
* @return | |
* returns DocumentRepositoryPortType | |
*/ | |
@WebEndpoint(name = "DocumentRepository_Port_Soap12") | |
public DocumentRepositoryPortType getDocumentRepositoryPortSoap12() { | |
return (DocumentRepositoryPortType)super.getPort(new QName("urn:ihe:iti:xds-b:2007", "DocumentRepository_Port_Soap12"), DocumentRepositoryPortType.class); | |
} | |
} | |
// CODE SNIPPETS: | |
DocumentRepositoryPortType port = (DocumentRepositoryPortType) request | |
.getSession().getServletContext().getAttribute("servicePort"); | |
if (port == null) { | |
port = new XDSServiceUtil().getDocumentRepositoryPort(); | |
request.getSession().getServletContext().setAttribute( | |
"servicePort", port); | |
} | |
BindingProvider bp = (BindingProvider) port; | |
SOAPBinding binding = (SOAPBinding) bp.getBinding(); | |
binding.setMTOMEnabled(true); | |
bp.getRequestContext().put(JAXWSProperties.MTOM_THRESHOLOD_VALUE, 5000); | |
System.out.println(binding.isMTOMEnabled()); | |
// In where I build the object: | |
def provideAndRegisterRequest = new ProvideAndRegisterDocumentSetRequestType() | |
def document = new ProvideAndRegisterDocumentSetRequestType.Document(value:pocXML.bytes,id:uuidExtrinsic) | |
provideAndRegisterRequest.document = [document]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code that actually does call:
def result = port.documentRepositoryProvideAndRegisterDocumentSetB(provideAndRegisterRequest)