cancel
Showing results for 
Search instead for 
Did you mean: 

Problem NWDS 7.3 - Adaptive WebService Model

Former Member
0 Kudos

Hello everybody !

I would like to post one problem concerning the implement of a new WSDL file in my NWDS 7.3 and have your feeling or your tips if you had already encountered this kind of error.

What i have done :

- I have tried to import a WSDL file in my NWDS 7.3 in order to create a new Adaptive webService Model.

I have already tested this WSDL file in SOAP UI and webMethods with a proxy filled and the webService is working correctly.

Once i have created my new Model (Name : DBI1Model), i have linked my Model with my component controller (AsegmentCust) in which i want to call the webService. (see screenshot below) :

You can see below in my Component controller context the model node linked with my Model :

In order to call the webService, i need to fill the following fields : CodigoConsulta, Senha, Usuario and Valor1.

Normally, i should receive a XML string in the field Return.

In my controller, you can find below the code that i have implement in order to call the WS :

//Creation of the model

DBI1Model dbi1Model = new DBI1Model();

manager.reportWarning("Step1");

// Instanciation of the model node

Request_ConsultaOnLine input = new Request_ConsultaOnLine(dbi1Model);

input.setUsuario("TEST");

input.setSenha("TEST");

input.setValor1("08090788000267");

input.setCodigoConsulta(3);

manager.reportWarning("Step 2");

wdContext.nodeRequest_ConsultaOnLine().bind(input);

try{

    manager.reportWarning("Step 3");

    input.execute();

          

    manager.reportWarning("Step 4");

}

catch(Exception e){

          

    manager.reportException(e);

    manager.reportWarning("Fail");

          

}

When i execute the application and try to call this WS, i have the result below :

Step 1

Step 2

Step 3

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Fail

Do you have an idea of the problem ?

Thanks,

Regards,

NIcolas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You need to look at the full Java stack trace to see where the IndexOutOfBoundsException is being thrown.  It looks like your "manager" object is limiting what you see as output - a full Java stack trace will show you what, when and where in your code went wront and this will no doubt help you to solve the problem.

As debugging WD Java app's is unnecessarily hard, what I do is use a MessageArea to display the full exception information on screen.

Apologies if this is stating the obvious but it would be my first step to resolve.

Cheers,

G.

Former Member
0 Kudos

Hello Ryan,

Thanks for your quick answer, i have put below the full Java Strack trace :

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

  at java.util.ArrayList.RangeCheck(ArrayList.java:547)

  at java.util.ArrayList.get(ArrayList.java:322)

  at com.sap.tc.cm.testmode.model.TestGenericModelClassExecutable.traverse(TestGenericModelClassExecutable.java:97)

  at com.sap.tc.cm.testmode.model.TestGenericModelClassExecutable.execute(TestGenericModelClassExecutable.java:71)

  at com.sap.tc.cm.testmode.gci.TestTypedModelClassExecutable.execute(TestTypedModelClassExecutable.java:39)

  at com.arcelormittal.vendormanagement.wd.models.dbi1model.Request_ConsultaOnLine.execute(Request_ConsultaOnLine.java:49)

  at com.arcelor.ramses.sda.ASegmentCust.ReadDBI(ASegmentCust.java:4022)

  at com.arcelor.ramses.sda.wdp.InternalASegmentCust.ReadDBI(InternalASegmentCust.java:1427

I have searched the TestGenericModelClassExecutable on google, but no clear explanations.

Thanks,

Regards,

Nicolas

Former Member
0 Kudos

Hi,

Does your webservice have a mandatory element to it?

Are you creating and binding all nodes in the context for the service call?

This is a simple error in Java terms but you need to find where the root cause is.  It looks to me that your code is expected to be able to loop over a collection of objects that is null or empty, hence the index out of bounds error.

Can you find a "Caused By..." entry in your stack trace?

Cheers,

G.

Former Member
0 Kudos

Hi,

I don't think that some elements are mandatory. When i test it directly from SOAP UI, i fill only 3 or 4 fields.

I have attached also the WSDL file, i don't know if can be useful.

I have searched in the JAVA stack trace the Caused by...but nothing interesting.

You can find also attached the entire stack trace.

Regards,

NIcolas

Former Member
0 Kudos

Hi,

One additionnal information, i don't know if the cardinality can be the problem.

Context properties for the Model Node (input) :

Context properties for the Output model node (Response) :

In the code, i have just implement the binding for Input model node :

DBI1Model dbi1Model = new DBI1Model();

Request_ConsultaOnLine input = new Request_ConsultaOnLine(dbi1Model);

input.setUsuario("arcelormittal");

input.setSenha("TEST");

input.setValor1(wdContext.currentASegContextElement().getStcd1());

input.setCodigoConsulta(3);

wdContext.nodeRequest_ConsultaOnLine().bind(input);

try{

     input.execute();

}

catch(WDWSModelExecuteException e){

           

      manager.reportException(e.getStackTraceString());

      manager.reportException(e.getMessage());           

}

Nicolas

Former Member
0 Kudos

Hi,

I have found the solution, it's very strange. I have tried to reimport the modelNode automatically.

I have found a tab named Test_Data with some values by default.

I have searched why i get this screen. I have checked the Model properties and there was a line Test Mode -> True.

I have put it as false and deploy the application again.

Now it's working fine.

Thanks for your help,

Regards,

NIcolas

Former Member
0 Kudos

Great - sometimes the world of SAP & Java is strange, very strange!

Glad you got it sorted.

Cheers,

G.