Ejemplo n.º 1
0
void Compiler::parse( const QDomElement &element )
{
  NSManager namespaceManager;
  MessageHandler messageHandler;
  ParserContext context;
  context.setNamespaceManager( &namespaceManager );
  context.setMessageHandler( &messageHandler );
  context.setDocumentBaseUrl( Settings::self()->wsdlBaseUrl() );

  Definitions definitions;
  definitions.setWantedService( Settings::self()->wantedService() );
  if ( definitions.loadXML( &context, element, Settings::self()->ignoreSslErrors() ) ) {

      KODE::Code::setDefaultIndentation( 4 );

      WSDL wsdl;
      wsdl.setDefinitions( definitions );
      wsdl.setNamespaceManager( namespaceManager );

      KWSDL::Converter converter;
      converter.setWSDL( wsdl );

      if ( !converter.convert() ) {
          QCoreApplication::exit( 4 );
      } else {
          KWSDL::Creator creator;
          creator.create( converter.classes() );
          QCoreApplication::exit( 0 );
      }
  } else {
      QCoreApplication::exit( 3 );
  }
}
Ejemplo n.º 2
0
void Compiler::create()
{
    KWSDL::Converter converter;
    converter.setWSDL(mParser.wsdl());

    converter.convert();

    KWSDL::Creator creator;
    creator.setOutputDirectory(mOutputDirectory);
    creator.setNameSpace(mNameSpace);
    creator.create(converter.classes());

    qApp->quit();
}