• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExtensionRegistry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.wsdl.extensions.ExtensionRegistry的典型用法代码示例。如果您正苦于以下问题:Java ExtensionRegistry类的具体用法?Java ExtensionRegistry怎么用?Java ExtensionRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExtensionRegistry类属于javax.wsdl.extensions包,在下文中一共展示了ExtensionRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeHeaders

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
private List<SOAPHeader> makeHeaders(Definition definition) throws WSDLException {
  List<SOAPHeader> list = new ArrayList<SOAPHeader>();
  String[] parts = new String[] { XTeeHeader.CLIENT.getLocalPart(), XTeeHeader.SERVICE.getLocalPart(),
                                  XTeeHeader.USER_ID.getLocalPart(), XTeeHeader.ID.getLocalPart(),
                                  XTeeHeader.PROTOCOL_VERSION.getLocalPart() };
  ExtensionRegistry extReg = definition.getExtensionRegistry();
  for (int i = 0; i < parts.length; i++) {
    SOAPHeader header =
        (SOAPHeader) extReg.createExtension(BindingInput.class, new QName(SOAP_11_NAMESPACE_URI, "header"));
    header.setMessage(new QName(definition.getTargetNamespace(), XTeeWsdlDefinition.XROAD_HEADER));
    header.setPart(parts[i]);
    if (use.equalsIgnoreCase(LITERAL)) {
      header.setUse(LITERAL);
    } else {
      header.setUse(ENCODED);
      header.setEncodingStyles(Arrays.asList(ENCODING));
    }
    list.add(header);
  }

  return list;
}
 
开发者ID:nortal,项目名称:j-road,代码行数:23,代码来源:XTeeSoapProvider.java


示例2: populatePort

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
@Override
protected void populatePort(Definition definition, Port port) throws WSDLException {
  super.populatePort(definition, port);
  ExtensionRegistry extensionRegistry = definition.getExtensionRegistry();
  extensionRegistry.mapExtensionTypes(Port.class,
                                      new QName(XTeeWsdlDefinition.XROAD_NAMESPACE,
                                                "address",
                                                XTeeWsdlDefinition.XROAD_PREFIX),
                                      UnknownExtensibilityElement.class);
  UnknownExtensibilityElement element =
      (UnknownExtensibilityElement) extensionRegistry.createExtension(Port.class,
                                                                      new QName(XTeeWsdlDefinition.XROAD_NAMESPACE,
                                                                                "address",
                                                                                XTeeWsdlDefinition.XROAD_NAMESPACE));
  Document doc;
  try {
    doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  } catch (ParserConfigurationException e) {
    throw new RuntimeException(e);
  }
  Element xRoadAddr = doc.createElementNS(XTeeWsdlDefinition.XROAD_NAMESPACE, "address");
  xRoadAddr.setPrefix(XTeeWsdlDefinition.XROAD_PREFIX);
  xRoadAddr.setAttribute("producer", xRoadDatabase);
  element.setElement(xRoadAddr);
  port.addExtensibilityElement(element);
}
 
开发者ID:nortal,项目名称:j-road,代码行数:27,代码来源:XTeeSoapProvider.java


