public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {
    // Load the URL
    //
    setUrl( XMLHandler.getTagValue( stepnode, "wsURL" ) );

    // Load the operation
    //
    setOperationName( XMLHandler.getTagValue( stepnode, "wsOperation" ) );
    setOperationRequestName( XMLHandler.getTagValue( stepnode, "wsOperationRequest" ) );
    setOperationNamespace( XMLHandler.getTagValue( stepnode, "wsOperationNamespace" ) );
    setInFieldContainerName( XMLHandler.getTagValue( stepnode, "wsInFieldContainer" ) );
    setInFieldArgumentName( XMLHandler.getTagValue( stepnode, "wsInFieldArgument" ) );
    setOutFieldContainerName( XMLHandler.getTagValue( stepnode, "wsOutFieldContainer" ) );
    setOutFieldArgumentName( XMLHandler.getTagValue( stepnode, "wsOutFieldArgument" ) );
    setProxyHost( XMLHandler.getTagValue( stepnode, "proxyHost" ) );
    setProxyPort( XMLHandler.getTagValue( stepnode, "proxyPort" ) );
    setHttpLogin( XMLHandler.getTagValue( stepnode, "httpLogin" ) );
    setHttpPassword( XMLHandler.getTagValue( stepnode, "httpPassword" ) );
    setCallStep( Const.toInt( XMLHandler.getTagValue( stepnode, "callStep" ), DEFAULT_STEP ) );
    setPassingInputData( "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "passingInputData" ) ) );
    String compat = XMLHandler.getTagValue( stepnode, "compatible" );
    setCompatible( Utils.isEmpty( compat ) || "Y".equalsIgnoreCase( compat ) );
    setRepeatingElementName( XMLHandler.getTagValue( stepnode, "repeating_element" ) );
    setReturningReplyAsString( "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "reply_as_string" ) ) );

    // Load the input fields mapping
    //
    getFieldsIn().clear();
    Node fields = XMLHandler.getSubNode( stepnode, "fieldsIn" );
    int nrfields = XMLHandler.countNodes( fields, "field" );

    for ( int i = 0; i < nrfields; ++i ) {
      Node fnode = XMLHandler.getSubNodeByNr( fields, "field", i );

      WebServiceField field = new WebServiceField();
      field.setName( XMLHandler.getTagValue( fnode, "name" ) );
      field.setWsName( XMLHandler.getTagValue( fnode, "wsName" ) );
      field.setXsdType( XMLHandler.getTagValue( fnode, "xsdType" ) );
      getFieldsIn().add( field );

    }

    // Load the output fields mapping
    //
    getFieldsOut().clear();

    fields = XMLHandler.getSubNode( stepnode, "fieldsOut" );
    nrfields = XMLHandler.countNodes( fields, "field" );

    for ( int i = 0; i < nrfields; ++i ) {
      Node fnode = XMLHandler.getSubNodeByNr( fields, "field", i );

      WebServiceField field = new WebServiceField();
      field.setName( XMLHandler.getTagValue( fnode, "name" ) );
      field.setWsName( XMLHandler.getTagValue( fnode, "wsName" ) );
      field.setXsdType( XMLHandler.getTagValue( fnode, "xsdType" ) );
      getFieldsOut().add( field );
    }
  }
@Test
  public void testLoadXml() throws Exception {
    Node node = getTestNode();
    DatabaseMeta dbMeta = mock( DatabaseMeta.class );
    IMetaStore metastore = mock( IMetaStore.class );
    WebServiceMeta webServiceMeta = new WebServiceMeta( node, Collections.singletonList( dbMeta ), metastore );
    assertEquals( "httpUser", webServiceMeta.getHttpLogin() );
    assertEquals( "tryandguess", webServiceMeta.getHttpPassword() );
    assertEquals( "http://webservices.gama-system.com/exchangerates.asmx?WSDL", webServiceMeta.getUrl() );
    assertEquals( "GetCurrentExchangeRate", webServiceMeta.getOperationName() );
    assertEquals( "opRequestName", webServiceMeta.getOperationRequestName() );
    assertEquals( "GetCurrentExchangeRateResult", webServiceMeta.getOutFieldArgumentName() );
    assertEquals( "aProxy", webServiceMeta.getProxyHost() );
    assertEquals( "4444", webServiceMeta.getProxyPort() );
    assertEquals( 1, webServiceMeta.getCallStep() );
    assertFalse( webServiceMeta.isPassingInputData() );
    assertTrue( webServiceMeta.isCompatible() );
    assertFalse( webServiceMeta.isReturningReplyAsString() );
    List<WebServiceField> fieldsIn = webServiceMeta.getFieldsIn();
    assertEquals( 3, fieldsIn.size() );
    assertWebServiceField( fieldsIn.get( 0 ), "Bank", "strBank", "string", 2 );
    assertWebServiceField( fieldsIn.get( 1 ), "ToCurrency", "strCurrency", "string", 2 );
    assertWebServiceField( fieldsIn.get( 2 ), "Rank", "intRank", "int", 5 );
    List<WebServiceField> fieldsOut = webServiceMeta.getFieldsOut();
    assertEquals( 1, fieldsOut.size() );
    assertWebServiceField(
      fieldsOut.get( 0 ), "GetCurrentExchangeRateResult", "GetCurrentExchangeRateResult", "decimal", 6 );
    WebServiceMeta clone = webServiceMeta.clone();
    assertNotSame( clone, webServiceMeta );
    assertEquals( clone.getXML(), webServiceMeta.getXML() );
  }