Search in sources :

Example 1 with Axis2WSDLLocator

use of org.wso2.carbon.bpel.core.ode.integration.axis2.Axis2WSDLLocator in project carbon-business-process by wso2.

the class AxisServiceUtils method createAxisServiceBuilder.

private static WSDL11ToAxisServiceBuilder createAxisServiceBuilder(BPELProcessProxy processProxy) throws AxisFault {
    Definition wsdlDef = processProxy.getWsdlDefinition();
    QName serviceName = processProxy.getServiceName();
    String portName = processProxy.getPort();
    ProcessConf pConf = processProxy.getProcessConfiguration();
    QName pid = pConf.getProcessId();
    InputStream wsdlInStream = null;
    URI wsdlBaseURI = pConf.getBaseURI().resolve(wsdlDef.getDocumentBaseURI());
    try {
        wsdlInStream = wsdlBaseURI.toURL().openStream();
    } catch (MalformedURLException e) {
        String errMsg = "Malformed WSDL base URI.";
        handleException(pid, errMsg, e);
    } catch (IOException e) {
        String errMsg = "Error opening stream.";
        handleException(pid, errMsg, e);
    }
    WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisPatchedBuilder(wsdlInStream, serviceName, portName);
    serviceBuilder.setBaseUri(wsdlBaseURI.toString());
    serviceBuilder.setCustomResolver(new Axis2UriResolver());
    try {
        serviceBuilder.setCustomWSDLResolver(new Axis2WSDLLocator(wsdlBaseURI));
    } catch (URISyntaxException e) {
        String errorMessage = "URI syntax invalid.";
        handleException(pid, errorMessage, e);
    }
    serviceBuilder.setServerSide(true);
    return serviceBuilder;
}
Also used : Axis2UriResolver(org.wso2.carbon.bpel.core.ode.integration.axis2.Axis2UriResolver) MalformedURLException(java.net.MalformedURLException) QName(javax.xml.namespace.QName) InputStream(java.io.InputStream) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) Definition(javax.wsdl.Definition) IOException(java.io.IOException) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) WSDL11ToAxisServiceBuilder(org.apache.axis2.description.WSDL11ToAxisServiceBuilder) Axis2WSDLLocator(org.wso2.carbon.bpel.core.ode.integration.axis2.Axis2WSDLLocator)

Aggregations

IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 Definition (javax.wsdl.Definition)1 QName (javax.xml.namespace.QName)1 WSDL11ToAxisServiceBuilder (org.apache.axis2.description.WSDL11ToAxisServiceBuilder)1 ProcessConf (org.apache.ode.bpel.iapi.ProcessConf)1 Axis2UriResolver (org.wso2.carbon.bpel.core.ode.integration.axis2.Axis2UriResolver)1 Axis2WSDLLocator (org.wso2.carbon.bpel.core.ode.integration.axis2.Axis2WSDLLocator)1