Search in sources :

Example 6 with JavaMethodImpl

use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.

the class DatabindingImpl method initStubHandlers.

// Refactored from SEIStub
private void initStubHandlers() {
    stubHandlers = new HashMap<>();
    Map<ActionBasedOperationSignature, JavaMethodImpl> syncs = new HashMap<>();
    // first fill in sychronized versions
    for (JavaMethodImpl m : seiModel.getJavaMethods()) {
        if (!m.getMEP().isAsync) {
            StubHandler handler = new StubHandler(m, packetFactory);
            syncs.put(m.getOperationSignature(), m);
            stubHandlers.put(m.getMethod(), handler);
        }
    }
    for (JavaMethodImpl jm : seiModel.getJavaMethods()) {
        JavaMethodImpl sync = syncs.get(jm.getOperationSignature());
        if (jm.getMEP() == MEP.ASYNC_CALLBACK || jm.getMEP() == MEP.ASYNC_POLL) {
            Method m = jm.getMethod();
            StubAsyncHandler handler = new StubAsyncHandler(jm, sync, packetFactory);
            stubHandlers.put(m, handler);
        }
    }
}
Also used : JavaMethodImpl(com.sun.xml.ws.model.JavaMethodImpl) HashMap(java.util.HashMap) StubAsyncHandler(com.sun.xml.ws.client.sei.StubAsyncHandler) StubHandler(com.sun.xml.ws.client.sei.StubHandler) Method(java.lang.reflect.Method) ActionBasedOperationSignature(com.sun.xml.ws.wsdl.ActionBasedOperationSignature)

Example 7 with JavaMethodImpl

use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.

the class SEIStub method initMethodHandlers.

private void initMethodHandlers() {
    Map<WSDLBoundOperation, JavaMethodImpl> syncs = new HashMap<>();
    // first fill in sychronized versions
    for (JavaMethodImpl m : seiModel.getJavaMethods()) {
        if (!m.getMEP().isAsync) {
            SyncMethodHandler handler = new SyncMethodHandler(this, m);
            syncs.put(m.getOperation(), m);
            methodHandlers.put(m.getMethod(), handler);
        }
    }
    for (JavaMethodImpl jm : seiModel.getJavaMethods()) {
        JavaMethodImpl sync = syncs.get(jm.getOperation());
        if (jm.getMEP() == MEP.ASYNC_CALLBACK) {
            Method m = jm.getMethod();
            CallbackMethodHandler handler = new CallbackMethodHandler(this, m, m.getParameterTypes().length - 1);
            methodHandlers.put(m, handler);
        }
        if (jm.getMEP() == MEP.ASYNC_POLL) {
            Method m = jm.getMethod();
            PollingMethodHandler handler = new PollingMethodHandler(this, m);
            methodHandlers.put(m, handler);
        }
    }
}
Also used : JavaMethodImpl(com.sun.xml.ws.model.JavaMethodImpl) WSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation) HashMap(java.util.HashMap) Method(java.lang.reflect.Method)

Example 8 with JavaMethodImpl

use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.

the class WSDLGenerator method generateBinding.

/**
 * Generates the Binding section of the WSDL
 */
protected void generateBinding() {
    Binding newBinding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart());
    extension.addBindingExtension(newBinding);
    newBinding.type(model.getPortTypeName());
    boolean first = true;
    for (JavaMethodImpl method : model.getJavaMethods()) {
        if (first) {
            SOAPBinding sBinding = method.getBinding();
            SOAPVersion soapVersion = sBinding.getSOAPVersion();
            if (soapVersion == SOAPVersion.SOAP_12) {
                com.sun.xml.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = newBinding.soap12Binding();
                soapBinding.transport(this.binding.getBindingId().getTransport());
                if (sBinding.getStyle().equals(Style.DOCUMENT))
                    soapBinding.style(DOCUMENT);
                else
                    soapBinding.style(RPC);
            } else {
                com.sun.xml.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = newBinding.soapBinding();
                soapBinding.transport(this.binding.getBindingId().getTransport());
                if (sBinding.getStyle().equals(Style.DOCUMENT))
                    soapBinding.style(DOCUMENT);
                else
                    soapBinding.style(RPC);
            }
            first = false;
        }
        if (this.binding.getBindingId().getSOAPVersion() == SOAPVersion.SOAP_12)
            generateSOAP12BindingOperation(method, newBinding);
        else
            generateBindingOperation(method, newBinding);
    }
}
Also used : SOAPBinding(com.sun.xml.ws.api.model.soap.SOAPBinding) ParameterBinding(com.sun.xml.ws.api.model.ParameterBinding) WSBinding(com.sun.xml.ws.api.WSBinding) Binding(com.sun.xml.ws.wsdl.writer.document.Binding) JavaMethodImpl(com.sun.xml.ws.model.JavaMethodImpl) SOAPVersion(com.sun.xml.ws.api.SOAPVersion) SOAPBinding(com.sun.xml.ws.api.model.soap.SOAPBinding)

Aggregations

JavaMethodImpl (com.sun.xml.ws.model.JavaMethodImpl)8 WSDLOperationMapping (com.sun.xml.ws.api.model.WSDLOperationMapping)2 WSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation)2 CheckedExceptionImpl (com.sun.xml.ws.model.CheckedExceptionImpl)2 Method (java.lang.reflect.Method)2 HashMap (java.util.HashMap)2 JavaCallInfo (com.oracle.webservices.api.databinding.JavaCallInfo)1 SOAPVersion (com.sun.xml.ws.api.SOAPVersion)1 WSBinding (com.sun.xml.ws.api.WSBinding)1 JavaMethod (com.sun.xml.ws.api.model.JavaMethod)1 ParameterBinding (com.sun.xml.ws.api.model.ParameterBinding)1 SOAPBinding (com.sun.xml.ws.api.model.soap.SOAPBinding)1 StubAsyncHandler (com.sun.xml.ws.client.sei.StubAsyncHandler)1 StubHandler (com.sun.xml.ws.client.sei.StubHandler)1 ParameterImpl (com.sun.xml.ws.model.ParameterImpl)1 WrapperParameter (com.sun.xml.ws.model.WrapperParameter)1 TieHandler (com.sun.xml.ws.server.sei.TieHandler)1 ActionBasedOperationSignature (com.sun.xml.ws.wsdl.ActionBasedOperationSignature)1 DispatchException (com.sun.xml.ws.wsdl.DispatchException)1 Binding (com.sun.xml.ws.wsdl.writer.document.Binding)1