Example usage for javax.xml.namespace QName QName

List of usage examples for javax.xml.namespace QName QName

Introduction

In this page you can find the example usage for javax.xml.namespace QName QName.

Prototype

public QName(final String namespaceURI, final String localPart) 

Source Link

Document

QName constructor specifying the Namespace URI and local part.

If the Namespace URI is null, it is set to javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI .

Usage

From source file:in.gov.uidai.core.aua.client.OtpClient.java

private String generateSignedOtpXML(Otp otp) throws JAXBException, Exception {
    StringWriter otpXML = new StringWriter();

    JAXBElement element = new JAXBElement(new QName("http://www.uidai.gov.in/auth/otp/1.6", "Otp"), Otp.class,
            otp);//ww  w  .  jav  a 2  s .  c o  m

    JAXBContext.newInstance(Otp.class).createMarshaller().marshal(element, otpXML);
    boolean includeKeyInfo = true;

    if (System.getenv().get("SKIP_DIGITAL_SIGNATURE") != null) {
        return otpXML.toString();
    } else {
        System.out.println(otpXML);
        return this.digitalSignator.signXML(otpXML.toString(), includeKeyInfo);
    }
}

From source file:ch.astina.hesperid.agentbundle.Agent.java

private void initializeAgentFeedbackPort() throws MalformedURLException {
    logger.info("Initializing agent feedback port form service...");
    String wsdlLocation = xmlConfiguration.getString("hostBaseURL") + "/soap?wsdl";
    logger.info("Using wsdl location: " + wsdlLocation);

    AgentFeedbackService service = new AgentFeedbackService(new URL(wsdlLocation),
            new QName(GlobalConstants.WEBSERVICE_NAMESPACE, "AgentFeedbackService"));
    agentFeedbackPort = service.getAgentFeedbackPort();

    ((BindingProvider) agentFeedbackPort).getRequestContext().put("com.sun.xml.internal.ws.request.timeout",
            1000);/* w  w  w.ja  v a  2 s  . c o m*/
    ((BindingProvider) agentFeedbackPort).getRequestContext().put("com.sun.xml.internal.ws.connect.timeout",
            1000);

    ((BindingProvider) agentFeedbackPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
            xmlConfiguration.getString("hostBaseURL") + "/soap");

    //((BindingProvider) agentFeedbackPort).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, 1000);
    //((BindingProvider) agentFeedbackPort).getRequestContext().put(BindingProviderProperties.REQUEST_TIMEOUT, 1000);      
}

From source file:org.kuali.student.myplan.adviser.controller.AdviserController.java

public AcademicPlanService getAcademicPlanService() {
    if (academicPlanService == null) {
        academicPlanService = (AcademicPlanService) GlobalResourceLoader
                .getService(new QName(PlanConstants.NAMESPACE, PlanConstants.SERVICE_NAME));
    }/*w w  w. j a v  a2 s . c om*/
    return academicPlanService;
}

From source file:com.marklogic.client.test.KeyValueSearchTest.java

@Test(expected = FailedRequestException.class)
public void testKVSearchInadequateQName() throws IOException {
    QueryManager queryMgr = Common.client.newQueryManager();
    KeyValueQueryDefinition qdef = queryMgr.newKeyValueDefinition(null);

    qdef.put(/*from   ww w.  ja v  a2 s .c om*/
            queryMgr.newElementLocator(new QName("http://marklogic.com/test-namespace-with-no-prefix", "leaf")),
            "leaf3");
    @SuppressWarnings("unused")
    SearchHandle results = queryMgr.search(qdef, new SearchHandle());
    fail("Test should have thrown a Failed Request with bad prefix");
}

From source file:com.myrealtor.service.external.AxisRPCClient.java

@SuppressWarnings("unchecked")
public Apartment rent(String username, String aptNumber) throws Exception {
    log.debug("rent providerId: " + username + " - aptNumber: " + aptNumber);
    QName qName = new QName("http://service.apartment.com", "rent");

    Object[] opArgs = new Object[] { username, aptNumber };

    Class[] returnTypes = new Class[] { Apartment.class };

    Object[] response = serviceClient.invokeBlocking(qName, opArgs, returnTypes);

    Apartment apt = (Apartment) response[0];

    serviceClient.cleanup();//w  w  w. ja v a2  s. c o  m
    serviceClient.cleanupTransport();

    return apt;

}

From source file:edu.internet2.middleware.shibboleth.common.config.security.AbstractCredentialBeanDefinitionParser.java

/**
 * Parses the key names from the credential configuration.
 * //from   w w w.ja va 2s.c  o  m
 * @param configChildren children of the credential element
 * @param builder credential build
 */
