@Override
  public void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
    // Input rows and output rows are different in the webservice step
    //
    if ( !isPassingInputData() ) {
      r.clear();
    }

    // Add the output fields...
    //
    for ( WebServiceField field : getFieldsOut() ) {
      int valueType = field.getType();

      // If the type is unrecognized we give back the XML as a String...
      //
      if ( field.getType() == ValueMetaInterface.TYPE_NONE ) {
        valueType = ValueMetaInterface.TYPE_STRING;
      }

      try {
        ValueMetaInterface vValue = ValueMetaFactory.createValueMeta( field.getName(), valueType );
        vValue.setOrigin( name );
        r.addValueMeta( vValue );
      } catch ( Exception e ) {
        throw new KettleStepException( e );
      }
    }
  }
@Test
  public void testGetFields() throws Exception {
    WebServiceMeta webServiceMeta = new WebServiceMeta();
    webServiceMeta.setDefault();
    RowMetaInterface rmi = mock( RowMetaInterface.class );
    RowMetaInterface rmi2 = mock( RowMetaInterface.class );
    StepMeta nextStep = mock( StepMeta.class );
    IMetaStore metastore = mock( IMetaStore.class );
    Repository rep = mock( Repository.class );
    WebServiceField field1 = new WebServiceField();
    field1.setName( "field1" );
    field1.setWsName( "field1WS" );
    field1.setXsdType( "string" );
    WebServiceField field2 = new WebServiceField();
    field2.setName( "field2" );
    field2.setWsName( "field2WS" );
    field2.setXsdType( "string" );
    WebServiceField field3 = new WebServiceField();
    field3.setName( "field3" );
    field3.setWsName( "field3WS" );
    field3.setXsdType( "string" );
    webServiceMeta.setFieldsOut( Arrays.asList( field1, field2, field3 ) );
    webServiceMeta.getFields( rmi, "idk", new RowMetaInterface[]{ rmi2 }, nextStep, new Variables(), rep, metastore );
    verify( rmi ).addValueMeta( argThat( matchValueMetaString( "field1" ) ) );
    verify( rmi ).addValueMeta( argThat( matchValueMetaString( "field2" ) ) );
    verify( rmi ).addValueMeta( argThat( matchValueMetaString( "field3" ) ) );
  }