Java Code Examples for com.sun.xml.internal.ws.api.model.wsdl.WSDLPort

The following are top voted examples for showing how to use com.sun.xml.internal.ws.api.model.wsdl.WSDLPort. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openjdk-jdk10   File: WSEndpointImpl.java   Source Code and License 7 votes vote down vote up
@Override
public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                final Packet      responsePacket,
                                                final SOAPVersion soapVersion,
                                                final WSDLPort    wsdlPort,
                                                final SEIModel    seiModel,
                                                final WSBinding   binding)
{
    // This will happen in addressing if it is enabled.
    if (tc.isFaultCreated()) return responsePacket;

    final Message faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, tc.getThrowable());
    final Packet result = responsePacket.createServerResponse(faultMessage, wsdlPort, seiModel, binding);
    // Pass info to upper layers
    tc.setFaultMessage(faultMessage);
    tc.setResponsePacket(responsePacket);
    tc.setFaultCreated(true);
    return result;
}
 
Example 2
Project: OpenJSharp   File: WSEndpointImpl.java   Source Code and License 7 votes vote down vote up
@Override
public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                final Packet      responsePacket,
                                                final SOAPVersion soapVersion,
                                                final WSDLPort    wsdlPort,
                                                final SEIModel    seiModel,
                                                final WSBinding   binding)
{
    // This will happen in addressing if it is enabled.
    if (tc.isFaultCreated()) return responsePacket;

    final Message faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, tc.getThrowable());
    final Packet result = responsePacket.createServerResponse(faultMessage, wsdlPort, seiModel, binding);
    // Pass info to upper layers
    tc.setFaultMessage(faultMessage);
    tc.setResponsePacket(responsePacket);
    tc.setFaultCreated(true);
    return result;
}
 
Example 3
Project: OpenJSharp   File: Packet.java   Source Code and License 6 votes vote down vote up
private void populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) {
    AddressingVersion addressingVersion = binding.getAddressingVersion();

    if (addressingVersion == null) {
        return;
    }

    WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, seiModel, binding);
    String action = responsePacket.getMessage().isFault() ?
            wsaHelper.getFaultAction(this, responsePacket) :
            wsaHelper.getOutputAction(this);
    if (action == null) {
        LOGGER.info("WSA headers are not added as value for wsa:Action cannot be resolved for this message");
        return;
    }
    populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action, AddressingVersion.isRequired(binding));
}
 
Example 4
Project: openjdk-jdk10   File: WSServiceDelegate.java   Source Code and License 6 votes vote down vote up
public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
    if (portName == null || portInterface == null)
        throw new IllegalArgumentException();
    WSDLService tWsdlService = this.wsdlService;
    if (tWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if (tWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }

    }
    WSDLPort portModel = getPortModel(tWsdlService, portName);
    return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features));
}
 
Example 5
Project: openjdk-jdk10   File: SOAPProviderArgumentBuilder.java   Source Code and License 6 votes vote down vote up
@Override
protected Packet getResponse(Packet request, @Nullable SOAPMessage returnValue, WSDLPort port, WSBinding binding) {
    Packet response = super.getResponse(request, returnValue, port, binding);
    // Populate SOAPMessage's transport headers
    if (returnValue != null && response.supports(Packet.OUTBOUND_TRANSPORT_HEADERS)) {
        MimeHeaders hdrs = returnValue.getMimeHeaders();
        Map<String, List<String>> headers = new HashMap<String, List<String>>();
        Iterator i = hdrs.getAllHeaders();
        while(i.hasNext()) {
            MimeHeader header = (MimeHeader)i.next();
            if(header.getName().equalsIgnoreCase("SOAPAction"))
                // SAAJ sets this header automatically, but it interferes with the correct operation of JAX-WS.
                // so ignore this header.
                continue;

            List<String> list = headers.get(header.getName());
            if (list == null) {
                list = new ArrayList<String>();
                headers.put(header.getName(), list);
            }
            list.add(header.getValue());
        }
        response.put(Packet.OUTBOUND_TRANSPORT_HEADERS, headers);
    }
    return response;
}
 
