Java Code Examples for javax.wsdl.Definition#createBinding()

The following examples show how to use javax.wsdl.Definition#createBinding() . These examples are extracted from open source projects. 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
private Binding createBindingSOAP( Definition def, PortType pt, String bindingName ) {
	Binding bind = def.getBinding( new QName( bindingName ) );
	if( bind == null ) {
		bind = def.createBinding();
		bind.setQName( new QName( tns, bindingName ) );
	bind.setPortType( pt );
	bind.setUndefined( false );
	try {
		SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension( Binding.class,
			new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "binding" ) );
		soapBinding.setTransportURI( NameSpacesEnum.SOAP_OVER_HTTP.getNameSpaceURI() );
		soapBinding.setStyle( "document" );
		bind.addExtensibilityElement( soapBinding );
	} catch( WSDLException ex ) {
		System.err.println( ex.getMessage() );
	def.addBinding( bind );

	return bind;

Example 2
Source Project: cxf   File:    License: Apache License 2.0 6 votes vote down vote up
protected void buildBinding(Definition definition,
                            Collection<BindingInfo> bindingInfos,
                            Collection<PortType> portTypes) {
    Binding binding = null;
    for (BindingInfo bindingInfo : bindingInfos) {
        binding = definition.createBinding();
        addDocumentation(binding, bindingInfo.getDocumentation());
        for (PortType portType : portTypes) {
            if (portType.getQName().equals(bindingInfo.getInterface().getName())) {
        if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) {
            addNamespace(bindingInfo.getName().getNamespaceURI(), definition);
        buildBindingOperation(definition, binding, bindingInfo.getOperations());
        addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo));
Example 3
Source Project: cxf   File:    License: Apache License 2.0 5 votes vote down vote up
public static Binding doAppendBinding(Definition wsdlDefinition, String name, PortType portType,
                                         ExtensionRegistry extReg) throws Exception {
    Binding binding = wsdlDefinition.createBinding();
    binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), name + bindingName));
    setSoapBindingExtElement(wsdlDefinition, binding, extReg);
    addBindingOperation(wsdlDefinition, portType, binding, extReg);
    return binding;