Java Code Examples for javax.wsdl.WSDLException#printStackTrace()

The following examples show how to use javax.wsdl.WSDLException#printStackTrace() . 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
Source File: WSDLDocCreator.java    From jolie with GNU Lesser General Public License v2.1 6 votes vote down vote up
public Service createService( Definition localdef, String serviceName, Binding bind, String mySOAPAddress ) {
	Port p = localDef.createPort();
	p.setName( serviceName + "Port" );
	try {

		SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension( Port.class,
			new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "address" ) );
		soapAddress.setLocationURI( mySOAPAddress );
		p.addExtensibilityElement( soapAddress );
	} catch( WSDLException ex ) {
		ex.printStackTrace();
	}
	p.setBinding( bind );
	Service s = new ServiceImpl();
	QName serviceQName = new QName( serviceName );
	s.setQName( serviceQName );
	s.addPort( p );
	localDef.addService( s );
	return s;
}
 
Example 2
Source File: SoapTransportFactory.java    From cxf with Apache License 2.0 6 votes vote down vote up
private void createSoapExtensors(Bus bus, EndpointInfo ei, SoapBindingInfo bi, boolean isSoap12) {
    try {

        String address = ei.getAddress();
        if (address == null) {
            address = "http://localhost:9090";
        }

        ExtensionRegistry registry = bus.getExtension(WSDLManager.class).getExtensionRegistry();
        SoapAddress soapAddress = SOAPBindingUtil.createSoapAddress(registry, isSoap12);
        soapAddress.setLocationURI(address);

        ei.addExtensor(soapAddress);

    } catch (WSDLException e) {
        e.printStackTrace();
    }
}
 
Example 3
Source File: WSDLinaUDDIRegistryTest.java    From juddi with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void before() throws Exception {
        try {
                wsdlDefinition = rw.readWSDL("wsdl/sample.wsdl");
                wsdlDefinitionLongDescriptions = rw.readWSDL("wsdl/sample_1.wsdl");
                properties.put("keyDomain", "uddi.joepublisher.com");
                properties.put("businessName", "samplebusiness");
                properties.put("serverName", "api.example.org");
                properties.put("serverPort", "80");
                wsdlURL = wsdlDefinition.getDocumentBaseURI();
        } catch (WSDLException e) {
                e.printStackTrace();
                Assert.fail(e.getMessage());
        }
}
 
Example 4
Source File: Wsdl11AttachmentPolicyProviderTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void oneTimeSetUp() throws Exception {

    IMocksControl control = EasyMock.createNiceControl();
    Bus bus = control.createMock(Bus.class);
    WSDLManager manager = new WSDLManagerImpl();
    WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);
    DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
    EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andReturn(dfm).anyTimes();
    EasyMock.expect(dfm.getDestinationFactory(EasyMock.isA(String.class))).andReturn(null).anyTimes();
    BindingFactoryManager bfm = control.createMock(BindingFactoryManager.class);
    EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bfm).anyTimes();
    EasyMock.expect(bfm.getBindingFactory(EasyMock.isA(String.class))).andReturn(null).anyTimes();
    control.replay();

    int n = 19;
    services = new ServiceInfo[n];
    endpoints = new EndpointInfo[n];
    for (int i = 0; i < n; i++) {
        String resourceName = "/attachment/wsdl11/test" + i + ".wsdl";
        URL url = Wsdl11AttachmentPolicyProviderTest.class.getResource(resourceName);
        try {
            services[i] = builder.buildServices(manager.getDefinition(url.toString())).get(0);
        } catch (WSDLException ex) {
            ex.printStackTrace();
            fail("Failed to build service from resource " + resourceName);
        }
        assertNotNull(services[i]);
        endpoints[i] = services[i].getEndpoints().iterator().next();
        assertNotNull(endpoints[i]);
    }

    control.verify();

}
 
Example 5
Source File: WSDLDocCreator.java    From jolie with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void addOperationSOAPBinding( Definition localDef, Operation wsdlOp, Binding bind ) {
	try {
		// creating operation binding
		BindingOperation bindOp = localDef.createBindingOperation();
		bindOp.setName( wsdlOp.getName() );

		// adding soap extensibility elements
		SOAPOperation soapOperation = (SOAPOperation) extensionRegistry.createExtension( BindingOperation.class,
			new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "operation" ) );
		soapOperation.setStyle( "document" );
		// NOTA-BENE: Come settare SOAPACTION? jolie usa SOAP1.1 o 1.2? COme usa la SoapAction?
		soapOperation.setSoapActionURI( wsdlOp.getName() );
		bindOp.addExtensibilityElement( soapOperation );
		bindOp.setOperation( wsdlOp );

		// adding input
		BindingInput bindingInput = localDef.createBindingInput();
		SOAPBody body = (SOAPBody) extensionRegistry.createExtension( BindingInput.class,
			new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "body" ) );
		body.setUse( "literal" );
		bindingInput.addExtensibilityElement( body );
		bindOp.setBindingInput( bindingInput );

		// adding output
		BindingOutput bindingOutput = localDef.createBindingOutput();
		bindingOutput.addExtensibilityElement( body );
		bindOp.setBindingOutput( bindingOutput );

		// adding fault
		if( !wsdlOp.getFaults().isEmpty() ) {
			for( Object o : wsdlOp.getFaults().entrySet() ) {
				BindingFault bindingFault = localDef.createBindingFault();
				SOAPFault soapFault = (SOAPFault) extensionRegistry.createExtension( BindingFault.class,
					new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "fault" ) );
				soapFault.setUse( "literal" );
				String faultName = ((Entry) o).getKey().toString();
				bindingFault.setName( faultName );
				soapFault.setName( faultName );
				bindingFault.addExtensibilityElement( soapFault );
				bindOp.addBindingFault( bindingFault );
			}
		}

		bind.addBindingOperation( bindOp );

	} catch( WSDLException ex ) {
		ex.printStackTrace();
	}

}