Example 6
Project: openjdk-jdk10   File: WSServiceDelegate.java   Source Code and License 6 votes vote down vote up
public SEIModel buildRuntimeModel(QName serviceName, QName portName, Class portInterface, WSDLPort wsdlPort, WebServiceFeatureList features) {
            DatabindingFactory fac = DatabindingFactory.newInstance();
            DatabindingConfig config = new DatabindingConfig();
            config.setContractClass(portInterface);
            config.getMappingInfo().setServiceName(serviceName);
            config.setWsdlPort(wsdlPort);
            config.setFeatures(features);
            config.setClassLoader(portInterface.getClassLoader());
            config.getMappingInfo().setPortName(portName);
            config.setWsdlURL(wsdlURL);
    // if ExternalMetadataFeature present, ExternalMetadataReader will be created ...
    config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader()));

            com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config);

            return rt.getModel();
}
 
Example 7
Project: OpenJSharp   File: SOAPProviderArgumentBuilder.java   Source Code and License 6 votes vote down vote up
@Override
protected Packet getResponse(Packet request, @Nullable SOAPMessage returnValue, WSDLPort port, WSBinding binding) {
    Packet response = super.getResponse(request, returnValue, port, binding);
    // Populate SOAPMessage's transport headers
    if (returnValue != null && response.supports(Packet.OUTBOUND_TRANSPORT_HEADERS)) {
        MimeHeaders hdrs = returnValue.getMimeHeaders();
        Map<String, List<String>> headers = new HashMap<String, List<String>>();
        Iterator i = hdrs.getAllHeaders();
        while(i.hasNext()) {
            MimeHeader header = (MimeHeader)i.next();
            if(header.getName().equalsIgnoreCase("SOAPAction"))
                // SAAJ sets this header automatically, but it interferes with the correct operation of JAX-WS.
                // so ignore this header.
                continue;

            List<String> list = headers.get(header.getName());
            if (list == null) {
                list = new ArrayList<String>();
                headers.put(header.getName(), list);
            }
            list.add(header.getValue());
        }
        response.put(Packet.OUTBOUND_TRANSPORT_HEADERS, headers);
    }
    return response;
}
 
Example 8
Project: openjdk-jdk10   File: WSServiceDelegate.java   Source Code and License 6 votes vote down vote up
@Override
public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
    //get the portType from SEI
    QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader()));
    WSDLService tmpWsdlService = this.wsdlService;
    if (tmpWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tmpWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if(tmpWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }
    }
    //get the first port corresponding to the SEI
    WSDLPort port = tmpWsdlService.getMatchingPort(portTypeName);
    if (port == null) {
        throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
    }
    QName portName = port.getName();
    return getPort(portName, portInterface,features);
}
 
Example 9
Project: OpenJSharp   File: Packet.java   Source Code and License 5 votes vote down vote up
public Packet relateServerResponse(@Nullable Packet r, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding) {
    relatePackets(r, false);
    r.setState(State.ServerResponse);
    AddressingVersion av = binding.getAddressingVersion();
    // populate WS-A headers only if WS-A is enabled
    if (av == null) {
        return r;
    }

    if (getMessage() == null) {
        return r;
    }

    //populate WS-A headers only if the request has addressing headers
    String inputAction = AddressingUtils.getAction(getMessage().getHeaders(), av, binding.getSOAPVersion());
    if (inputAction == null) {
        return r;
    }
    // if one-way, then dont populate any WS-A headers
    if (r.getMessage() == null || (wsdlPort != null && getMessage().isOneWay(wsdlPort))) {
        return r;
    }

    // otherwise populate WS-Addressing headers
    populateAddressingHeaders(binding, r, wsdlPort, seiModel);
    return r;
}
 
Example 10
Project: openjdk-jdk10   File: PolicyWSDLGeneratorExtension.java   Source Code and License 5 votes vote down vote up
@Override
public void addPortExtension(final TypedXmlWriter port) {
    LOGGER.entering();
    final String portName = (null == seiModel) ? null : seiModel.getPortName().getLocalPart();
    selectAndProcessSubject(port, WSDLPort.class, ScopeType.ENDPOINT, portName);
    LOGGER.exiting();
}
 
