@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: 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() ); }
public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { setUrl( XMLHandler.getTagValue( stepnode, "wsURL" ) ); 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" ) ) ); 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 ); } 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 ); } }
WebServiceMeta extends BaseStepMeta implements StepMetaInterface { public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { setUrl( XMLHandler.getTagValue( stepnode, "wsURL" ) ); 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" ) ) ); 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 ); } 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 ); } } }
WebServiceMeta extends BaseStepMeta implements StepMetaInterface { public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { setUrl( XMLHandler.getTagValue( stepnode, "wsURL" ) ); 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" ) ) ); 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 ); } 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 ); } } WebServiceMeta();  WebServiceMeta( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore );  WebServiceMeta( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); }
WebServiceMeta extends BaseStepMeta implements StepMetaInterface { public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { setUrl( XMLHandler.getTagValue( stepnode, "wsURL" ) ); 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" ) ) ); 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 ); } 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 ); } } WebServiceMeta();  WebServiceMeta( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore );  WebServiceMeta( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); WebServiceMeta clone(); void setDefault(); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); String getXML(); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); String getOperationName(); void setOperationName( String operationName ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans disp ); StepDataInterface getStepData(); WebServiceField getFieldInFromName( String name ); WebServiceField getFieldOutFromWsName( String wsName, boolean ignoreWsNsPrefix ); List<WebServiceField> getFieldsIn(); void setFieldsIn( List<WebServiceField> fieldsIn ); boolean hasFieldsIn(); void addFieldIn( WebServiceField field ); List<WebServiceField> getFieldsOut(); void setFieldsOut( List<WebServiceField> fieldsOut ); void addFieldOut( WebServiceField field ); String getInFieldArgumentName(); void setInFieldArgumentName( String inFieldArgumentName ); String getOutFieldArgumentName(); void setOutFieldArgumentName( String outFieldArgumentName ); String getUrl(); void setUrl( String url ); int getCallStep(); void setCallStep( int callStep ); String getOperationNamespace(); void setOperationNamespace( String operationNamespace ); String getHttpLogin(); void setHttpLogin( String httpLogin ); String getHttpPassword(); void setHttpPassword( String httpPassword ); String getProxyHost(); void setProxyHost( String proxyHost ); String getProxyPort(); void setProxyPort( String proxyPort ); String getInFieldContainerName(); void setInFieldContainerName( String inFieldContainerName ); String getOutFieldContainerName(); void setOutFieldContainerName( String outFieldContainerName ); boolean isPassingInputData(); void setPassingInputData( boolean passingInputData ); boolean isCompatible(); void setCompatible( boolean compatible ); String getRepeatingElementName(); void setRepeatingElementName( String repeatingElementName ); boolean isReturningReplyAsString(); void setReturningReplyAsString( boolean returningReplyAsString ); String getOperationRequestName(); void setOperationRequestName( String operationRequestName ); }
WebServiceMeta extends BaseStepMeta implements StepMetaInterface { public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { setUrl( XMLHandler.getTagValue( stepnode, "wsURL" ) ); 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" ) ) ); 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 ); } 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 ); } } WebServiceMeta();  WebServiceMeta( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore );  WebServiceMeta( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); WebServiceMeta clone(); void setDefault(); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); String getXML(); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); String getOperationName(); void setOperationName( String operationName ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans disp ); StepDataInterface getStepData(); WebServiceField getFieldInFromName( String name ); WebServiceField getFieldOutFromWsName( String wsName, boolean ignoreWsNsPrefix ); List<WebServiceField> getFieldsIn(); void setFieldsIn( List<WebServiceField> fieldsIn ); boolean hasFieldsIn(); void addFieldIn( WebServiceField field ); List<WebServiceField> getFieldsOut(); void setFieldsOut( List<WebServiceField> fieldsOut ); void addFieldOut( WebServiceField field ); String getInFieldArgumentName(); void setInFieldArgumentName( String inFieldArgumentName ); String getOutFieldArgumentName(); void setOutFieldArgumentName( String outFieldArgumentName ); String getUrl(); void setUrl( String url ); int getCallStep(); void setCallStep( int callStep ); String getOperationNamespace(); void setOperationNamespace( String operationNamespace ); String getHttpLogin(); void setHttpLogin( String httpLogin ); String getHttpPassword(); void setHttpPassword( String httpPassword ); String getProxyHost(); void setProxyHost( String proxyHost ); String getProxyPort(); void setProxyPort( String proxyPort ); String getInFieldContainerName(); void setInFieldContainerName( String inFieldContainerName ); String getOutFieldContainerName(); void setOutFieldContainerName( String outFieldContainerName ); boolean isPassingInputData(); void setPassingInputData( boolean passingInputData ); boolean isCompatible(); void setCompatible( boolean compatible ); String getRepeatingElementName(); void setRepeatingElementName( String repeatingElementName ); boolean isReturningReplyAsString(); void setReturningReplyAsString( boolean returningReplyAsString ); String getOperationRequestName(); void setOperationRequestName( String operationRequestName ); static final String XSD_NS_URI; static final int DEFAULT_STEP; }