cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Sybase ESP - Error: Invalid URI at Example: Using a Simple Web Services (SOAP) Input Adapter

Former Member
0 Kudos

Hello all,

we need our help regarding the StockTrader example project that is delivered with SAP Sybase Event Stream Processor (Sybase ESP 5.1).

we want to build a simple Web Service and follow the instructions as described in the Sybase Infocenter. We have attached a screenshot ("Sybase InfoCenter") that contains the described steps (as copying the URL always lead to a wrong page).

We have problems with Step 10 ("Start the ESP project by running the start_project.bat or start_project.sh script."). We get the error message "Invalid URI" as you can see in screenshot "[error] Invalid Uri". Previously we started the "start_node.bat" (Step 9) - see also screenshot "[error] Invalid Uri".


Like in steps 6 and 7 mentioned, we have changed the parameters "USER" and "PASSWORD" of the adapter_config.xml files and the parameters "ADAPTER_EXAMPLE_USERNAME"and "ADAPTER_EXAMPLE_PASSWORD" of the

set_example_env.bat files. Here, we were a bit confused wether we should change these parameters in all those files as there are 4 adapter_config.xml and 4 set_example_env.bat files. Please refer to the attached screenshot ("changed files").


Does anyone know why this error occurs and how to continue to complete the Web Service?


Later we want to push data with this Web Service into a SAP HANA database table.


We are thankful for any input and help.


Regards, Andreas



Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Unless you changed the user name and password of the example cluster in %ESP_HOME%\cluster\examples, they should be set as follows in "set_example_env.bat" and "adapter_config.xml":

  • User name = sybase
  • Password = sybase

NOTE: You should only have to change the "set_example_env.bat" and "adapter_config.xml" of the example you are running.  So in your case it looks like you are running the "input" example and should only have to change those two files.

As far as the specific error about an invalid URI, I can't tell what the URI was set to.  When you call "start_project.bat", this file calls three other scripts:

     call "%ADAPTER_EXAMPLE_BIN%\compile.bat"

     call "%ADAPTER_EXAMPLE_BIN%\add_project.bat"

     call "%ADAPTER_EXAMPLE_BIN%\start_project.bat"

(these should all be found in %ESP_HOME%\adapters\webservices\examples\bin)

Edit each of these files and turn the echo on and rerun "start_project.bat" so we can see the output:

     @echo on

Thanks,

  Neal

Former Member
0 Kudos

Hello Neal,

thanks a lot for your fast reply. Your answer helped us, simply changing the username and password to 'sybase' made the project run and we can see now that data is generated.

But we have a next question and hope that you can help us again.

We are trying to get the data of the webservice into an InputStream or InputWindow in Sybase ESP Studio but after compiling and running the project, no data is displayed in the stream.

In the attached file ("adapter properties") you can see our project in Sybase ESP Studio and the parameters of the WebService.

We are not sure if the parameters like "Discovery Working Directory" have the correct path.

Moreover, you find the console output in the file "bat-files". Here we get some warnings like "The server localhost failed to respond".

Finally, in the attached screenshot ("run project") you can see that we get no data in the InputStream in ESP Studio and also the log output in the ESP Studio console.

Sorry to bother you again.

Thanks for your effort and help,

Andreas

Former Member
0 Kudos

Hello,

In the future, if you could start a new post with each question, it helps other users find answers quicker.  It makes it more difficult to find an answer when we just keep appending on to a post.

I have filed the following bug for this issue:

    766294 - Web Services SOAP adapter does not work in managed mode

The work around is to edit %ESP_HOME%\adapters\webservices\examples\input\adapter_config.xml and make the following two changes:

1) Comment out the following two lines:

    <Module type="espconnector">

      <InstanceName>StockTraderServicePublisher</InstanceName>

      <Name>EspPublisher</Name>

      <Parameters>

        <EspPublisherParameters>

    <!--Uncomment the following 2 elements when you use 'start_adapter[.bat|.sh]' -->

          <!--ProjectName>StockTraderProject</ProjectName-->

          <!--StreamName>tradesIn</StreamName-->

        </EspPublisherParameters>

      </Parameters>

    </Module>

  </Modules>

2) The full path must be specified to the 'mappingFile' parameter:

<mappingFile>C:/ESP51/ESP-5_1/adapters/webservices/examples/input/stockTraderMappings.xml</mappingFile>

