本文整理汇总了Java中javax.wsdl.extensions.ExtensibilityElement类的典型用法代码示例。如果您正苦于以下问题:Java ExtensibilityElement类的具体用法?Java ExtensibilityElement怎么用?Java ExtensibilityElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtensibilityElement类属于javax.wsdl.extensions包,在下文中一共展示了ExtensibilityElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWsdl
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
@Test
@RunAsClient
public void testWsdl() throws Exception
{
URL wsdlURL = new URL(baseURL + "/jaxws-jbws2183/TestServiceImpl?wsdl");
WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
assertNotNull(wsdlDefinition);
for (Iterator<?> it = wsdlDefinition.getAllBindings().values().iterator(); it.hasNext(); )
{
List<?> extElements = ((Binding)it.next()).getExtensibilityElements();
boolean found = false;
for (int i = 0; i < extElements.size(); i++)
{
ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
if (extElement instanceof SOAP12Binding)
found = true;
else if (extElement instanceof SOAPBinding)
fail("SOAP 1.1 Binding found!");
}
assertTrue("SOAP 1.2 Binding not found!",found);
}
}
示例2: parseWSDLTypes
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private void parseWSDLTypes( XSOMParser schemaParser )
throws IOException
{
Definition definition = getWSDLDefinition();
if ( definition != null ) {
Types types = definition.getTypes();
if ( types != null ) {
List<ExtensibilityElement> list = types.getExtensibilityElements();
for( ExtensibilityElement element : list ) {
if ( element instanceof SchemaImpl ) {
Element schemaElement = ((SchemaImpl) element).getElement();
Map<String, String> namespaces = definition.getNamespaces();
for( Entry<String, String> entry : namespaces.entrySet() ) {
if ( entry.getKey().equals( "xmlns" ) || entry.getKey().trim().isEmpty() ) {
continue;
}
if ( schemaElement.getAttribute( "xmlns:" + entry.getKey() ).isEmpty() ) {
schemaElement.setAttribute( "xmlns:" + entry.getKey(), entry.getValue() );
}
}
parseSchemaElement( definition, schemaElement, schemaParser );
}
}
}
}
}
示例3: getSoapActionForOperation
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private String getSoapActionForOperation( String operationName )
throws IOException
{
String soapAction = null;
Port port = getWSDLPort();
if ( port != null ) {
BindingOperation bindingOperation = port.getBinding().getBindingOperation( operationName, null, null );
for( ExtensibilityElement element : (List<ExtensibilityElement>) bindingOperation.getExtensibilityElements() ) {
if ( element instanceof SOAPOperation ) {
soapAction = ((SOAPOperation) element).getSoapActionURI();
}
}
}
if ( soapAction == null ) {
soapAction = getStringParameter( "namespace" ) + "/" + operationName;
}
return soapAction;
}
示例4: setOutputEncodingStyle
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private void setOutputEncodingStyle( SOAPEnvelope soapEnvelope, String operationName )
throws IOException, SOAPException
{
Port port = getWSDLPort();
if ( port != null ) {
BindingOperation bindingOperation = port.getBinding().getBindingOperation( operationName, null, null );
if ( bindingOperation == null ) {
return;
}
BindingOutput output = bindingOperation.getBindingOutput();
if ( output == null ) {
return;
}
for( ExtensibilityElement element : (List<ExtensibilityElement>) output.getExtensibilityElements() ) {
if ( element instanceof javax.wsdl.extensions.soap.SOAPBody ) {
List<String> list = ((javax.wsdl.extensions.soap.SOAPBody) element).getEncodingStyles();
if ( list != null && list.isEmpty() == false ) {
soapEnvelope.setEncodingStyle( list.get( 0 ) );
soapEnvelope.addNamespaceDeclaration( "enc", list.get( 0 ) );
}
}
}
}
}
示例5: extractExecutionBinding
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private WSExecutionFactory.Binding extractExecutionBinding(Binding binding) throws TranslatorException {
WSExecutionFactory.Binding executionBinding = WSExecutionFactory.Binding.SOAP11;
ExtensibilityElement bindingExtension = getExtensibilityElement(binding.getExtensibilityElements(), "binding"); //$NON-NLS-1$
if(bindingExtension instanceof SOAPBinding) {
executionBinding = WSExecutionFactory.Binding.SOAP11;
}
else if (bindingExtension instanceof SOAP12Binding) {
executionBinding = WSExecutionFactory.Binding.SOAP12;
}
else if (bindingExtension instanceof HTTPBinding) {
executionBinding = WSExecutionFactory.Binding.HTTP;
}
else {
throw new TranslatorException(WSExecutionFactory.UTIL.gs(WSExecutionFactory.Event.TEIID15003));
}
return executionBinding;
}
示例6: getOperations
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
/**
* The method is here only for compatibility with other modules and will be removed as soon as other modules are updated.
*
* @return a list of all SOAP operations found in the WSDL (including all imported definitions)
* @deprecated
*/
@Deprecated
List<Operation> getOperations() {
List<Operation> operations = new ArrayList<Operation>();
Collection<Binding> bindings = definition.getAllBindings().values();
for (Binding binding : bindings) {
List<ExtensibilityElement> bindingExElements = binding.getExtensibilityElements();
for (ExtensibilityElement bindingExElement : bindingExElements) {
if (bindingExElement instanceof SOAPBinding ||
bindingExElement instanceof SOAP12Binding) {
List<BindingOperation> bindingOperations = binding.getBindingOperations();
for (BindingOperation bindingOperation : bindingOperations) {
Operation operation = bindingOperation.getOperation();
if (operation != null) {
operations.add(operation);
}
}
}
}
}
return operations;
}
示例7: getBindingOperations
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private List<BindingOperation> getBindingOperations(String portName) {
Port port = getPort(portName);
if (port != null) {
Binding binding = port.getBinding();
if (binding != null) {
List<ExtensibilityElement> bindingExElements = binding.getExtensibilityElements();
for (ExtensibilityElement bindingExElement : bindingExElements) {
if (bindingExElement instanceof SOAPBinding ||
bindingExElement instanceof SOAP12Binding) {
return binding.getBindingOperations();
}
}
}
}
return Collections.EMPTY_LIST;
}
示例8: getStyle
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private String getStyle(Binding binding) {
String style = null;
List<ExtensibilityElement> bindingExElements = binding.getExtensibilityElements();
for (ExtensibilityElement bindingExElement : bindingExElements) {
if (bindingExElement instanceof SOAPBinding) {
SOAPBinding soapBinding = (SOAPBinding)bindingExElement;
style = soapBinding.getStyle();
break;
} else if (bindingExElement instanceof SOAP12Binding) {
SOAP12Binding soap12Binding = (SOAP12Binding)bindingExElement;
style = soap12Binding.getStyle();
break;
}
}
return style != null ? style : "document";
}
示例9: getBindingId
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
/**
* Get the SOAP Binding Id for the specified {@link Port}.
*
* @param port The WSDL port.
* @param mtomEnabled MTOM feature boolean
* @return The SOAPBinding Id found on the port.
*/
public static String getBindingId(Port port, Boolean mtomEnabled) {
String bindingId = null;
List<ExtensibilityElement> extElements = port.getExtensibilityElements();
for (ExtensibilityElement extElement : extElements) {
if (extElement instanceof SOAP12Address) {
if (mtomEnabled) {
bindingId = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING;
} else {
bindingId = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING;
}
break;
} else {
if (mtomEnabled) {
bindingId = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING;
} else {
bindingId = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING;
}
break;
}
}
return bindingId;
}
示例10: getSoapAction
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
/**
* Get the soapAction value for a given operation.
*
* @param operation The WSDL BindingOperation.
* @return the soapAction value if it exists.
*/
public static String getSoapAction(final BindingOperation operation) {
String soapActionUri = "";
if (operation != null) {
List<ExtensibilityElement> extElements = operation.getExtensibilityElements();
for (ExtensibilityElement extElement : extElements) {
if (extElement instanceof SOAPOperation) {
soapActionUri = ((SOAPOperation) extElement).getSoapActionURI();
break;
} else if (extElement instanceof SOAP12Operation) {
SOAP12Operation soapOperation = ((SOAP12Operation) extElement);
Boolean soapActionRequired = soapOperation.getSoapActionRequired();
if ((soapActionRequired == null) || soapActionRequired) {
soapActionUri = soapOperation.getSoapActionURI();
}
break;
}
}
}
return soapActionUri;
}
示例11: getExtensibilityElements
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private static List<ExtensibilityElement> getExtensibilityElements(Definition definition) {
List<ExtensibilityElement> elements = new ArrayList<ExtensibilityElement>();
Types types = definition.getTypes();
if (types != null) {
elements.addAll(definition.getExtensibilityElements());
elements.addAll(types.getExtensibilityElements());
}
Iterator<List<Import>> wsdlImports = definition.getImports().values().iterator();
while (wsdlImports.hasNext()) {
List<Import> imports = wsdlImports.next();
int size = imports.size();
for (int i = 0; i < size; i++) {
elements.addAll(getExtensibilityElements(imports.get(i).getDefinition()));
}
}
return elements;
}
示例12: setSOAPFactoryAndBindingStyle
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private static void setSOAPFactoryAndBindingStyle(final BPELMessageContext bpelMessageContext) {
ExtensibilityElement bindingType = WSDLAwareSOAPProcessor.getBindingExtension(
bpelMessageContext.getWsdlBindingForCurrentMessageFlow());
if (bpelMessageContext.getSoapFactoryForCurrentMessageFlow() == null) {
if (bindingType instanceof SOAPBinding) {
bpelMessageContext.setSoapFactoryForCurrentMessageFlow(
OMAbstractFactory.getSOAP11Factory());
} else {
bpelMessageContext.setSoapFactoryForCurrentMessageFlow(
OMAbstractFactory.getSOAP12Factory());
}
}
deriveAndSetBindingStyle(bindingType, bpelMessageContext);
}
示例13: getBindingExtension
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
/**
* Look up the ExtensibilityElement defining the binding for the given Port or
* throw an {@link IllegalArgumentException} if multiple bindings found.
*
* @param binding WSDL binding
* @return an instance of {@link SOAPBinding} or {@link HTTPBinding} or null
* @throws IllegalArgumentException if multiple bindings found.
*/
public static ExtensibilityElement getBindingExtension(Binding binding) {
Collection bindings = new ArrayList();
CollectionsX.filter(bindings, binding.getExtensibilityElements(), HTTPBinding.class);
CollectionsX.filter(bindings, binding.getExtensibilityElements(), SOAPBinding.class);
CollectionsX.filter(bindings, binding.getExtensibilityElements(), SOAP12Binding.class);
if (bindings.size() == 0) {
return null;
} else if (bindings.size() > 1) {
// exception if multiple bindings found
throw new IllegalArgumentException("Multiple bindings: " + binding.getQName());
} else {
// retrieve the single element
return (ExtensibilityElement) bindings.iterator().next();
}
}
示例14: getSoapFactory
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
public SOAPFactory getSoapFactory() throws FaultException {
Binding binding = getBinding();
ExtensibilityElement bindingType = SOAPHelper.getBindingExtension(binding);
if (!(bindingType instanceof SOAPBinding || bindingType instanceof SOAP12Binding ||
bindingType instanceof HTTPBinding)) {
throw new FaultException(BPEL4PeopleConstants.B4P_FAULT,
"Service binding is not supported for service " + serviceName + " and port " +
getServicePort());
}
if (bindingType instanceof SOAPBinding) {
return OMAbstractFactory.getSOAP11Factory();
} else {
return OMAbstractFactory.getSOAP12Factory();
}
}
示例15: processEmbeddedEPR
import javax.wsdl.extensions.ExtensibilityElement; //导入依赖的package包/类
private void processEmbeddedEPR(List extensibilityElements, AxisEndpoint axisEndpoint) {
Iterator eelts = extensibilityElements.iterator();
while(eelts.hasNext()){
ExtensibilityElement ee = (ExtensibilityElement)eelts.next();
if(AddressingConstants.Final.WSA_ENDPOINT_REFERENCE.equals(ee.getElementType())){
try {
Element elt = ((UnknownExtensibilityElement)ee).getElement();
OMElement eprOMElement = XMLUtils.toOM(elt);
EndpointReference epr = EndpointReferenceHelper.fromOM(eprOMElement);
Map referenceParameters = epr.getAllReferenceParameters();
if(referenceParameters != null){
axisEndpoint.addParameter(AddressingConstants.REFERENCE_PARAMETER_PARAMETER, new ArrayList(referenceParameters.values()));
}
} catch (Exception e) {
if(log.isDebugEnabled()){
log.debug("Exception encountered processing embedded wsa:EndpointReference", e);
}
}
}
}
}