on 12-30-2004 8:41 AM
Hi, I have some problem to call web service generated from BAPI on WAS 6.20. My Scenario is the following:
I took the famous BAPI_FLIGHT_GETLIST, generate Web Service on WAS 6.20, and consume it throw Web Dynpro Web Service model on WAS 6.40.
Now, I want to pass parameters to my web service.
I successfully passed all tables and my web service worked, the problem starts when I try to set data to one of the input structures namely DESTINATION_FROM. It looks like WS simply ignores the data I set there, so I am unable to pass the filter to the BAPI.
I also want to mention that I can call the same web service from Web Service navigator on my WAS 6.40. If I do it from there it works as required which means the problem in Web Dypro Side.
In addition I tried to set this structures with context mapping, without context mapping and directly to the model. It didn't work.
Any ideas?
Victor.
Hi Victor,
Do one thing write following code in init method of your controller where u mapped your model for BAPI_FLIGHT_GETLIST.
Bapi_Flight_Getlist_Input model = new Bapi_Flight_Getlist_Input();
model.setDestination_From(new Bapisfldst());
model.setDestination_To(new Bapisfldst());
IPublicFlight_details.IBapi_Flight_Getlist_InputElement ele = wdContext.nodeBapi_Flight_Getlist_Input().createBapi_Flight_Getlist_InputElement(model);
wdContext.nodeBapi_Flight_Getlist_Input().bind(ele);
This code will create all required instances for input parameters.
Then you can execute it whenever u want.
It will work. Let me know the status.
Regards,
Bahvik
For -> David Fryda
You have written code for initialization of model. But you forgot to make an instace for two Input parameters. So, your data is not going to R/3 properly.
Do it and let me know.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brahik,
In the case of a web service I do not know how to initialize the 2 input parameters.
My object req has a method called setParameters wich accepts only a ComplexType_BAPI_FLIGHT_GETLIST object type.
By the way, in an old WebDynPro that model is a the same BAPI (the BAPI_FLIGHT_GETLIST ), I do not initialize the input parameters and I get all the flights.
Thanks for your help.
Hi,
Web Dynpro runtime on 6.40 SP 11 has a bug in a Web Service model which is confirmed by SAP. The workaround they advised to me (and it worked) is to initialize all the field the following way:
ComplexType_BAPISFLDST dest_from = new ComplexType_BAPISFLDST();
params.<b>getOriginalBean()</b>.setDESTINATION_FROM(
dest_from.<b>getOriginalBean()</b>);
However, please remember that this is workaround and not proper way to do things.
Best Regard
Victor
Hi,
I have problems executing this BAPI through the Web Service.
I don't get any exception but I get an empty result table.
In the LogicalPort, I did define a "Stateless Communication".
1) Should I do this ?
2) I choosed a Basic(username/password) HTTP authentication. Should I do it ?
However, I removed these choices and it didn't work.
In the component controller, I wrote :
public void wdDoInit()
{
//@@begin wdDoInit()
Request_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST req =
new Request_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST();
wdContext.nodeRequest_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST().bind(req);
//@@end
}
public void execute_BAPI( )
{
//@@begin execute_BAPI()
try {
wdContext.currentRequest_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLISTElement()
.modelObject().execute();
// wdContext.nodeResponse().invalidate();
wdContext.nodeRequest_BAPI_FLIGHT_GETLISTPortType_BAPI_FLIGHT_GETLIST().nodeResponse().invalidate();
} catch(Exception e) {
}
//@@end
}
Is it OK ?
When my model is a SAP/R3 system, I was creating a Custom Controller and I wasn't using the Component Controller.
Is anyone can help...Thanks in advance.
Bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have to create an instance of the DESTINATION_FROM structure directly and add it to your model.
You probably tried to add your data to the mapped context nodes. This does not work. The data is not appended automatically to the model. This for me is an error in Web Dynpro.
Regards
Helmut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
Maybe there is a short dump on R/3. You can check it with transaction sm21 or st22.
Cheers and best wishes,
Noel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.