com.sun.xml.internal.ws.resources.ServerMessages Java Examples

The following examples show how to use com.sun.xml.internal.ws.resources.ServerMessages. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OperationDispatcher.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #2
Source File: AbstractInstanceResolver.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
Example #3
Source File: AbstractInstanceResolver.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
Example #4
Source File: PayloadQNameBasedOperationFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #5
Source File: OperationDispatcher.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #6
Source File: AbstractInstanceResolver.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
Example #7
Source File: OperationDispatcher.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #8
Source File: OperationDispatcher.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #9
Source File: PayloadQNameBasedOperationFinder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #10
Source File: PayloadQNameBasedOperationFinder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #11
Source File: AbstractInstanceResolver.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
Example #12
Source File: OperationDispatcher.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #13
Source File: PayloadQNameBasedOperationFinder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #14
Source File: PayloadQNameBasedOperationFinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #15
Source File: OperationDispatcher.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #16
Source File: AbstractInstanceResolver.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
Example #17
Source File: AbstractInstanceResolver.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
Example #18
Source File: OperationDispatcher.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #19
Source File: DeploymentDescriptorParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Loads the class of the given name.
 *
 * @param xsr Used to report the source location information if there's any error.
 */
private Class getImplementorClass(String name, XMLStreamReader xsr) {
    try {
        return Class.forName(name, true, classLoader);
    } catch (ClassNotFoundException e) {
        logger.log(Level.SEVERE, e.getMessage(), e);
        throw new LocatableWebServiceException(
                ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr);
    }
}
 
Example #20
Source File: SOAPProviderArgumentBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static ProviderArgumentsBuilder create(ProviderEndpointModel model, SOAPVersion soapVersion) {
    if (model.mode == Service.Mode.PAYLOAD) {
        return new PayloadSource(soapVersion);
    } else {
        if(model.datatype==Source.class)
            return new MessageSource(soapVersion);
        if(model.datatype==SOAPMessage.class)
            return new SOAPMessageParameter(soapVersion);
        if(model.datatype==Message.class)
            return new MessageProviderArgumentBuilder(soapVersion);
        throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
    }
}
 
Example #21
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #22
Source File: EndpointFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #23
Source File: ResponseBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private SOAPFaultException createDuplicateHeaderException() {
    try {
        SOAPFault fault = soapVersion.getSOAPFactory().createFault();
        fault.setFaultCode(soapVersion.faultCodeServer);
        fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
        return new SOAPFaultException(fault);
    } catch(SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
Example #24
Source File: XMLProviderArgumentBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static XMLProviderArgumentBuilder createBuilder(ProviderEndpointModel model, WSBinding binding) {
    if (model.mode == Service.Mode.PAYLOAD) {
        return new PayloadSource();
    } else {
        if(model.datatype==Source.class)
            return new PayloadSource();
        if(model.datatype== DataSource.class)
            return new DataSourceParameter(binding);
        throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
    }
}
 
Example #25
Source File: HttpEndpoint.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void publish(Object serverContext) {
    if (serverContext instanceof javax.xml.ws.spi.http.HttpContext) {
        setHandler((javax.xml.ws.spi.http.HttpContext)serverContext);
        return;
    }
    if (serverContext instanceof HttpContext) {
        this.httpContext = (HttpContext)serverContext;
        setHandler(httpContext);
        return;
    }
    throw new ServerRtException(ServerMessages.NOT_KNOW_HTTP_CONTEXT_TYPE(
            serverContext.getClass(), HttpContext.class,
            javax.xml.ws.spi.http.HttpContext.class));
}
 
Example #26
Source File: ResponseBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private SOAPFaultException createDuplicateHeaderException() {
    try {
        SOAPFault fault = soapVersion.getSOAPFactory().createFault();
        fault.setFaultCode(soapVersion.faultCodeServer);
        fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
        return new SOAPFaultException(fault);
    } catch(SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
Example #27
Source File: ResponseBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private SOAPFaultException createDuplicateHeaderException() {
    try {
        SOAPFault fault = soapVersion.getSOAPFactory().createFault();
        fault.setFaultCode(soapVersion.faultCodeServer);
        fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
        return new SOAPFaultException(fault);
    } catch(SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
Example #28
Source File: EndpointFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #29
Source File: HttpEndpoint.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void publish(Object serverContext) {
    if (serverContext instanceof javax.xml.ws.spi.http.HttpContext) {
        setHandler((javax.xml.ws.spi.http.HttpContext)serverContext);
        return;
    }
    if (serverContext instanceof HttpContext) {
        this.httpContext = (HttpContext)serverContext;
        setHandler(httpContext);
        return;
    }
    throw new ServerRtException(ServerMessages.NOT_KNOW_HTTP_CONTEXT_TYPE(
            serverContext.getClass(), HttpContext.class,
            javax.xml.ws.spi.http.HttpContext.class));
}
 
Example #30
Source File: EndpointArgumentsBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private SOAPFaultException createDuplicateHeaderException() {
    try {
        SOAPFault fault = soapVersion.getSOAPFactory().createFault();
        fault.setFaultCode(soapVersion.faultCodeClient);
        fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
        return new SOAPFaultException(fault);
    } catch(SOAPException e) {
        throw new WebServiceException(e);
    }
}