Example 11
Project: openjdk-jdk10   File: ClientSchemaValidationTube.java   Source Code and License 5 votes vote down vote up
public ClientSchemaValidationTube(WSBinding binding, WSDLPort port, Tube next) {
    super(binding, next);
    this.port = port;
    if (port != null) {
        String primaryWsdl = port.getOwner().getParent().getLocation().getSystemId();
        MetadataResolverImpl mdresolver = new MetadataResolverImpl();
        Map<String, SDDocument> docs = MetadataUtil.getMetadataClosure(primaryWsdl, mdresolver, true);
        mdresolver = new MetadataResolverImpl(docs.values());
        Source[] sources = getSchemaSources(docs.values(), mdresolver);
        for(Source source : sources) {
            LOGGER.fine("Constructing client validation schema from = "+source.getSystemId());
            //printDOM((DOMSource)source);
        }
        if (sources.length != 0) {
            noValidation = false;
            sf.setResourceResolver(mdresolver);
            try {
                schema = sf.newSchema(sources);
            } catch(SAXException e) {
                throw new WebServiceException(e);
            }
            validator = schema.newValidator();
            return;
        }
    }
    noValidation = true;
    schema = null;
    validator = null;
}
 
Example 12
Project: openjdk-jdk10   File: ProviderArgumentsBuilder.java   Source Code and License 5 votes vote down vote up
/**
 * Creates {@link Packet} from method invocation's return value
 */
protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) {
    Message message = null;
    if (returnValue != null) {
        message = getResponseMessage(returnValue);
    }
    Packet response = request.createServerResponse(message,port,null,binding);
    return response;
}
 
Example 13
Project: OpenJSharp   File: ServerTubeAssemblerContext.java   Source Code and License 5 votes vote down vote up
public ServerTubeAssemblerContext(@Nullable SEIModel seiModel,
                                  @Nullable WSDLPort wsdlModel, @NotNull WSEndpoint endpoint,
                                  @NotNull Tube terminal, boolean isSynchronous) {
    this.seiModel = seiModel;
    this.wsdlModel = wsdlModel;
    this.endpoint = endpoint;
    this.terminal = terminal;
    // WSBinding is actually BindingImpl
    this.binding = (BindingImpl)endpoint.getBinding();
    this.isSynchronous = isSynchronous;
    this.codec = this.binding.createCodec();
}
 
Example 14
Project: openjdk-jdk10   File: ClientSOAPHandlerTube.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a new instance of SOAPHandlerTube
 */
public ClientSOAPHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
    super(next, port, binding);
    if (binding.getSOAPVersion() != null) {
        // SOAPHandlerTube should n't be used for bindings other than SOAP.
        // TODO: throw Exception
    }
}
 
Example 15
Project: OpenJSharp   File: ClientTubeAssemblerContext.java   Source Code and License 5 votes vote down vote up
/**
 * This constructor should be used only by JAX-WS Runtime and is not meant for external consumption.
 *
 * @since JAX-WS 2.2
 */
public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel,
                                  @NotNull WSBindingProvider bindingProvider, @NotNull WSBinding binding,
                                  @NotNull Container container, Codec codec, SEIModel seiModel, Class sei) {
    this(address, wsdlModel, (bindingProvider==null? null: bindingProvider.getPortInfo().getOwner()), bindingProvider, binding, container, codec, seiModel, sei);

}
 
Example 16
Project: OpenJSharp   File: WSEndpoint.java   Source Code and License 5 votes vote down vote up
/**
 * This is used by WsaServerTube and WSEndpointImpl to create a Packet with SOAPFault message from a Java exception.
 */
public abstract Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                         final Packet      responsePacket,
                                                         final SOAPVersion soapVersion,
                                                         final WSDLPort    wsdlPort,
                                                         final SEIModel    seiModel,
                                                         final WSBinding   binding);
 