Then try the following CCL in your project and it will work:

CREATE SCHEMA tradesSchema (
buyerId INTEGER,
sellerId INTEGER,
supervisorId INTEGER,
tradeTime LONG,
amount INTEGER,
price FLOAT,
symbol STRING
);

CREATE INPUT STREAM tradesIn SCHEMA tradesSchema;

CREATE OUTPUT STREAM tradesOut SCHEMA tradesSchema
AS SELECT * FROM tradesIn;

/*
* mapFilePath is currently ignored and must be set via the mappingFile configuration parameter
* in the given adapter configuration file (configFilePath).
*/
ATTACH INPUT ADAPTER Web_Services__SOAP__Input__external_1 TYPE soapinput TO tradesIn PROPERTIES
configFilePath = 'C:/ESP51/ESP-5_1/adapters/webservices/examples/input/adapter_config.xml' ,
mapFilePath = 'C:/ESP51/ESP-5_1/adapters/webservices/examples/input/stockTraderMappings.xml' ,
jdkHome = 'C:/Program Files/Java/jdk' ,
discoveryWsdl = 'http://localhost:8080/axis2/services/StockTraderService?wsdl' ,
discoveryWorkingDir = 'C:/temp/webservices_example' ,
discoveryServiceName = 'StockTraderService' ;

Former Member
0 Kudos

Hi Neal,

thanks for your reply. We tried all possible combinations of values for the path variables but we receive only "NULL" data in the console ouput of Sybase ESP Studio (see screenshot "console output). In the attachement you find our adapter_config.xml file where we uncommented these lines

(<!--ProjectName>StockTraderProject</ProjectName-->

<!--StreamName>tradesIn</StreamName-->).

Do you know what the problem could be? Thanks...

This is our ccl Code:

CREATE SCHEMA tradesSchema (

    buyerId INTEGER,

    sellerId INTEGER,

    supervisorId INTEGER,

    tradeTime LONG,

    amount INTEGER,

    price FLOAT,

    symbol STRING

);

CREATE INPUT STREAM tradesIn SCHEMA tradesSchema;

CREATE OUTPUT STREAM tradesOut SCHEMA tradesSchema

     AS  SELECT * FROM tradesIn;

/*

* mapFilePath is currently ignored and must be set via the mappingFile configuration parameter

* in the given adapter configuration file (configFilePath).

*/

ATTACH INPUT ADAPTER Web_Services_SOAP_Input_Adapter TYPE soapinput TO tradesIn PROPERTIES configFilePath =

'C:/Sybase/ESP-5_1/adapters/webservices/examples/input/adapter_config.xml' ,

mapFilePath = 'C:/Sybase/ESP-5_1/adapters/webservices/examples/input/stockTraderMappings.xml' ,

jdkHome = 'C:/Software/Java/jdk' ,

discoveryWsdl = 'http://localhost:8080/axis2/services/StockTraderService?wsdl' ,

discoveryWorkingDir = 'C:/tmp/adapter/soap' ,

discoveryServiceName = 'StockTraderService' ;

Former Member
0 Kudos

Hello,

I'm not sure.  I think we need see the adapter's and the project's log files.  I'm not sure which cluster you are running the project in so there are a number of places to look for the log files.

1) Local cluster (started in Studio and listening to port 9786):

* C:\Users\<user_name>\Documents\SybaseESP\5.1\workspace\default.webservices_input_example.0\logs\frameworkadapter.log
* C:\Users\I825186\Documents\SybaseESP\5.1\workspace\default.webservices_input_example.0\esp_server.log


2) Remote cluster (started at command line using the %ESP_HOME%\cluster\nodes\node1\node1.xml cluster configuration file):

* %ESP_HOME%\cluster\projects\test-name-1\default.webservices_input_example.0\logs\frameworkadapter.log
* %ESP_HOME%\cluster\projects\test-name-1\default.webservices_input_example.0\esp_server.log


3) Example cluster (started at command line using the %ESP_HOME%\cluster\examples\node1.xml file):

* %ESP_HOME%\cluster\examples\projects\default.webservices_input_example.0\logs\frameworkadapter.log
* %ESP_HOME%\cluster\examples\projects\default.webservices_input_example.0\esp_server.log

