cancel
Showing results for 
Search instead for 
Did you mean: 

Change web service connection

Former Member
0 Kudos

Hello,

I'm using the Crystal Reports Java runtime of Crystal Reports for Eclipse (JRC 2.0.11, normal Java code, no JSP) and trying to change a web service connection during runtime. Some time ago, I had a similar issue changing JDBC connections (see [;).

The original data source has been specified during design time of the report and points for example to the WSDL "http://192.168.0.10:8080/axis2/services/ExampleService?wsdl". During runtime, I'm trying to change the data source for example to "http://192.168.0.20:8080/axis2/services/ExampleService?wsdl". Here's my code snippet:

ITable newTable = null;
for (final ITable oldTable : database.getTables()) {
    newTable = (ITable) oldTable.clone(true);

    // Create new connection properties.
    final PropertyBag newConnectionProperties = new PropertyBag();
    newConnectionProperties.put("Database DLL"                   , "crdb_xml.dll");
    newConnectionProperties.put("Server Name"                    , "http://192.168.0.20:8080/axis2/services/ExampleService?wsdl ExampleService ExamplePort ExampleMethod");
    newConnectionProperties.put("Server Type"                    , "XML");
    newConnectionProperties.put("PreQEServerName"                , "http://192.168.0.20:8080/axis2/services/ExampleService?wsdl ExampleService ExamplePort ExampleMethod");
    newConnectionProperties.put("Http WebService URL"            , "http://192.168.0.20:8080/axis2/services/ExampleService?wsdl");
    newConnectionProperties.put("List Methods"                   , "ExampleMethod");
    newConnectionProperties.put("List Ports"                     , "ExamplePort");
    newConnectionProperties.put("List Services"                  , "ExampleService");
    newConnectionProperties.put("UserID Http(s) WebService"      , "USER");
    newConnectionProperties.put("Web Service Authentication User", "PASSWORD");

    // Create new connection info object.
    final IConnectionInfo newConnectionInfo = new ConnectionInfo();
    newConnectionInfo.setAttributes(newConnectionProperties);
    newConnectionInfo.setKind(ConnectionInfoKind.SQL);
    newConnectionInfo.setUserName("USER");
    newConnectionInfo.setPassword("PASSWORD");

    // Replace web service connection.
    newTable.setConnectionInfo(newConnectionInfo);
    databaseController.setTableLocation(oldTable, newTable);
}

The problem is, that Crystal Reports always connects to the data source specified during design time of the report. I've tried several approaches but nothing has solved the problem (for example using replaceConnection instead of setTableLocation). If you have any hints or ideas I would be very grateful!

Thanks in Advance!

Robin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

No ideas?

former_member450831
Discoverer
0 Kudos

Hi Robin,

I have the same problem. Do you have any new understandings?