本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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);
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例14: setExtensionRegistry
import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public void setExtensionRegistry(ExtensionRegistry extReg) {
wrapperImpl.setExtensionRegistry(extReg);
}
示例15: getExtensionRegistry
import javax.wsdl.extensions.ExtensionRegistry; //导入依赖的package包/类
public ExtensionRegistry getExtensionRegistry() {
return wrapperImpl.getExtensionRegistry();
}