Example 17
Project: OpenJSharp   File: WsaTube.java   Source Code and License 5 votes vote down vote up
public WsaTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
    super(next);
    this.wsdlPort = wsdlPort;
    this.binding = binding;
    addKnownHeadersToBinding(binding);
    addressingVersion = binding.getAddressingVersion();
    soapVersion = binding.getSOAPVersion();
    helper = getTubeHelper();
    addressingRequired = AddressingVersion.isRequired(binding);
}
 
Example 18
Project: OpenJSharp   File: WsaTubeHelper.java   Source Code and License 5 votes vote down vote up
public WsaTubeHelper(WSBinding binding, SEIModel seiModel, WSDLPort wsdlPort) {
    this.binding = binding;
    this.wsdlPort = wsdlPort;
    this.seiModel = seiModel;
    this.soapVer = binding.getSOAPVersion();
    this.addVer = binding.getAddressingVersion();

}
 
Example 19
Project: OpenJSharp   File: PolicyWSDLGeneratorExtension.java   Source Code and License 5 votes vote down vote up
@Override
public void addPortExtension(final TypedXmlWriter port) {
    LOGGER.entering();
    final String portName = (null == seiModel) ? null : seiModel.getPortName().getLocalPart();
    selectAndProcessSubject(port, WSDLPort.class, ScopeType.ENDPOINT, portName);
    LOGGER.exiting();
}
 
Example 20
Project: OpenJSharp   File: PolicyUtil.java   Source Code and License 5 votes vote down vote up
/**
 * Iterates through the ports in the WSDL model, for each policy in the policy
 * map that is attached at endpoint scope computes a list of corresponding
 * WebServiceFeatures and sets them on the port.
 *
 * @param model The WSDL model
 * @param policyMap The policy map
 * @throws PolicyException If the list of WebServiceFeatures could not be computed
 */
public static void configureModel(final WSDLModel model, PolicyMap policyMap) throws PolicyException {
    LOGGER.entering(model, policyMap);
    for (WSDLService service : model.getServices().values()) {
        for (WSDLPort port : service.getPorts()) {
            final Collection<WebServiceFeature> features = getPortScopedFeatures(policyMap, service.getName(), port.getName());
            for (WebServiceFeature feature : features) {
                port.addFeature(feature);
                port.getBinding().addFeature(feature);
            }
        }
    }
    LOGGER.exiting();
}
 
Example 21
Project: openjdk-jdk10   File: PortInfo.java   Source Code and License 5 votes vote down vote up
public PortInfo(@NotNull WSServiceDelegate owner, @NotNull WSDLPort port) {
    this.owner = owner;
    this.targetEndpoint = port.getAddress();
    this.portName = port.getName();
    this.bindingId = port.getBinding().getBindingId();
    this.portModel = port;
    this.policyMap = createPolicyMap();
}
 
Example 22
Project: OpenJSharp   File: ServerSOAPHandlerTube.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a new instance of SOAPHandlerTube
 */
public ServerSOAPHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
    super(next, port, binding);
    if (binding.getSOAPVersion() != null) {
        // SOAPHandlerTube should n't be used for bindings other than SOAP.
        // TODO: throw Exception
    }
    setUpHandlersOnce();
}
 
Example 23
Project: openjdk-jdk10   File: OperationDispatcher.java   Source Code and License 5 votes vote down vote up
public OperationDispatcher(@NotNull WSDLPort wsdlModel, @NotNull WSBinding binding, @Nullable SEIModel seiModel) {
    this.binding = binding;
    opFinders = new ArrayList<WSDLOperationFinder>();
    if (binding.getAddressingVersion() != null) {
        opFinders.add(new ActionBasedOperationFinder(wsdlModel, binding, seiModel));
    }
    opFinders.add(new PayloadQNameBasedOperationFinder(wsdlModel, binding, seiModel));
    opFinders.add(new SOAPActionBasedOperationFinder(wsdlModel, binding, seiModel));

}
 
Example 24
Project: openjdk-jdk10   File: WSServiceDelegate.java   Source Code and License 5 votes vote down vote up
/**
 * Lists up the port names in WSDL. For error diagnostics.
 */
private StringBuilder buildWsdlPortNames() {
    Set<QName> wsdlPortNames = new HashSet<QName>();
    for (WSDLPort port : wsdlService.getPorts()) {
        wsdlPortNames.add(port.getName());
    }
    return buildNameList(wsdlPortNames);
}
 
Example 25
Project: OpenJSharp   File: PortInfo.java   Source Code and License 5 votes vote down vote up
public PortInfo(@NotNull WSServiceDelegate owner, @NotNull WSDLPort port) {
    this.owner = owner;
    this.targetEndpoint = port.getAddress();
    this.portName = port.getName();
    this.bindingId = port.getBinding().getBindingId();
    this.portModel = port;
    this.policyMap = createPolicyMap();
}
 
Example 26
Project: OpenJSharp   File: PortInfo.java   Source Code and License 5 votes vote down vote up
private WSDLPort getPortModel(WSServiceDelegate owner, QName portName) {

        if (owner.getWsdlService() != null){
            Iterable<? extends WSDLPort> ports = owner.getWsdlService().getPorts();
            for (WSDLPort port : ports){
                if (port.getName().equals(portName))
                    return port;
            }
        }
        return null;
    }
 
Example 27
Project: openjdk-jdk10   File: HttpAdapterList.java   Source Code and License 5 votes vote down vote up
@Override
public T createAdapter(String name, String urlPattern, WSEndpoint<?> endpoint) {
    T t = createHttpAdapter(name, urlPattern, endpoint);
    adapters.add(t);
    WSDLPort port = endpoint.getPort();
    if (port != null) {
        PortInfo portInfo = new PortInfo(port.getOwner().getName(),port.getName().getLocalPart(), endpoint.getImplementationClass());
        addressMap.put(portInfo, getValidPath(urlPattern));
    }
    return t;
}
 
Example 28
Project: openjdk-jdk10   File: PolicyUtil.java   Source Code and License 5 votes vote down vote up
/**
 * Iterates through the ports in the WSDL model, for each policy in the policy
 * map that is attached at endpoint scope computes a list of corresponding
 * WebServiceFeatures and sets them on the port.
 *
 * @param model The WSDL model
 * @param policyMap The policy map
 * @throws PolicyException If the list of WebServiceFeatures could not be computed
 */
public static void configureModel(final WSDLModel model, PolicyMap policyMap) throws PolicyException {
    LOGGER.entering(model, policyMap);
    for (WSDLService service : model.getServices().values()) {
        for (WSDLPort port : service.getPorts()) {
            final Collection<WebServiceFeature> features = getPortScopedFeatures(policyMap, service.getName(), port.getName());
            for (WebServiceFeature feature : features) {
                port.addFeature(feature);
                port.getBinding().addFeature(feature);
            }
        }
    }
    LOGGER.exiting();
}
 
Example 29
Project: OpenJSharp   File: WSServiceDelegate.java   Source Code and License 5 votes vote down vote up
/**
 * Lists up the port names in WSDL. For error diagnostics.
 */
private StringBuilder buildWsdlPortNames() {
    Set<QName> wsdlPortNames = new HashSet<QName>();
    for (WSDLPort port : wsdlService.getPorts()) {
        wsdlPortNames.add(port.getName());
    }
    return buildNameList(wsdlPortNames);
}
 
Example 30
Project: OpenJSharp   File: ClientSchemaValidationTube.java   Source Code and License 5 votes vote down vote up
public ClientSchemaValidationTube(WSBinding binding, WSDLPort port, Tube next) {
    super(binding, next);
    this.port = port;
    if (port != null) {
        String primaryWsdl = port.getOwner().getParent().getLocation().getSystemId();
        MetadataResolverImpl mdresolver = new MetadataResolverImpl();
        Map<String, SDDocument> docs = MetadataUtil.getMetadataClosure(primaryWsdl, mdresolver, true);
        mdresolver = new MetadataResolverImpl(docs.values());
        Source[] sources = getSchemaSources(docs.values(), mdresolver);
        for(Source source : sources) {
            LOGGER.fine("Constructing client validation schema from = "+source.getSystemId());
            //printDOM((DOMSource)source);
        }
        if (sources.length != 0) {
            noValidation = false;
            sf.setResourceResolver(mdresolver);
            try {
                schema = sf.newSchema(sources);
            } catch(SAXException e) {
                throw new WebServiceException(e);
            }
            validator = schema.newValidator();
            return;
        }
    }
    noValidation = true;
    schema = null;
    validator = null;
}
 
Example 31
Project: OpenJSharp   File: HttpAdapterList.java   Source Code and License 5 votes vote down vote up
@Override
public T createAdapter(String name, String urlPattern, WSEndpoint<?> endpoint) {
    T t = createHttpAdapter(name, urlPattern, endpoint);
    adapters.add(t);
    WSDLPort port = endpoint.getPort();
    if (port != null) {
        PortInfo portInfo = new PortInfo(port.getOwner().getName(),port.getName().getLocalPart(), endpoint.getImplementationClass());
        addressMap.put(portInfo, getValidPath(urlPattern));
    }
    return t;
}
 
Example 32
Project: OpenJSharp   File: WSEndpointMOMProxy.java   Source Code and License 5 votes vote down vote up
@Override
public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                final Packet      responsePacket,
                                                final SOAPVersion soapVersion,
                                                final WSDLPort    wsdlPort,
                                                final SEIModel    seiModel,
                                                final WSBinding   binding)
{
    return wsEndpoint.createServiceResponseForException(tc, responsePacket, soapVersion,
                                                        wsdlPort, seiModel, binding);
}
 
Example 33
Project: openjdk-jdk10   File: WSEndpointImpl.java   Source Code and License 5 votes vote down vote up
protected WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding, Container container,
                      SEIModel seiModel, WSDLPort port,
                      Tube masterTubeline) {
              this.serviceName = serviceName;
              this.portName = portName;
              this.binding = binding;
              this.soapVersion = binding.getSOAPVersion();
              this.container = container;
              this.endpointPolicy = null;
              this.port = port;
              this.seiModel = seiModel;
              this.serviceDef = null;
              this.implementationClass = null;
              this.masterTubeline = masterTubeline;
              this.masterCodec = ((BindingImpl) this.binding).createCodec();

      LazyMOMProvider.INSTANCE.registerEndpoint(this);
      initManagedObjectManager();

      this.operationDispatcher = (port == null) ? null : new OperationDispatcher(port, binding, seiModel);
          this.context = new ServerPipeAssemblerContext(
              seiModel, port, this, null /* not known */, false);

              tubePool = new TubePool(masterTubeline);
              engine = new Engine(toString(), container);
              wsdlProperties = (port == null) ? new WSDLDirectProperties(serviceName, portName, seiModel) : new WSDLPortProperties(port, seiModel);
}
 
Example 34
Project: openjdk-jdk10   File: DatabindingImpl.java   Source Code and License 5 votes vote down vote up
public DatabindingImpl(DatabindingProviderImpl p, DatabindingConfig config) {
        RuntimeModeler modeler = new RuntimeModeler(config);
        modeler.setClassLoader(config.getClassLoader());
        seiModel = modeler.buildRuntimeModel();
        WSDLPort wsdlport = config.getWsdlPort();
        Object facProp = config.properties().get("com.sun.xml.internal.ws.api.message.MessageContextFactory");
        packetFactory = (facProp != null && facProp instanceof MessageContextFactory)? (MessageContextFactory)facProp :
                        new MessageContextFactory(seiModel.getWSBinding().getFeatures());
        clientConfig = isClientConfig(config);
        if (clientConfig) {
            initStubHandlers();
        }
        seiModel.setDatabinding(this);
        if (wsdlport != null) {
            freeze(wsdlport);
        }
        if (operationDispatcher == null) {
            operationDispatcherNoWsdl = new OperationDispatcher(null, seiModel.getWSBinding(), seiModel);
        }
//    if(!clientConfig) {
        for (JavaMethodImpl jm : seiModel.getJavaMethods()) {
            if (!jm.isAsync()) {
                TieHandler th = new TieHandler(jm, seiModel.getWSBinding(), packetFactory);
                wsdlOpMap.put(jm, th);
                tieHandlers.put(th.getMethod(), th);
            }
        }
//    }
    }
 