示例3: generateBindings

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
private void generateBindings() throws SchemaGenerationException {
    this.httpSoapBinding = this.wsdlDefinition.createBinding();
    this.httpSoapBinding.setUndefined(false);
    this.httpSoapBinding.setQName(new QName(this.service.getNamespace(),
            this.service.getName() + "HttpSoapBinding"));
    this.httpSoapBinding.setPortType(this.portType);
    // add soap transport parts
    ExtensionRegistry extensionRegistry = null;
    try {
        extensionRegistry = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
        SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension(
                Binding.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
        soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
        soapBinding.setStyle("document");
        this.httpSoapBinding.addExtensibilityElement(soapBinding);
    } catch (WSDLException e) {
        throw new SchemaGenerationException("Can not crete a wsdl factory");
    }
    this.wsdlDefinition.addBinding(this.httpSoapBinding);
    this.wsdlDefinition.getBindings().put(this.httpSoapBinding.getQName(),
            this.httpSoapBinding);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:WSDL11DefinitionBuilder.java


示例4: generateService

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
private void generateService()
        throws SchemaGenerationException {
    // now add the binding portType and messages corresponding to every operation
    javax.wsdl.Service service = this.wsdlDefinition.createService();
    service.setQName(new QName(this.service.getNamespace(), this.service.getName()));

    Port port = this.wsdlDefinition.createPort();
    port.setName(this.service.getName() + "HttpSoapPort");
    port.setBinding(this.httpSoapBinding);
    ExtensionRegistry extensionRegistry = null;
    try {
        extensionRegistry = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
        SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension(
                Port.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
        soapAddress.setLocationURI("http://localhost:8080/axis2/services/" + this.service.getName());
        port.addExtensibilityElement(soapAddress);
    } catch (WSDLException e) {
        throw new SchemaGenerationException("Can not crete a wsdl factory");
    }
    service.addPort(port);
    this.wsdlDefinition.addService(service);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:WSDL11DefinitionBuilder.java


示例5: readInTheWSDLFile

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
/**
 * Read the WSDL file
 *
 * @param uri
 * @throws WSDLException
 */
public Definition readInTheWSDLFile(final String uri) throws WSDLException {

    WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
    reader.setFeature("javax.wsdl.importDocuments", true);

    ExtensionRegistry extReg = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
    extReg.registerExtensionAttributeType(Input.class,
            new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION),
            AttributeExtensible.STRING_TYPE);
    extReg.registerExtensionAttributeType(Output.class,
            new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION),
            AttributeExtensible.STRING_TYPE);
    reader.setExtensionRegistry(extReg);

    return reader.readWSDL(uri);
    
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:CodeGenerationEngine.java


示例6: marshall

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
public void marshall(Class parentType,
                     QName elementType,
                     ExtensibilityElement extension,
                     PrintWriter pw,
                     Definition def,
                     ExtensionRegistry extReg) throws WSDLException {
  pw.append("        <" + XTeeWsdlDefinition.XROAD_PREFIX + ":" + elementType.getLocalPart() + ">");
  pw.append(((XTeeElement) extension).getValue());
  pw.append("</" + XTeeWsdlDefinition.XROAD_PREFIX + ":" + elementType.getLocalPart() + ">\n");
}
 
开发者ID:nortal,项目名称:j-road,代码行数:12,代码来源:XTeeElement.java


示例7: setExtensionRegistry

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public void setExtensionRegistry(ExtensionRegistry extReg) {
    if (isDebugEnabled) {
        log.debug(myClassName + ".setExtensionRegistry(" + extReg + ")");
    }
    if (wsdlDefinition != null) {
        wsdlDefinition.setExtensionRegistry(extReg);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:9,代码来源:WSDLWrapperBasicImpl.java


示例8: getExtensionRegistry

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public ExtensionRegistry getExtensionRegistry() {
    if (isDebugEnabled) {
        log.debug(myClassName + ".getExtensionRegistry()");
    }
    if (wsdlDefinition != null) {
        return wsdlDefinition.getExtensionRegistry();
    }
    return null;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:10,代码来源:WSDLWrapperBasicImpl.java


示例9: setExtensionRegistry

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public void setExtensionRegistry(ExtensionRegistry extReg) {
    if (isDebugEnabled) {
        log.debug(myClassName + ".setExtensionRegistry(" + extReg + ")");
    }

    getWrappedDefinitionForUse();

    if (wsdlDefinition != null) {
        if (hasBeenSaved) {
            hasBeenUpdatedSinceSaving = true;
        }
        wsdlDefinition.setExtensionRegistry(extReg);
    }
    doneUsingWrappedDefinition();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:WSDLWrapperSaveImpl.java


示例10: getExtensionRegistry

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public ExtensionRegistry getExtensionRegistry() {
    if (isDebugEnabled) {
        log.debug(myClassName + ".getExtensionRegistry()");
    }

    getWrappedDefinitionForUse();

    ExtensionRegistry results = null;

    if (wsdlDefinition != null) {
        results = wsdlDefinition.getExtensionRegistry();
    }
    doneUsingWrappedDefinition();
    return results;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:WSDLWrapperSaveImpl.java


示例11: getReader

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
/**
 * Get a WSDLReader.
 *
 * @return WSDLReader.
 * @throws WSDLException on error.
 */
private WSDLReader getReader() throws WSDLException {

    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
    ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();
    wsdlReader.setExtensionRegistry(registry);
    wsdlReader.setFeature("javax.wsdl.verbose", true);
    wsdlReader.setFeature("javax.wsdl.importDocuments", true);
    return wsdlReader;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:Wsdl.java


示例12: getReader

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
/**
 * Get a WSDLReader.
 *
 * @return WSDLReader.
 * @throws WSDLException
 *           on error.
 */
private WSDLReader getReader() throws WSDLException {

  WSDLFactory wsdlFactory = WSDLFactory.newInstance();
  WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
  ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();
  wsdlReader.setExtensionRegistry( registry );
  wsdlReader.setFeature( "javax.wsdl.verbose", true );
  wsdlReader.setFeature( "javax.wsdl.importDocuments", true );
  return wsdlReader;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:Wsdl.java


示例13: getWSDLBindingOperation

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
/**
 * generates the soap11 binding operation for the soap 11 binding.
 *
 * @param definition
 * @param wsdlOperation
 * @param operation
 * @return
 * @throws SchemaGenerationException
 */
public BindingOperation getWSDLBindingOperation(Definition definition,
                                                javax.wsdl.Operation wsdlOperation,
                                                Operation operation)
        throws SchemaGenerationException {
    BindingOperation bindingOperation = definition.createBindingOperation();
    bindingOperation.setName(operation.getName());
    bindingOperation.setOperation(wsdlOperation);

    BindingInput bindingInput = definition.createBindingInput();
    bindingOperation.setBindingInput(bindingInput);

    BindingOutput bindingOutput = definition.createBindingOutput();
    bindingOperation.setBindingOutput(bindingOutput);

    ExtensionRegistry extensionRegistry = null;
    try {
        extensionRegistry = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
        SOAPOperation soapOperation = (SOAPOperation) extensionRegistry.createExtension(
                BindingOperation.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "operation"));
        soapOperation.setSoapActionURI("urn:" + operation.getName());
        soapOperation.setStyle("document");
        bindingOperation.addExtensibilityElement(soapOperation);

        SOAPBody inputSoapBody = (SOAPBody) extensionRegistry.createExtension(
                BindingInput.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
        inputSoapBody.setUse("literal");
        bindingInput.addExtensibilityElement(inputSoapBody);

        SOAPBody outputSoapBody = (SOAPBody) extensionRegistry.createExtension(
                BindingOutput.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
        outputSoapBody.setUse("literal");
        bindingOutput.addExtensibilityElement(outputSoapBody);

        // adding fault messages
        Class[] exceptionClasses = operation.getJavaMethod().getExceptionTypes();
        BindingFault bindingFault;
        String faultName;
        for (int i = 0; i < exceptionClasses.length; i++) {
            faultName = exceptionClasses[i].getName();
            faultName = faultName.substring(faultName.lastIndexOf(".") + 1);
            bindingFault = definition.createBindingFault();
            bindingFault.setName("fault" + faultName);
            bindingOperation.addBindingFault(bindingFault);

            SOAPFault soapFault = (SOAPFault) extensionRegistry.createExtension(
                    BindingFault.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "fault"));
            soapFault.setUse("literal");
            soapFault.setName("fault" + faultName);
            bindingFault.addExtensibilityElement(soapFault);
        }


    } catch (WSDLException e) {
        throw new SchemaGenerationException("Can not crete a wsdl factory");
    }

    return bindingOperation;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:68,代码来源:WSDL11DefinitionBuilder.java


示例14: setExtensionRegistry

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public void setExtensionRegistry(ExtensionRegistry extReg) {
    wrapperImpl.setExtensionRegistry(extReg);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:4,代码来源:WSDLDefinitionWrapper.java


示例15: getExtensionRegistry

import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public ExtensionRegistry getExtensionRegistry() {
    return wrapperImpl.getExtensionRegistry();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:4,代码来源:WSDLDefinitionWrapper.java



注:本文中的javax.wsdl.extensions.ExtensionRegistry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Function2类代码示例发布时间:2022-05-22
下一篇:
Java HeadersRequestCondition类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap