本文整理汇总了Java中javax.wsdl.extensions.soap12.SOAP12Binding类的典型用法代码示例。如果您正苦于以下问题:Java SOAP12Binding类的具体用法?Java SOAP12Binding怎么用?Java SOAP12Binding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SOAP12Binding类属于javax.wsdl.extensions.soap12包,在下文中一共展示了SOAP12Binding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWsdl
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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: extractExecutionBinding
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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;
}
示例3: getOperations
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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;
}
示例4: getBindingOperations
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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;
}
示例5: getStyle
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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";
}
示例6: getBindingExtension
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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();
}
}
示例7: getSoapFactory
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的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();
}
}
示例8: getSOAPBindingStyle
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
/**
* Get the SOAPBinding style for the specified WSDL Port.
*
* @param binding A WSDL Binding instance.
* @return String either 'document' or 'rpc', if not found in WSDL defaults to 'document'.
*/
protected static String getSOAPBindingStyle(Binding binding) throws KettleException {
String style = SOAP_BINDING_DEFAULT;
ExtensibilityElement soapBindingElem =
findExtensibilityElement(binding, SOAP_BINDING_ELEMENT_NAME);
if (soapBindingElem != null) {
if (soapBindingElem instanceof SOAP12Binding) {
style = ((SOAP12Binding) soapBindingElem).getStyle();
} else if (soapBindingElem instanceof SOAPBinding) {
style = ((SOAPBinding) soapBindingElem).getStyle();
} else {
throw new KettleException("Binding type "+soapBindingElem+" encountered. The Web Service Lookup step only supports SOAP Bindings!");
}
}
return style;
}
示例9: getSOAPBindingStyle
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
/**
* Get the SOAPBinding style for the specified WSDL Port.
*
* @param binding
* A WSDL Binding instance.
* @return String either 'document' or 'rpc', if not found in WSDL defaults to 'document'.
*/
protected static String getSOAPBindingStyle( Binding binding ) throws KettleException {
String style = SOAP_BINDING_DEFAULT;
ExtensibilityElement soapBindingElem = findExtensibilityElement( binding, SOAP_BINDING_ELEMENT_NAME );
if ( soapBindingElem != null ) {
if ( soapBindingElem instanceof SOAP12Binding ) {
style = ( (SOAP12Binding) soapBindingElem ).getStyle();
} else if ( soapBindingElem instanceof SOAPBinding ) {
style = ( (SOAPBinding) soapBindingElem ).getStyle();
} else {
throw new KettleException( "Binding type "
+ soapBindingElem + " encountered. The Web Service Lookup step only supports SOAP Bindings!" );
}
}
return style;
}
示例10: testWSDLAccess
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
@Test
@RunAsClient
public void testWSDLAccess() throws Exception
{
URL wsdlURL = new URL(baseURL + "?wsdl");
WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
Definition wsdl = wsdlReader.readWSDL(wsdlURL.toString());
String port = "SOAPEndpointPort";
QName serviceQName = new QName("http://org.jboss.ws/jaxws/binding", "SOAPEndpointService");
Binding wsdlBinding = wsdl.getService(serviceQName).getPort(port).getBinding();
assertNotNull("Cannot find binding for port: " + port, wsdlBinding);
String transport = null;
@SuppressWarnings("unchecked")
List<ExtensibilityElement> extList = wsdlBinding.getExtensibilityElements();
for (ExtensibilityElement ext : extList)
{
if (ext instanceof SOAPBinding)
{
fail("Expected SOAP-1.2 binding");
}
else if (ext instanceof SOAP12Binding)
{
SOAP12Binding soapBinding = (SOAP12Binding)ext;
transport = soapBinding.getTransportURI();
}
}
if (isIntegrationCXF())
{
System.out.println("FIXME: [CXF-2531] Wrong \"transport\" attribute in soap12:binding");
}
else
{
assertEquals("Invalid transport uri", "http://schemas.xmlsoap.org/soap/http", transport);
}
}
示例11: getSoapFactory
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
public SOAPFactory getSoapFactory() throws AxisFault {
ExtensibilityElement bindingType = SOAPHelper.getBindingExtension(binding);
if (!(bindingType instanceof SOAPBinding || bindingType instanceof SOAP12Binding ||
bindingType instanceof HTTPBinding)) {
throw new AxisFault("Service binding is not supported for service " + serviceName);
}
if (bindingType instanceof SOAPBinding) {
return OMAbstractFactory.getSOAP11Factory();
} else {
return OMAbstractFactory.getSOAP12Factory();
}
}
示例12: deriveAndSetBindingStyle
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
private static void deriveAndSetBindingStyle(final ExtensibilityElement bindingType,
final BPELMessageContext bpelMessageContext) {
boolean isRPC = false;
if (bindingType instanceof SOAPBinding) {
isRPC = ((SOAPBinding) bindingType).getStyle() != null
&& ((SOAPBinding) bindingType).getStyle().equalsIgnoreCase("rpc");
} else if (bindingType instanceof SOAP12Binding) {
isRPC = ((SOAP12Binding) bindingType).getStyle() != null
&& ((SOAP12Binding) bindingType).getStyle().equalsIgnoreCase("rpc");
}
bpelMessageContext.setRPCStyleOperation(isRPC);
}
示例13: isRPC
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
public static boolean isRPC(ExtensibilityElement bindingType) {
if (bindingType instanceof SOAPBinding) {
return ((SOAPBinding) bindingType).getStyle() != null &&
((SOAPBinding) bindingType).getStyle().equals(WSDL_BINDING_STYLE_RPC);
} else if (bindingType instanceof SOAP12Binding) {
return ((SOAP12Binding) bindingType).getStyle() != null &&
((SOAP12Binding) bindingType).getStyle().equals(WSDL_BINDING_STYLE_RPC);
}
/**
* We are using Document literal style binding inside Axis2 when we got a request
* via HTTPbinding.
*/
return false;
}
示例14: getBindingExtension
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
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();
}
}
示例15: isRPC
import javax.wsdl.extensions.soap12.SOAP12Binding; //导入依赖的package包/类
public static boolean isRPC(ExtensibilityElement bindingType) {
if (bindingType instanceof SOAPBinding) {
return ((SOAPBinding) bindingType).getStyle() != null &&
((SOAPBinding) bindingType).getStyle().equals(WSDL_BINDING_STYLE_RPC);
} else if (bindingType instanceof SOAP12Binding) {
return ((SOAP12Binding) bindingType).getStyle() != null &&
((SOAP12Binding) bindingType).getStyle().equals(WSDL_BINDING_STYLE_RPC);
}
/**
* We are using Document literal style binding inside Axis2 when we got a request
* via HTTPbinding.
*/
return false;
}