Example 35
Project: OpenJSharp   File: WSEndpointImpl.java   Source Code and License 5 votes vote down vote up
protected WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding, Container container,
                      SEIModel seiModel, WSDLPort port,
                      Tube masterTubeline) {
              this.serviceName = serviceName;
              this.portName = portName;
              this.binding = binding;
              this.soapVersion = binding.getSOAPVersion();
              this.container = container;
              this.endpointPolicy = null;
              this.port = port;
              this.seiModel = seiModel;
              this.serviceDef = null;
              this.implementationClass = null;
              this.masterTubeline = masterTubeline;
              this.masterCodec = ((BindingImpl) this.binding).createCodec();

      LazyMOMProvider.INSTANCE.registerEndpoint(this);
      initManagedObjectManager();

      this.operationDispatcher = (port == null) ? null : new OperationDispatcher(port, binding, seiModel);
          this.context = new ServerPipeAssemblerContext(
              seiModel, port, this, null /* not known */, false);

              tubePool = new TubePool(masterTubeline);
              engine = new Engine(toString(), container);
              wsdlProperties = (port == null) ? new WSDLDirectProperties(serviceName, portName, seiModel) : new WSDLPortProperties(port, seiModel);
}
 
Example 36
Project: openjdk-jdk10   File: XMLProviderArgumentBuilder.java   Source Code and License 5 votes vote down vote up
@Override
protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) {
    Packet response = super.getResponse(request, e, port, binding);
    if (e instanceof HTTPException) {
        if (response.supports(MessageContext.HTTP_RESPONSE_CODE)) {
            response.put(MessageContext.HTTP_RESPONSE_CODE, ((HTTPException)e).getStatusCode());
        }
    }
    return response;
}
 
Example 37
Project: OpenJSharp   File: ProviderArgumentsBuilder.java   Source Code and License 5 votes vote down vote up
/**
 * Creates {@link Packet} from method invocation's return value
 */
protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) {
    Message message = null;
    if (returnValue != null) {
        message = getResponseMessage(returnValue);
    }
    Packet response = request.createServerResponse(message,port,null,binding);
    return response;
}
 
Example 38
Project: openjdk-jdk10   File: WSEndpointMOMProxy.java   Source Code and License 5 votes vote down vote up
@Override
public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                final Packet      responsePacket,
                                                final SOAPVersion soapVersion,
                                                final WSDLPort    wsdlPort,
                                                final SEIModel    seiModel,
                                                final WSBinding   binding)
{
    return wsEndpoint.createServiceResponseForException(tc, responsePacket, soapVersion,
                                                        wsdlPort, seiModel, binding);
}
 
Example 39
Project: openjdk-jdk10   File: DatabindingImpl.java   Source Code and License 5 votes vote down vote up
public void freeze(WSDLPort port) {
    if (clientConfig) {
        return;
    }
    synchronized(this) {
        if (operationDispatcher == null) {
            operationDispatcher = (port == null) ? null : new OperationDispatcher(port, seiModel.getWSBinding(), seiModel);
        }
    }
}
 
Example 40
Project: OpenJSharp   File: OperationDispatcher.java   Source Code and License 5 votes vote down vote up
public OperationDispatcher(@NotNull WSDLPort wsdlModel, @NotNull WSBinding binding, @Nullable SEIModel seiModel) {
    this.binding = binding;
    opFinders = new ArrayList<WSDLOperationFinder>();
    if (binding.getAddressingVersion() != null) {
        opFinders.add(new ActionBasedOperationFinder(wsdlModel, binding, seiModel));
    }
    opFinders.add(new PayloadQNameBasedOperationFinder(wsdlModel, binding, seiModel));
    opFinders.add(new SOAPActionBasedOperationFinder(wsdlModel, binding, seiModel));

}