예제 #1
0
파일: compiler.cpp 프로젝트: fstbl/KDSoap
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 );
  }
}
예제 #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();
}