javax.xml.namespace.QName Java Examples
The following examples show how to use
javax.xml.namespace.QName.
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: ElementInfoImpl.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
final QName parseElementName(XmlElementDecl e) { String local = e.name(); String nsUri = e.namespace(); if(nsUri.equals("##default")) { // if defaulted ... XmlSchema xs = reader().getPackageAnnotation(XmlSchema.class, nav().getDeclaringClassForMethod(method),this); if(xs!=null) nsUri = xs.namespace(); else { nsUri = builder.defaultNsUri; } } return new QName(nsUri.intern(),local.intern()); }
Example #2
Source File: RELAXNGCompiler.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void mapToClass(DElementPattern p) { NameClass nc = p.getName(); if(nc.isOpen()) return; // infinite name. can't map to a class. Set<QName> names = nc.listNames(); CClassInfo[] types = new CClassInfo[names.size()]; int i=0; for( QName n : names ) { // TODO: read class names from customization String name = model.getNameConverter().toClassName(n.getLocalPart()); bindQueue.put( types[i++] = new CClassInfo(model,pkg,name,p.getLocation(),null,n,null,null/*TODO*/), p.getChild() ); } classes.put(p,types); }
Example #3
Source File: WSDLOptionsSpecifiedSourceUrlTestCase.java From micro-integrator with Apache License 2.0 | 6 votes |
@Test(groups = "wso2.esb", description = "- Logging proxy" + "- Publish WSDL Options - Specified source url") public void testLoggingProxy() throws Exception { OMElement response = axis2Client .sendSimpleStockQuoteRequest(getProxyServiceURLHttp("wsdlOptionsFromSourceUrlLoggingProxy"), null, "WSO2"); String lastPrice = response.getFirstElement() .getFirstChildWithName(new QName("http://services.samples/xsd", "last")).getText(); assertNotNull(lastPrice, "Fault: response message 'last' price null"); String symbol = response.getFirstElement() .getFirstChildWithName(new QName("http://services.samples/xsd", "symbol")).getText(); assertEquals(symbol, "WSO2", "Fault: value 'symbol' mismatched"); }
Example #4
Source File: HttpAdapterList.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Creates a PortAddressResolver that maps portname to its address * * @param endpointImpl application endpoint Class that eventually serves the request. */ public PortAddressResolver createPortAddressResolver(final String baseAddress, final Class<?> endpointImpl) { return new PortAddressResolver() { @Override public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) { String urlPattern = addressMap.get(new PortInfo(serviceName,portName, endpointImpl)); if (urlPattern == null) { //if a WSDL defines more ports, urlpattern is null (portName does not match endpointImpl) //so fallback to the default behaviour where only serviceName/portName is checked for (Entry<PortInfo, String> e : addressMap.entrySet()) { if (serviceName.equals(e.getKey().serviceName) && portName.equals(e.getKey().portName)) { urlPattern = e.getValue(); break; } } } return (urlPattern == null) ? null : baseAddress+urlPattern; } }; }
Example #5
Source File: XmlAsserter.java From freehealth-connector with GNU Affero General Public License v3.0 | 6 votes |
private static String convert(Object obj) { try { Class clazz = obj.getClass(); if (!jaxbContextMap.containsKey(clazz)) { jaxbContextMap.put(clazz, JAXBContext.newInstance(clazz)); } JAXBContext context = (JAXBContext)jaxbContextMap.get(clazz); Marshaller marshaller = context.createMarshaller(); StringWriter writer = new StringWriter(); if (obj.getClass().isAnnotationPresent(XmlRootElement.class)) { marshaller.marshal(obj, (Writer)writer); } else if (obj.getClass().isAnnotationPresent(XmlType.class)) { JAXBElement jaxbElement = new JAXBElement(new QName("", obj.getClass().getSimpleName()), clazz, obj); marshaller.marshal(jaxbElement, (Writer)writer); } return writer.toString(); } catch (Exception var6) { LOG.error(var6.getMessage(), var6); Assert.fail(var6.getMessage()); return null; } }
Example #6
Source File: SOAPHelper.java From lams with GNU General Public License v2.0 | 6 votes |
/** * Get a header block from the SOAP envelope contained within the specified message context's * {@link MessageContext#getOutboundMessage()}. * * @param msgContext the message context being processed * @param headerName the name of the header block to return * @param targetNodes the explicitly specified SOAP node actors (1.1) or roles (1.2) for which the header is desired * @param isFinalDestination true specifies that headers targeted for message final destination should be returned, * false specifies they should not be returned * @return the list of matching header blocks */ public static List<XMLObject> getOutboundHeaderBlock(MessageContext msgContext, QName headerName, Set<String> targetNodes, boolean isFinalDestination) { XMLObject outboundEnvelope = msgContext.getOutboundMessage(); if (outboundEnvelope == null) { throw new IllegalArgumentException("Message context does not contain an outbound SOAP envelope"); } // SOAP 1.1 Envelope if (outboundEnvelope instanceof Envelope) { return getSOAP11HeaderBlock((Envelope) outboundEnvelope, headerName, targetNodes, isFinalDestination); } //TODO SOAP 1.2 support when object providers are implemented return Collections.emptyList(); }
Example #7
Source File: WSDLGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
protected void generateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) { for (ParameterImpl headerParam : parameters) { Header header = writer._element(Header.class); header.message(message); header.part(headerParam.getPartName()); header.use(LITERAL); } }
Example #8
Source File: AbstractSchemaValidationTube.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override public SDDocument resolve(String systemId) { SDDocument sdi = docs.get(systemId); if (sdi == null) { SDDocumentSource sds; try { sds = SDDocumentSource.create(new URL(systemId)); } catch(MalformedURLException e) { throw new WebServiceException(e); } sdi = SDDocumentImpl.create(sds, new QName(""), new QName("")); docs.put(systemId, sdi); } return sdi; }
Example #9
Source File: EnrichIntegrationReplaceEnvelopTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@Test(groups = "wso2.esb", description = "Tests-Replace out going message envelop") public void testReplaceEnvelop() throws AxisFault { response = axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp("enrichReplaceEnvelopTestProxy"), null, "WSO2"); assertNotNull(response, "Response is null"); assertEquals(response.getQName().getLocalPart(), "getQuote"); assertEquals(response.getFirstElement().getLocalName().toString(), "request", "Local name does not match"); assertEquals(response.getFirstElement().getFirstChildWithName (new QName("http://services.samples", "symbol")).getText(), "WSO2", "Tag does not match"); }
Example #10
Source File: EncodingPolicyValidator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public Fitness validateServerSide(PolicyAssertion assertion) { QName assertionName = assertion.getName(); if (serverSideSupportedAssertions.contains(assertionName)) { return Fitness.SUPPORTED; } else if (clientSideSupportedAssertions.contains(assertionName)) { return Fitness.UNSUPPORTED; } else { return Fitness.UNKNOWN; } }
Example #11
Source File: WSServiceDelegate.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private QName addPortEpr(WSEndpointReference wsepr) { if (wsepr == null) throw new WebServiceException(ProviderApiMessages.NULL_EPR()); QName eprPortName = getPortNameFromEPR(wsepr, null); //add Port, if it does n't exist; // TODO: what if it has different epr address? { PortInfo portInfo = new PortInfo(this, (wsepr.getAddress() == null) ? null : EndpointAddress.create(wsepr.getAddress()), eprPortName, getPortModel(wsdlService, eprPortName).getBinding().getBindingId()); if (!ports.containsKey(eprPortName)) { ports.put(eprPortName, portInfo); } } return eprPortName; }
Example #12
Source File: UserStoreConfigXMLProcessor.java From micro-integrator with Apache License 2.0 | 5 votes |
public static OMElement serialize(RealmConfiguration realmConfig) { OMFactory factory = OMAbstractFactory.getOMFactory(); // add the user store manager properties OMElement userStoreManagerElement = factory.createOMElement(new QName( UserCoreConstants.RealmConfig.LOCAL_NAME_USER_STORE_MANAGER)); addPropertyElements(factory, userStoreManagerElement, realmConfig.getUserStoreClass(), realmConfig.getUserStoreProperties()); return userStoreManagerElement; }
Example #13
Source File: AssertionData.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * A helper method that appends indented string representation of this instance to the input string buffer. * * @param indentLevel indentation level to be used. * @param buffer buffer to be used for appending string representation of this instance * @return modified buffer containing new string representation of the instance */ public StringBuffer toString(final int indentLevel, final StringBuffer buffer) { final String indent = PolicyUtils.Text.createIndent(indentLevel); final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1); final String innerDoubleIndent = PolicyUtils.Text.createIndent(indentLevel + 2); buffer.append(indent); if (type == ModelNode.Type.ASSERTION) { buffer.append("assertion data {"); } else { buffer.append("assertion parameter data {"); } buffer.append(PolicyUtils.Text.NEW_LINE); buffer.append(innerIndent).append("namespace = '").append(name.getNamespaceURI()).append('\'').append(PolicyUtils.Text.NEW_LINE); buffer.append(innerIndent).append("prefix = '").append(name.getPrefix()).append('\'').append(PolicyUtils.Text.NEW_LINE); buffer.append(innerIndent).append("local name = '").append(name.getLocalPart()).append('\'').append(PolicyUtils.Text.NEW_LINE); buffer.append(innerIndent).append("value = '").append(value).append('\'').append(PolicyUtils.Text.NEW_LINE); buffer.append(innerIndent).append("optional = '").append(optional).append('\'').append(PolicyUtils.Text.NEW_LINE); buffer.append(innerIndent).append("ignorable = '").append(ignorable).append('\'').append(PolicyUtils.Text.NEW_LINE); synchronized (attributes) { if (attributes.isEmpty()) { buffer.append(innerIndent).append("no attributes"); } else { buffer.append(innerIndent).append("attributes {").append(PolicyUtils.Text.NEW_LINE); for(Map.Entry<QName, String> entry : attributes.entrySet()) { final QName aName = entry.getKey(); buffer.append(innerDoubleIndent).append("name = '").append(aName.getNamespaceURI()).append(':').append(aName.getLocalPart()); buffer.append("', value = '").append(entry.getValue()).append('\'').append(PolicyUtils.Text.NEW_LINE); } buffer.append(innerIndent).append('}'); } } buffer.append(PolicyUtils.Text.NEW_LINE).append(indent).append('}'); return buffer; }
Example #14
Source File: TubelineAssemblyController.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private URI createEndpointComponentUri(@NotNull QName serviceName, @NotNull QName portName) { StringBuilder sb = new StringBuilder(serviceName.getNamespaceURI()).append("#wsdl11.port(").append(serviceName.getLocalPart()).append('/').append(portName.getLocalPart()).append(')'); try { return new URI(sb.toString()); } catch (URISyntaxException ex) { Logger.getLogger(TubelineAssemblyController.class).warning( TubelineassemblyMessages.MASM_0020_ERROR_CREATING_URI_FROM_GENERATED_STRING(sb.toString()), ex); return null; } }
Example #15
Source File: Body1_2Impl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
protected SOAPElement addElement(QName name) throws SOAPException { if (hasFault()) { log.severe("SAAJ0402.ver1_2.only.fault.allowed.in.body"); throw new SOAPExceptionImpl( "No other element except Fault allowed in SOAPBody"); } return super.addElement(name); }
Example #16
Source File: HeaderList.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override public Set<QName> getUnderstoodHeaders() { Set<QName> understoodHdrs = new HashSet<QName>(); for (int i = 0; i < size(); i++) { if (isUnderstood(i)) { Header header = get(i); understoodHdrs.add(new QName(header.getNamespaceURI(), header.getLocalPart())); } } return understoodHdrs; // throw new UnsupportedOperationException("getUnderstoodHeaders() is not implemented by HeaderList"); }
Example #17
Source File: WSDLModelImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public @NotNull Map<QName, ? extends EditableWSDLBoundPortType> getBindings() { return unmBindings; }
Example #18
Source File: SOAP11Fault.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
QName getFaultcode() { return faultcode; }
Example #19
Source File: WSEndpoint.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass, MetadataReader metadataReader) { return getDefaultPortName(serviceName, endpointClass, true, metadataReader); }
Example #20
Source File: WSDLModeler.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
protected Operation processSOAPOperation() { Operation operation = new Operation(new QName(null, info.bindingOperation.getName()), info.bindingOperation); setDocumentationIfPresent( operation, info.portTypeOperation.getDocumentation()); if (info.portTypeOperation.getStyle() != OperationStyle.REQUEST_RESPONSE && info.portTypeOperation.getStyle() != OperationStyle.ONE_WAY) { if (options.isExtensionMode()) { warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName())); return null; } else { error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName(), info.port.resolveBinding(document).resolvePortType(document).getName())); } } SOAPStyle soapStyle = info.soapBinding.getStyle(); // find out the SOAP operation extension, if any SOAPOperation soapOperation = (SOAPOperation) getExtensionOfType(info.bindingOperation, SOAPOperation.class); if (soapOperation != null) { if (soapOperation.getStyle() != null) { soapStyle = soapOperation.getStyle(); } if (soapOperation.getSOAPAction() != null) { operation.setSOAPAction(soapOperation.getSOAPAction()); } } operation.setStyle(soapStyle); String uniqueOperationName = getUniqueName(info.portTypeOperation, info.hasOverloadedOperations); if (info.hasOverloadedOperations) { operation.setUniqueName(uniqueOperationName); } info.operation = operation; //attachment SOAPBody soapRequestBody = getSOAPRequestBody(); if (soapRequestBody == null) { // the WSDL document is invalid error(info.bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(info.bindingOperation.getName())); } if (soapStyle == SOAPStyle.RPC) { if (soapRequestBody.isEncoded()) { if(options.isExtensionMode()){ warning(soapRequestBody, ModelerMessages.WSDLMODELER_20_RPCENC_NOT_SUPPORTED()); processNonSOAPOperation(); }else{ error(soapRequestBody, ModelerMessages.WSDLMODELER_20_RPCENC_NOT_SUPPORTED()); } } return processLiteralSOAPOperation(StyleAndUse.RPC_LITERAL); } // document style return processLiteralSOAPOperation(StyleAndUse.DOC_LITERAL); }
Example #21
Source File: StreamReaderDelegate.java From Bytecoder with Apache License 2.0 | 4 votes |
public QName getAttributeName(int index) { return reader.getAttributeName(index); }
Example #22
Source File: Body1_1Impl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public SOAPFault addSOAP12Fault(QName faultCode, String faultReason, Locale locale) { // log message here throw new UnsupportedOperationException("Not supported in SOAP 1.1"); }
Example #23
Source File: FaultElement1_1Impl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public FaultElement1_1Impl(SOAPDocumentImpl ownerDoc, QName qname) { super(ownerDoc, qname); }
Example #24
Source File: SP12Constants.java From steady with Apache License 2.0 | 4 votes |
public QName getSamlToken() { return SAML_TOKEN; }
Example #25
Source File: BindingSubject.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
public static BindingSubject createInputMessageSubject(QName bindingName, QName operationName, QName messageName) { final BindingSubject operationSubject = createOperationSubject(bindingName, operationName); return new BindingSubject(messageName, WsdlMessageType.INPUT, WsdlNameScope.MESSAGE, operationSubject); }
Example #26
Source File: Name.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Creates a {@link QName} from this. */ public QName toQName() { return new QName(nsUri,localName); }
Example #27
Source File: Name.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Creates a {@link QName} from this. */ public QName toQName() { return new QName(nsUri,localName); }
Example #28
Source File: X509Token.java From steady with Apache License 2.0 | 4 votes |
public QName getRealName() { return constants.getX509Token(); }
Example #29
Source File: DataSourceDispatch.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Deprecated public DataSourceDispatch(QName port, Service.Mode mode, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) { super(port, mode, service, pipe, binding, epr ); }
Example #30
Source File: WSDLFaultImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@NotNull public QName getQName() { return new QName(operation.getName().getNamespaceURI(), name); }