Java Code Examples for com.sun.xml.internal.ws.resources.DispatchMessages#INVALID_NULLARG_URI

The following examples show how to use com.sun.xml.internal.ws.resources.DispatchMessages#INVALID_NULLARG_URI . 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: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 2
Source File: DispatchImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 3
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 4
Source File: DispatchImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 5
Source File: DispatchImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 6
Source File: DispatchImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 7
Source File: DispatchImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}
 
Example 8
Source File: DispatchImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
void resolveEndpointAddress(@NotNull final Packet message, @NotNull final RequestContext requestContext) {
    final boolean p = message.packetTakesPriorityOverRequestContext;

    //resolve endpoint look for query parameters, pathInfo
    String endpoint;
    if (p && message.endpointAddress != null) {
        endpoint = message.endpointAddress.toString();
    } else {
        endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
    }
    // This is existing before packetTakesPriorityOverRequestContext so leaving in place.
    if (endpoint == null) {
        if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI());
        endpoint = message.endpointAddress.toString();
    }

    String pathInfo = null;
    String queryString = null;
    if (p && message.invocationProperties.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) message.invocationProperties.get(MessageContext.PATH_INFO);
    } else if (requestContext.get(MessageContext.PATH_INFO) != null) {
        pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
    }

    if (p && message.invocationProperties.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) message.invocationProperties.get(MessageContext.QUERY_STRING);
    } else if (requestContext.get(MessageContext.QUERY_STRING) != null) {
        queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
    }

    if (pathInfo != null || queryString != null) {
        pathInfo = checkPath(pathInfo);
        queryString = checkQuery(queryString);
        if (endpoint != null) {
            try {
                final URI endpointURI = new URI(endpoint);
                endpoint = resolveURI(endpointURI, pathInfo, queryString);
            } catch (URISyntaxException e) {
                throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
            }
        }
    }
    // These two lines used to be inside the above if.  It is outside so:
    // - in cases where there is no setting of address on a Packet before invocation or no pathInfo/queryString
    //   this will just put back what it found in the requestContext - basically a noop.
    // - but when info is in the Packet this will update so it will get used later.
    // Remember - we are operating on a copied RequestContext at this point - not the sticky one in the Stub.
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    // This is not necessary because a later step will copy the resolvedEndpoint put above into message.
    //message.endpointAddress = EndpointAddress.create(endpoint);
}