Thanks,

  Neal

Former Member
0 Kudos

Hi Neal,

thanks for you reply.

We have uploaded all logfiles we could find to dropbox (as we can only attach 3 files here).

The Link is: Dropbox - SAP Sybase ESP Logfiles 26.06.2014

At the following paths we can't find any logfiles:

* %ESP_HOME%\cluster\projects\test-name-1\default.webservices_input_example.0\logs\frameworkadapter.log

* %ESP_HOME%\cluster\projects\test-name-1\default.webservices_input_example.0\esp_server.log

* %ESP_HOME%\cluster\examples\projects\default.webservices_input_example.0\logs\frameworkadapter.log

I hope the logfiles can help us in any way as it is difficult to find support or descriptions in any SAP Sybase ESP documents or Sybase InfoCenter.

Regards, Andreas

PS: You can also write us an email to maik.hofman@contrimo.com if its easier for you with regard to exchanging required files.

Former Member
0 Kudos

Hello,

According to the frameworkadapter.log file the Web Services adapter published 36 rows to the "tradesIn" stream:

06-26-2014 08:06:54.470 INFO [Thread-24] (EspPublisher.stop) Publisher of stream tradesIn is stopped

06-26-2014 08:06:54.671 INFO [Thread-24] (EspPublisher.stop) Totally 36 rows are published by module StockTraderServicePublisher, 36 success.

I'm wondering if this is a display problem with Studio?  Have you completely shutdown Studio recently?


Or there might be an orphaned "esp_server.exe" process causing interference.

Try shutting down Studio.  Look for any "esp*.exe" processes in Windows Explorer and kill them.

Restart Studio.

Restart your project.

From a DOS Command line prompt subscribe to the project:

   esp_subscribe -c studio:studio -p localhost:9786/default/ws -s tradesIn

(-c parameter is user:password)

If this does not resolve the problem, we might need to arrange a desktop sharing session.

Thanks,

Neal

Former Member
0 Kudos

Hi Neal,

thanks for the help, that's really friendly. We would like to do the desktop sharing session as after hours of trying we can't proceed and still only receive "NULL" values in Sybase ESP Studio console. Also after pushing the data into a HANA database table the data is "?", so we assume it may not be a display error. Moreover we were not able to execute the " esp_subscribe -c sybase:sybase-p localhost:9786/default/ws -s tradesIn" command (we don't know to which folder we have to move).

Our email adress is: maik.hofmann@contrimo.com

We have Webex, TeamViewer, Sykpe, how would you like to continue? You can write us an email on which day and which time it is possible for you?

Regards, Andreas and Maik.

Former Member
0 Kudos

Hello Neal,

thanks a lot for your help.

The solution for us was to change the column names inside Sybase ESP Studio to the column names in StockTraderMappings.xml.

After compiling and running the project we could see the data and were also able to push it to SAP HANA.

This is the CCL Code that worked for us:

CREATE SCHEMA tradesSchema (

    transaction_buyerId INTEGER,

    transaction_sellerId INTEGER,

    transaction_supervisorIds INTEGER,

    transaction_tradeTime LONG,

    transaction_trades_amount INTEGER,

    transaction_trades_price FLOAT,

    transaction_trades_symbol STRING

);

CREATE INPUT STREAM tradesIn SCHEMA tradesSchema;

CREATE OUTPUT STREAM tradesOut SCHEMA tradesSchema

     AS  SELECT * FROM tradesIn;

/*

* mapFilePath is currently ignored and must be set via the mappingFile configuration parameter

* in the given adapter configuration file (configFilePath).

*/

ATTACH INPUT ADAPTER Web_Services_SOAP_Input_Adapter TYPE soapinput TO tradesIn PROPERTIES configFilePath =

'C:/Sybase/ESP-5_1/adapters/webservices/examples/input/adapter_config.xml' ,

mapFilePath = 'C:/Sybase/ESP-5_1/adapters/webservices/examples/input/stockTraderMappings.xml' ,

jdkHome = 'C:/Software/Java/jdk' ,

discoveryWsdl = 'http://localhost:8080/axis2/services/StockTraderService?wsdl' ,

discoveryWorkingDir = 'C:/tmp/adapter/soap' ,

discoveryServiceName = 'StockTraderService' ;


Regards, Andreas and Maik

Answers (0)