Search in sources :

Example 21 with Definition

use of javax.wsdl.Definition in project jbossws-cxf by jbossws.

the class WSDLFilePublisher method publishWsdlFiles.

/**
 * Publish the deployed wsdl file to the data directory
 */
public void publishWsdlFiles(QName serviceName, String wsdlLocation, Bus bus, List<ServiceInfo> serviceInfos) throws IOException {
    String deploymentName = dep.getCanonicalName();
    File wsdlFile = getPublishLocation(serviceName.getLocalPart(), deploymentName, wsdlLocation);
    if (wsdlFile == null)
        return;
    createParentDir(wsdlFile);
    try {
        // Write the wsdl def to file
        ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, serviceInfos);
        Definition def = builder.build();
        Document doc = getWsdlDocument(bus, def);
        writeDocument(doc, wsdlFile);
        URL wsdlPublishURL = new URL(URLDecoder.decode(wsdlFile.toURI().toURL().toExternalForm(), "UTF-8"));
        Loggers.DEPLOYMENT_LOGGER.wsdlFilePublished(wsdlPublishURL);
        // Process the wsdl imports
        if (def != null) {
            List<String> published = new LinkedList<String>();
            String expLocation = getExpLocation(wsdlLocation);
            publishWsdlImports(wsdlPublishURL, def, published, expLocation);
            // Publish XMLSchema imports
            publishSchemaImports(wsdlPublishURL, doc.getDocumentElement(), published, expLocation);
            dep.addAttachment(WSDLFilePublisher.class, this);
        } else {
            throw Messages.MESSAGES.wsdl20NotSupported();
        }
    } catch (RuntimeException rte) {
        throw rte;
    } catch (Exception e) {
        throw Messages.MESSAGES.cannotPublishWSDLTo(serviceName, wsdlFile, e);
    }
}
Also used : Definition(javax.wsdl.Definition) Document(org.w3c.dom.Document) File(java.io.File) URL(java.net.URL) LinkedList(java.util.LinkedList) XMLStreamException(javax.xml.stream.XMLStreamException) IOException(java.io.IOException) WSDLException(javax.wsdl.WSDLException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ServiceWSDLBuilder(org.apache.cxf.wsdl11.ServiceWSDLBuilder)

Example 22 with Definition

use of javax.wsdl.Definition in project jbossws-cxf by jbossws.

the class JBWS2150TestCase method testSecureRewriteOverriddenByForcedHttp.

/**
 * Test soap:address URL rewrite according to transport guarantee is overridden by forced http uri scheme
 *
 * @throws Exception
 */
@Test
@RunAsClient
public void testSecureRewriteOverriddenByForcedHttp() throws Exception {
    setModifySOAPAddress(true);
    setWebServiceUriScheme("http");
    setWebServicePort(80);
    deployer.deploy(DEP_SEC);
    try {
        final Map<String, String> wsdlLocationsSecMap = new HashMap<String, String>();
        final Map<String, String> importMap = new HashMap<String, String>();
        final String serverHost = getServerHost();
        final int serverPort = getServerPort();
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", getWebServiceHost());
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", getWebServiceHost());
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", getWebServiceHost());
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", getWebServiceHost());
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/ValidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/InvalidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl=inner.wsdl");
        if (isTestsuiteServerHostLocalhost()) {
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", getWebServiceHost());
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", getWebServiceHost());
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", getWebServiceHost());
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", getWebServiceHost());
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/ValidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/InvalidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", "http://" + getWebServiceHost() + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl=inner.wsdl");
        }
        for (Entry<String, String> entry : wsdlLocationsSecMap.entrySet()) {
            String wsdlLocationSec = entry.getKey();
            String host = entry.getValue();
            Definition definition = getWSDLDefinition(wsdlLocationSec);
            String address = getPortAddress(definition, "ValidURLService", "ValidURLPort");
            assertEquals("http://" + host + "/jaxws-jbws2150-sec/ValidURL", address);
            address = getPortAddress(definition, "InvalidURLService", "InvalidURLPort");
            assertEquals("http://" + host + "/jaxws-jbws2150-sec/InvalidURL", address);
            address = getPortAddress(definition, "ValidSecureURLService", "ValidSecureURLPort");
            assertEquals("http://" + host + "/jaxws-jbws2150-sec/ValidSecureURL", address);
            address = getPortAddress(definition, "InvalidSecureURLService", "InvalidSecureURLPort");
            assertEquals("http://" + host + "/jaxws-jbws2150-sec/InvalidSecureURL", address);
            // check wsdl import address rewrite (we expect a rewritten version of the same base address used to fetch the wsdl)
            assertEquals(importMap.get(wsdlLocationSec), getWsdlImportAddress(definition));
        }
    } finally {
        deployer.undeploy(DEP_SEC);
    }
}
Also used : HashMap(java.util.HashMap) Definition(javax.wsdl.Definition) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Example 23 with Definition

use of javax.wsdl.Definition in project jbossws-cxf by jbossws.

the class JBWS2150TestCase method testSecureRewrite.

/**
 * [JBWS-454] Test soap:address URL rewrite according to transport guarantee
 *
 * @throws Exception
 */
@Test
@RunAsClient
public void testSecureRewrite() throws Exception {
    setModifySOAPAddress(true);
    deployer.deploy(DEP_SEC);
    try {
        final Map<String, String> wsdlLocationsSecMap = new HashMap<String, String>();
        final Map<String, String> importMap = new HashMap<String, String>();
        final String serverHost = getServerHost();
        final int serverPort = getServerPort();
        // 8443 = 8080 + 363
        final int serverSecurePort = serverPort + 363;
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", getWebServiceHost());
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", getWebServiceHost());
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", getWebServiceHost());
        wsdlLocationsSecMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", getWebServiceHost());
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/ValidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/InvalidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl=inner.wsdl");
        if (isTestsuiteServerHostLocalhost()) {
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", getWebServiceHost());
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", getWebServiceHost());
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", getWebServiceHost());
            wsdlLocationsSecMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", getWebServiceHost());
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/ValidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/InvalidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/ValidSecureURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150-sec/InvalidSecureURL?wsdl=inner.wsdl");
        }
        for (Entry<String, String> entry : wsdlLocationsSecMap.entrySet()) {
            String wsdlLocationSec = entry.getKey();
            String host = entry.getValue();
            Definition definition = getWSDLDefinition(wsdlLocationSec);
            String address = getPortAddress(definition, "ValidURLService", "ValidURLPort");
            assertEquals("https://" + host + ":" + serverSecurePort + "/jaxws-jbws2150-sec/ValidURL", address);
            address = getPortAddress(definition, "InvalidURLService", "InvalidURLPort");
            assertEquals("https://" + host + ":" + serverSecurePort + "/jaxws-jbws2150-sec/InvalidURL", address);
            address = getPortAddress(definition, "ValidSecureURLService", "ValidSecureURLPort");
            assertEquals("https://" + host + ":" + serverSecurePort + "/jaxws-jbws2150-sec/ValidSecureURL", address);
            address = getPortAddress(definition, "InvalidSecureURLService", "InvalidSecureURLPort");
            assertEquals("https://" + host + ":" + serverSecurePort + "/jaxws-jbws2150-sec/InvalidSecureURL", address);
            // check wsdl import address rewrite (we expect a rewritten version of the same base address used to fetch the wsdl)
            assertEquals(importMap.get(wsdlLocationSec), getWsdlImportAddress(definition));
        }
    } finally {
        deployer.undeploy(DEP_SEC);
    }
}
Also used : HashMap(java.util.HashMap) Definition(javax.wsdl.Definition) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Example 24 with Definition

use of javax.wsdl.Definition in project jbossws-cxf by jbossws.

the class JBWS2150TestCase method testRewrite.

/**
 * Test soap:address rewrite with rewrite engine on
 *
 * @throws Exception
 */
@Test
@RunAsClient
public void testRewrite() throws Exception {
    setModifySOAPAddress(true);
    deployer.deploy(DEP);
    try {
        final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
        final Map<String, String> importMap = new HashMap<String, String>();
        final String serverHost = getServerHost();
        final int serverPort = getServerPort();
        // 8443 = 8080 + 363
        final int serverSecurePort = serverPort + 363;
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", getWebServiceHost());
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", getWebServiceHost());
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", getWebServiceHost());
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", getWebServiceHost());
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", "http://" + getWebServiceHost() + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", "http://" + getWebServiceHost() + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150/ValidSecureURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150/InvalidSecureURL?wsdl=inner.wsdl");
        if (isTestsuiteServerHostLocalhost()) {
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", getWebServiceHost());
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", getWebServiceHost());
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", getWebServiceHost());
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", getWebServiceHost());
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", "http://" + getWebServiceHost() + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", "http://" + getWebServiceHost() + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150/ValidSecureURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", "https://" + getWebServiceHost() + ":" + serverSecurePort + "/jaxws-jbws2150/InvalidSecureURL?wsdl=inner.wsdl");
        }
        for (Entry<String, String> entry : wsdlLocationsMap.entrySet()) {
            String wsdlLocation = entry.getKey();
            String host = entry.getValue();
            Definition definition = getWSDLDefinition(wsdlLocation);
            String address = getPortAddress(definition, "ValidURLService", "ValidURLPort");
            assertEquals("http://" + host + ":" + serverPort + "/jaxws-jbws2150/ValidURL", address);
            // avoid invoking on https endpoints as that would require getting the imported wsdl using https...
            if (!wsdlLocation.contains("Secure")) {
                ServiceIface endpoint = getEndpoint(wsdlLocation, "ValidURLService");
                assertEquals(endpoint.echo("hello"), "hello");
            }
            address = getPortAddress(definition, "InvalidURLService", "InvalidURLPort");
            assertEquals("http://" + host + ":" + serverPort + "/jaxws-jbws2150/InvalidURL", address);
            if (!wsdlLocation.contains("Secure")) {
                ServiceIface endpoint = getEndpoint(wsdlLocation, "InvalidURLService");
                assertEquals(endpoint.echo("hello"), "hello");
            }
            address = getPortAddress(definition, "ValidSecureURLService", "ValidSecureURLPort");
            assertEquals("https://" + host + ":" + serverSecurePort + "/jaxws-jbws2150/ValidSecureURL", address);
            address = getPortAddress(definition, "InvalidSecureURLService", "InvalidSecureURLPort");
            assertEquals("https://" + host + ":" + serverSecurePort + "/jaxws-jbws2150/InvalidSecureURL", address);
            // check wsdl import address rewrite (we expect a rewritten version of the same base address used to fetch the wsdl)
            assertEquals(importMap.get(wsdlLocation), getWsdlImportAddress(definition));
        }
    } finally {
        deployer.undeploy(DEP);
    }
}
Also used : HashMap(java.util.HashMap) Definition(javax.wsdl.Definition) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Example 25 with Definition

use of javax.wsdl.Definition in project jbossws-cxf by jbossws.

the class JBWS2150TestCase method testAutoRewrite.

/**
 * Test soap:address rewrite with rewrite engine on and the webServiceHost set to jbossws.undefined.host
 *
 * @throws Exception
 */
@Test
@RunAsClient
public void testAutoRewrite() throws Exception {
    setModifySOAPAddress(true);
    setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
    deployer.deploy(DEP);
    try {
        final Map<String, String> wsdlLocationsMap = new HashMap<String, String>();
        final Map<String, String> importMap = new HashMap<String, String>();
        final String serverHost = getServerHost();
        final int serverPort = getServerPort();
        // 8080 + 363 = 8443
        final int serverSecurePort = serverPort + 363;
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", serverHost);
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", serverHost);
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", serverHost);
        wsdlLocationsMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", serverHost);
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", "http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", "http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", "https://" + serverHost + ":" + serverSecurePort + "/jaxws-jbws2150/ValidSecureURL?wsdl=inner.wsdl");
        importMap.put("http://" + serverHost + ":" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", "https://" + serverHost + ":" + serverSecurePort + "/jaxws-jbws2150/InvalidSecureURL?wsdl=inner.wsdl");
        if (isTestsuiteServerHostLocalhost()) {
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", "127.0.0.1");
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", "127.0.0.1");
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", "127.0.0.1");
            wsdlLocationsMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", "127.0.0.1");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl", "http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl", "http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/ValidSecureURL?wsdl", "https://127.0.0.1:" + serverSecurePort + "/jaxws-jbws2150/ValidSecureURL?wsdl=inner.wsdl");
            importMap.put("http://127.0.0.1:" + serverPort + "/jaxws-jbws2150/InvalidSecureURL?wsdl", "https://127.0.0.1:" + serverSecurePort + "/jaxws-jbws2150/InvalidSecureURL?wsdl=inner.wsdl");
        }
        for (Entry<String, String> entry : wsdlLocationsMap.entrySet()) {
            String wsdlLocation = entry.getKey();
            String host = entry.getValue();
            Definition definition = getWSDLDefinition(wsdlLocation);
            String address = getPortAddress(definition, "ValidURLService", "ValidURLPort");
            assertEquals("http://" + host + ":" + serverPort + "/jaxws-jbws2150/ValidURL", address);
            address = getPortAddress(definition, "InvalidURLService", "InvalidURLPort");
            assertEquals("http://" + host + ":" + serverPort + "/jaxws-jbws2150/InvalidURL", address);
            // check wsdl import address rewrite (we expect a rewritten version of the same base address used to fetch the wsdl)
            if (!wsdlLocation.contains("Secure")) {
                assertEquals(importMap.get(wsdlLocation), getWsdlImportAddress(definition));
            }
        }
    } finally {
        deployer.undeploy(DEP);
    }
}
Also used : HashMap(java.util.HashMap) Definition(javax.wsdl.Definition) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Aggregations

Definition (javax.wsdl.Definition)226 Test (org.junit.Test)113 QName (javax.xml.namespace.QName)61 File (java.io.File)52 Document (org.w3c.dom.Document)44 Element (org.w3c.dom.Element)40 HashMap (java.util.HashMap)36 WSDLReader (javax.wsdl.xml.WSDLReader)35 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)31 JBossWSTest (org.jboss.wsf.test.JBossWSTest)31 Service (javax.wsdl.Service)24 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)23 URL (java.net.URL)21 ArrayList (java.util.ArrayList)21 Port (javax.wsdl.Port)21 WSDLToIDLAction (org.apache.cxf.tools.corba.processors.wsdl.WSDLToIDLAction)21 Bus (org.apache.cxf.Bus)20 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)20 WSDLManager (org.apache.cxf.wsdl.WSDLManager)20 IOException (java.io.IOException)18