protected void parseKeyNames(Map<QName, List<Element>> configChildren, BeanDefinitionBuilder builder) {
    log.debug("Parsing credential key names");
    List<Element> keyNameElems = configChildren.get(new QName(SecurityNamespaceHandler.NAMESPACE, "KeyName"));
    if (keyNameElems == null || keyNameElems.isEmpty()) {
        return;
    }

    String keyName;
    ArrayList<String> keyNames = new ArrayList<String>();
    for (Element keyNameElem : keyNameElems) {
        keyName = DatatypeHelper.safeTrimOrNullString(keyNameElem.getTextContent());
        if (keyName != null) {
            keyNames.add(keyName);
        }
    }

    builder.addPropertyValue("keyNames", keyNames);
}

From source file:org.deegree.securityproxy.wfs.responsefilter.capabilities.WfsCapabilitiesModificationManagerCreator.java

private AttributeModificationRule createGetRule() {
    LinkedList<ElementPathStep> path = createBasePath();
    path.add(new ElementPathStep(new QName("http://www.opengis.net/ows", "Get")));
    return new AttributeModificationRule(getDcpUrl, path);
}

From source file:org.javelin.sws.ext.bind.internal.model.AnalyzeSimpleTypesTest.java

@Test
public void analyzeXsDateTime() throws Exception {
    TypedPatternRegistry context = (TypedPatternRegistry) SweJaxbContextFactory.createContext("", null);
    TypedPattern<DateTime> pattern = context.determineAndCacheXmlPattern(DateTime.class);
    assertNotNull(pattern);//from  ww w.  j a v  a 2  s  . c  o m
    assertThat(pattern.getJavaType(), equalTo(DateTime.class));
    assertThat(pattern.getSchemaType(), equalTo(new QName(Constants.URI_2001_SCHEMA_XSD, "dateTime")));

    pattern.replayValue(
            new DateTime().withDate(2000, 1, 1).withTime(10, 20, 30, 40).withZone(DateTimeZone.forID("CET")),
            this.writer, null);
    assertThat(this.simpleResult(), equalTo("2000-01-01T10:20:30.040+01:00"));

    this.before();
    pattern.replayValue(
            new DateTime().withDate(2000, 1, 1).withTime(10, 20, 30, 0).withZone(DateTimeZone.forID("CET")),
            this.writer, null);
    assertThat(this.simpleResult(), equalTo("2000-01-01T10:20:30+01:00"));

    this.before();
    pattern.replayValue(
            new DateTime().withDate(2000, 1, 1).withTime(10, 20, 30, 433).withZone(DateTimeZone.UTC),
            this.writer, null);
    assertThat(this.simpleResult(), equalTo("2000-01-01T09:20:30.433Z"));

    this.before();
    pattern.replayValue(new DateTime().withDate(2000, 1, 1).withTime(10, 20, 30, 0).withZone(DateTimeZone.UTC),
            this.writer, null);
    assertThat(this.simpleResult(), equalTo("2000-01-01T09:20:30Z"));
}

From source file:com.xiongyingqi.util.xml.XMLEventStreamWriter.java

@Override
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
    writeStartElement(eventFactory.createStartElement(new QName(namespaceURI, localName), null, null));
}

From source file:edu.internet2.middleware.shibboleth.common.config.attribute.resolver.dataConnector.LdapDataConnectorBeanDefinitionParser.java

/** {@inheritDoc} */
protected void doParse(String pluginId, Element pluginConfig, Map<QName, List<Element>> pluginConfigChildren,
        BeanDefinitionBuilder pluginBuilder, ParserContext parserContext) {
    super.doParse(pluginId, pluginConfig, pluginConfigChildren, pluginBuilder, parserContext);

    processBasicConnectionConfig(pluginId, pluginConfig, pluginConfigChildren, pluginBuilder, parserContext);
    processSecurityConfig(pluginId, pluginConfig, pluginConfigChildren, pluginBuilder, parserContext);
    processResultHandlingConfig(pluginId, pluginConfig, pluginConfigChildren, pluginBuilder, parserContext);

    Map<String, String> ldapProperties = processLDAPProperties(
            pluginConfigChildren.get(new QName(DataConnectorNamespaceHandler.NAMESPACE, "LDAPProperty")));
    if (ldapProperties != null) {
        log.debug("Data connector {} LDAP properties: {}", pluginId, ldapProperties);
        pluginBuilder.addPropertyValue("ldapProperties", ldapProperties);
    }//from www  .  j a  v a  2  s . c  om

    processPoolingConfig(pluginId, pluginConfig, pluginConfigChildren, pluginBuilder, parserContext);

    processCacheConfig(pluginId, pluginConfig, pluginBuilder);
}