cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a WebService on a Web Dynpro Project

luscruz
Participant
0 Kudos

Hi Experts,

I'd made an EJB, then a WebService of that.

I'd tested the url in a Browser, and everything works fine... I sent the values, and got the correct response.

Now i'm trying to call it in a Web Dynpro. I'd imported the model, added to the controller, generated a method and set all the values that the WS receive, however every time i execute an error occurs.

This is the error in Log Viewer:

com.sap.engine.services.webservices.addtions.exceptions.ProcessException: Cannot find the required parameter [RefPagamento] in the request message content.

This is the code i'm using:


wdContext.nodeRequest_PedidoAutorizacao().invalidate();

WS_PagamentoVisa model = new WS_PagamentoVisa();
wdContext.nodeRequest_PedidoAutorizacao().bind(new Request_PedidoAutorizacao(model));

IPublicHotelariaController.IPedidoAutorizacaoElement input = wdContext.createPedidoAutorizacaoElement(new PedidoAutorizacao(model));
wdContext.nodePedidoAutorizacao().bind(input);

input.setRefPagamento("12321321323");

wdContext.currentRequest_PedidoAutorizacaoElement().modelObject().execute();

...

I believe the input is not well formed in my code, but i can't understand where's the problem.

Can anyone help me, please?

Thanks in advanced,

Luis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Assuming you context to be..

Context

--Request_PedidoAutorizacao (node)

-


PedidoAutorizacao (node)

-


RefPagamento (attribute)

<i>You are invalidating Request_PedidoAutorizacao which is your main node.This node contians subnode PedidoAutorizacao</i>

<i>which has the input attribute RefPagamento</i>.

// try the following

WS_PagamentoVisa model = new WS_PagamentoVisa();

Request_PedidoAutorizacao req = new Request_PedidoAutorizacao(model);

PedidoAutorizacao input = new PedidoAutorizacao(model);

req.setPedidoAutorizacao(input);

wdContext.nodeRequest_PedidoAutorizacao().bind(req);

wdContext.currentPedidoAutorizacaoElement.setRefPagamento("12321321323");

wdContext.currentRequest_PedidoAutorizacaoElement().modelObject().execute();

wdContext.nodeResponse.invalidate(); // invalidate your response node

luscruz
Participant
0 Kudos

Thanks for all your replies.

Only tomorrow i can try these solutions, but i guess that will solve my problem.

So tomorrow i'll reply with more details, and set the rewarding points.

Once again thanks,

Luis

Answers (2)

Answers (2)

former_member751941
Active Contributor
0 Kudos

Hi Luis,

You are invalidating the node first.First execute the the model then invalidate.

WS_PagamentoVisa model = new WS_PagamentoVisa();

wdContext.nodeRequest_PedidoAutorizacao().bind(new Request_PedidoAutorizacao(model));

IPublicHotelariaController.IPedidoAutorizacaoElement input = wdContext.createPedidoAutorizacaoElement(new PedidoAutorizacao(model));

input.setRefPagamento("12321321323");

wdContext.nodePedidoAutorizacao().bind(input);

wdContext.currentRequest_PedidoAutorizacaoElement().modelObject().execute();

wdContext.nodeRequest_PedidoAutorizacao().invalidate();

Would you please post the exact structure of you model node that contains "RefPagamento" parameter .

Regards,

Mithu

former_member186016
Active Contributor
0 Kudos

Hi,

Can you do the setting of refPagemento first and then the binding of input variable.

i.e



IPublicHotelariaController.IPedidoAutorizacaoElement input = wdContext.createPedidoAutorizacaoElement(new PedidoAutorizacao(model));

input.setRefPagamento("12321321323");

wdContext.nodePedidoAutorizacao().bind(input);

wdContext.currentRequest_PedidoAutorizacaoElement().modelObject().execute();

Regards,

Ashwani Kr Sharma