Search in sources :

Example 56 with WSDLReader

use of javax.wsdl.xml.WSDLReader in project jbossws-cxf by jbossws.

the class JBWS2528TestCase method test.

@Test
@RunAsClient
public void test() throws Exception {
    File destDir = new File(TEST_DIR, "wsprovide" + FS + "java");
    String absOutput = destDir.getAbsolutePath();
    String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide" + EXT + " -k -w -o " + absOutput + " --classpath " + CLASSES_DIR + " " + ENDPOINT_CLASS;
    // wildfly9 security manager flag changed from -Djava.security.manager to -secmgr.
    // Can't pass -secmgr arg through arquillian because it breaks arquillian's
    // config of our tests.
    // the -secmgr flag MUST be provided as an input arg to jboss-modules so it must
    // come after the jboss-modules.jar ref.
    String additionalJVMArgs = System.getProperty("additionalJvmArgs", "");
    String securityManagerDesignator = additionalJVMArgs.replace("-Djava.security.manager", "-secmgr");
    File policyFile = new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2528/jbws2528-security.policy");
    String securityPolicyFile = " -Djava.security.policy=" + policyFile.getCanonicalPath();
    Map<String, String> env = new HashMap<>();
    env.put("JAVA_OPTS", securityManagerDesignator + securityPolicyFile);
    executeCommand(command, null, "wsprovide", env);
    URL wsdlURL = new File(destDir, "JBWS2528EndpointService.wsdl").toURI().toURL();
    WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
    Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
    PortType portType = wsdlDefinition.getPortType(new QName("http://jbws2528.jaxws.ws.test.jboss.org/", "JBWS2528Endpoint"));
    Operation op = (Operation) portType.getOperations().get(0);
    @SuppressWarnings("unchecked") List<String> parOrder = op.getParameterOrdering();
    assertEquals("id", parOrder.get(0));
    assertEquals("Name", parOrder.get(1));
    assertEquals("Employee", parOrder.get(2));
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) Definition(javax.wsdl.Definition) Operation(javax.wsdl.Operation) File(java.io.File) URL(java.net.URL) WSDLReader(javax.wsdl.xml.WSDLReader) PortType(javax.wsdl.PortType) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest)

Example 57 with WSDLReader

use of javax.wsdl.xml.WSDLReader in project jbossws-cxf by jbossws.

the class JBWS2960TestCase method getWSDLDefinition.

private Definition getWSDLDefinition(final String wsdlLocation) throws Exception {
    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
    return wsdlReader.readWSDL(null, wsdlLocation);
}
Also used : WSDLFactory(javax.wsdl.factory.WSDLFactory) WSDLReader(javax.wsdl.xml.WSDLReader)

Example 58 with WSDLReader

use of javax.wsdl.xml.WSDLReader in project jbossws-cxf by jbossws.

the class EarTestCase method getWSDLDefinition.

private Definition getWSDLDefinition(String wsdlLocation) throws Exception {
    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
    Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
    return definition;
}
Also used : WSDLFactory(javax.wsdl.factory.WSDLFactory) Definition(javax.wsdl.Definition) WSDLReader(javax.wsdl.xml.WSDLReader)

Example 59 with WSDLReader

use of javax.wsdl.xml.WSDLReader in project pentaho-kettle by pentaho.

the class Wsdl method getReader.

/**
 * Get a WSDLReader.
 *
 * @return WSDLReader.
 * @throws WSDLException
 *           on error.
 */
private WSDLReader getReader() throws WSDLException {
    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
    ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();
    wsdlReader.setExtensionRegistry(registry);
    wsdlReader.setFeature("javax.wsdl.verbose", true);
    wsdlReader.setFeature("javax.wsdl.importDocuments", true);
    return wsdlReader;
}
Also used : WSDLFactory(javax.wsdl.factory.WSDLFactory) WSDLReader(javax.wsdl.xml.WSDLReader) ExtensionRegistry(javax.wsdl.extensions.ExtensionRegistry)

Example 60 with WSDLReader

use of javax.wsdl.xml.WSDLReader in project pentaho-platform by pentaho.

the class AxisUtil method getWsdlDefinition.

public static Definition getWsdlDefinition(AxisConfiguration axisConfig, IServiceConfig webservice) throws Exception {
    String wsdlStr = getWsdl(axisConfig, webservice);
    InputStream in = new ByteArrayInputStream(wsdlStr.getBytes());
    InputSource source = new InputSource(in);
    WSDLFactoryImpl factory = new WSDLFactoryImpl();
    WSDLReader reader = factory.newWSDLReader();
    // $NON-NLS-1$
    Definition def = reader.readWSDL("", source);
    return def;
}
Also used : InputSource(org.xml.sax.InputSource) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) Definition(javax.wsdl.Definition) WSDLFactoryImpl(com.ibm.wsdl.factory.WSDLFactoryImpl) WSDLReader(javax.wsdl.xml.WSDLReader)

Aggregations

WSDLReader (javax.wsdl.xml.WSDLReader)60 Definition (javax.wsdl.Definition)35 WSDLFactory (javax.wsdl.factory.WSDLFactory)25 WSDLException (javax.wsdl.WSDLException)16 URL (java.net.URL)15 Test (org.junit.Test)13 Service (javax.wsdl.Service)8 File (java.io.File)7 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)7 JBossWSTest (org.jboss.wsf.test.JBossWSTest)7 Document (org.w3c.dom.Document)7 QName (javax.xml.namespace.QName)6 InputSource (org.xml.sax.InputSource)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 Bus (org.apache.cxf.Bus)5 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)5 APIMgtWSDLException (org.wso2.carbon.apimgt.impl.wsdl.exceptions.APIMgtWSDLException)5 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4