Package com.eviware.soapui.impl.wsdl

Examples of com.eviware.soapui.impl.wsdl.WsdlInterface


public class SoapHeadersRequestFilter extends AbstractRequestFilter {
    public void filterWsdlRequest(SubmitContext context, WsdlRequest wsdlRequest) {
        HttpRequest postMethod = (HttpRequest) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD);

        WsdlInterface wsdlInterface = (WsdlInterface) wsdlRequest.getOperation().getInterface();

        // init content-type and encoding
        String encoding = System.getProperty("soapui.request.encoding", wsdlRequest.getEncoding());

        SoapVersion soapVersion = wsdlInterface.getSoapVersion();
        String soapAction = wsdlRequest.isSkipSoapAction() ? null : wsdlRequest.getAction();

        postMethod.setHeader("Content-Type", soapVersion.getContentTypeHttpHeader(encoding, soapAction));

        if (!wsdlRequest.isSkipSoapAction()) {
View Full Code Here


        }
    }

    private final class OperationComboListener implements ItemListener {
        public void itemStateChanged(ItemEvent e) {
            WsdlInterface iface = (WsdlInterface) getModelItem().getMockService().getProject()
                    .getInterfaceByName(interfaceCombo.getSelectedItem().toString());
            WsdlOperation operation = iface.getOperationByName(operationCombo.getSelectedItem().toString());
            getModelItem().setOperation(operation);
        }
View Full Code Here

    protected void buildInterfaceSummary(MetricsSection section) {
        interfaceNameSet.clear();
        for (Interface ic : getModelItem().getInterfaceList()) {
            if (ic instanceof WsdlInterface) {
                WsdlInterface iface = (WsdlInterface) ic;
                section.addMetric(iface.getIcon(), iface.getName(), MetricType.URL).set(iface.getDefinition());
            } else if (ic instanceof RestService) {
                RestService iface = (RestService) ic;
                section.addMetric(iface.getIcon(), iface.getName(), MetricType.URL).set(iface.getWadlUrl());
            }

            interfaceNameSet.add(ic.getName());
        }
View Full Code Here

public class WsdlInterfaceFactory implements InterfaceFactory<WsdlInterface> {
    public final static String WSDL_TYPE = "wsdl";
    private final static Logger log = Logger.getLogger(WsdlInterfaceFactory.class);

    public WsdlInterface build(WsdlProject project, InterfaceConfig config) {
        return new WsdlInterface(project, (WsdlInterfaceConfig) config.changeType(WsdlInterfaceConfig.type));
    }
View Full Code Here

    public WsdlInterface build(WsdlProject project, InterfaceConfig config) {
        return new WsdlInterface(project, (WsdlInterfaceConfig) config.changeType(WsdlInterfaceConfig.type));
    }

    public WsdlInterface createNew(WsdlProject project, String name) {
        WsdlInterface iface = new WsdlInterface(project, (WsdlInterfaceConfig) project.getConfig().addNewInterface()
                .changeType(WsdlInterfaceConfig.type));
        iface.setName(name);

        return iface;
    }
View Full Code Here

        WsdlOperation operation = mock(WsdlOperation.class);

        BindingOperation bindingOperation = mock(BindingOperation.class);
        when(operation.getBindingOperation()).thenReturn(bindingOperation);

        WsdlInterface wsdlInterface = createWsdlInterface();
        when(operation.getInterface()).thenReturn(wsdlInterface);
        return operation;
    }
View Full Code Here

        when(operation.getInterface()).thenReturn(wsdlInterface);
        return operation;
    }

    public WsdlInterface createWsdlInterface() throws Exception {
        WsdlInterface wsdlInterface = mock(WsdlInterface.class);
        when(wsdlInterface.getSoapVersion()).thenReturn(SoapVersion.Soap12);

        WsdlContext wsdlContext = createWsdlContext();
        when(wsdlInterface.getWsdlContext()).thenReturn(wsdlContext);

        return wsdlInterface;
    }
View Full Code Here

    public static WsdlOperation makeWsdlOperation() throws SoapUIException {
        return new WsdlOperation(makeWsdlInterface(), OperationConfig.Factory.newInstance());
    }

    private static WsdlInterface makeWsdlInterface() throws SoapUIException {
        return new WsdlInterface(makeWsdlProject(), WsdlInterfaceConfig.Factory.newInstance());
    }
View Full Code Here

    }

    private DefinitionContext<?> getWsdlContext(WsdlMessageExchange messageExchange, SubmitContext context)
            throws Exception {
        WsdlOperation operation = messageExchange.getOperation();
        WsdlInterface iface = operation.getInterface();
        String def = PathUtils.expandPath(definition, iface, context);
        if (StringUtils.isNullOrEmpty(def) || def.equals(iface.getDefinition())) {
            definitionContext = (iface).getWsdlContext();
            definitionContext.loadIfNecessary();
        } else {
            if (definitionContext == null || !def.equals(wsdlContextDef)) {
                definitionContext = getContext(def, iface.getSoapVersion());
                // ( (WsdlContext) definitionContext ).load();
                ((WsdlContext) definitionContext).setInterface(iface);
                wsdlContextDef = def;
            }
        }
View Full Code Here

    @SuppressWarnings("unchecked")
    public WsdlInterface importBinding(WsdlProject project, WsdlContext wsdlContext, Binding binding) throws Exception {
        String name = project.getSettings().getBoolean(WsdlSettings.NAME_WITH_BINDING) ? binding.getQName()
                .getLocalPart() : binding.getPortType().getQName().getLocalPart();

        WsdlInterface iface = (WsdlInterface) project.addNewInterface(name, WsdlInterfaceFactory.WSDL_TYPE);
        iface.setBindingName(binding.getQName());
        iface.setSoapVersion(SoapVersion.Soap11);

        String[] endpoints = WsdlUtils.getEndpointsForBinding(wsdlContext.getDefinition(), binding);
        for (int i = 0; i < endpoints.length; i++) {
            log.info("importing endpoint " + endpoints[i]);
            iface.addEndpoint(endpoints[i]);
        }

        List<BindingOperation> list = binding.getBindingOperations();
        Collections.sort(list, new BindingOperationComparator());

        for (Iterator<BindingOperation> iter = list.iterator(); iter.hasNext(); ) {
            BindingOperation operation = iter.next();

            // sanity check
            if (operation.getOperation() == null || operation.getOperation().isUndefined()) {
                log.error("BindingOperation [" + operation.getName() + "] is missing or referring to an invalid operation");
            } else {
                log.info("importing operation " + operation.getName());
                iface.addNewOperation(operation);
            }
        }
        // PolicyUtils.getPolicies(wsdlContext);
        initWsAddressing(binding, iface, wsdlContext.getDefinition());
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.WsdlInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.