cancel
Showing results for 
Search instead for 
Did you mean: 

Need expert's view on java object convertion

Former Member
0 Kudos

Hello,

I have my aplication on NW AS Java which will call ABAP Web Services on SAP ERP System. For that I am using java proxies for web service call.

The problem is every time what ever change i do, i have to touch my java code to regenerate java proxy which will call ABAP Web Service.

Now, i am planning to use XI in between so that I do everything in XI. At least i don't need to touch my java code in future. From XI, i call ABAP web service using SOAP adapter.

Now, the question is how can i convert my java(proxy) objects in XI. The out object i am sending is very complex, i am using some other objects in the out Object to call ABAP web service.

Do i need to put my objects in File or Database ot Message queue... in order to use them in XI. What is the better option in this case...

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Henrique,

Sorry, I wrote it wrong Again I am new to XI proxies area.

What I mean is I generate java proxy in XI (and I get EAR file ) and deploy this EAR on my NW AS java.

And ofcourse whenever there are changes to my interface, I have to regenerate my java proxy and redeploy this EAR on NW AS Java.

Again a basic doubt, My aplication is running is AS java. So, whenever a request comes to my EJB class( nothing but my deployed EAR) , I believe this request actually comes to XI and do mapping, receiver/interface determination ...bla...bla....

Hope I am clear now.

Thanks,

Srinivas

henrique_pinto
Active Contributor
0 Kudos

> So, whenever a request comes to my EJB class(

> nothing but my deployed EAR) , I believe this request

> actually comes to XI and do mapping,

> receiver/interface determination ...bla...bla....

Exactly, that's automatic.

A call to the EJB method = triggering an outbound interface.

Regards,

Henrique.

Answers (7)

Answers (7)

Former Member
0 Kudos

Hello Henrique,

Thanks for your help.

thanks,

Srinivas

Former Member
0 Kudos

Hello,

I am bit confused here. Leave the inbound side for below. Here i am talking about outbound. Actually, My application is deployed on NW Java. That mean all my .EARs are deployed here to call my ABAP web services with out XI.

For, creating Java proxies in XI in this case, what i have to do..

Below is my understanding:

I have to create Datatypes, message types, and outbound interfaces and create EARs.... And deploy them on my NW JAVA system (Which is nothing but i am replacing my old EARs who used to call directly ABAP webservices)

And now, I will map my fields to ABAP webservices (nothing but RFCs)

So, when ever there is requirement reagarding changes in elements or mapping changes.. I generate new EAR and deploy it in my JAVA System....

So that i don't need to change my Application code which is requirement.

Hope I am clear with you guys..Any suggestions to my approach.

Srinivas

henrique_pinto
Active Contributor
0 Kudos

Hi Sri,

if you create the outbound interface with all possible fields you may have, I don't see why you even need to regenerate EJB again.

Create interfaces with all fields and deploy EJB.

Then, maintain the fields you actually want to enable or disable in the target side through message mapping. The maintenance for enabling/disabling new fields will be much easier and less time consuming this way.

Of course, if you need to create new fields you didn't have in the outbound interface in the 1st place, you'll have to regenerate EJB. That's why I'm saying to define outbound interface with all possible fields.

Regards,

Henrique.

Former Member
0 Kudos

Hello Henrique,

Thanks for putting me in right direction. Now it is pretty much clear to me.

I have changed my scenario like this... Java Proxy --XI --- ABAP proxy (or) RFC

But, I would like to know the consequnces if I use RFC or Proxies. Which one is better.. i read lot a debate on SDN reagarding it. Still i am not clear.

is there any limitation on my message size if i use ABAP Proxy.

Thanks,

Srinivas.

VijayKonam
Active Contributor
0 Kudos

Proxy is the latest capability provided from WAS 6.20 on wards. One thing with Proxy is we can structure the data as we want and call the proxy. In case of RFC, you have to import the RFC and map the data as the RFC requires.

Proxy would be more of adapter less communication as the XML would be directly posted to the integration server of the receiving system's pipeline.

I dont think there are any message size related issues here. My personal choice would a proxy unless you already have a working RFC which you just need to call.

VJ

Former Member
0 Kudos

Also, I want to make sure that my messages are reaching SAP. At least, XI will get ackonwledgement for Async messages.

Which adapter i can use to send my java objects....

Thanks,

Srinivas

VijayKonam
Active Contributor
0 Kudos

SInce XI is not the producer of the data, changing your java code isinevitable if at all you have foreseen the future and know what are all the new elements could come in to the scenario. Create thm now in XI and have them mapped to the source.

Also, getting XI in to picture would be more fruitfull when the same interface need to talk to other systems too in addition to R3. In you current scenario XI might not add anything new.

You can post the payload using HTTP adapter. There is a test too available in forums. Search for HTTP test too by stefan grube. You can find it.

VJ

VijayKonam
Active Contributor
0 Kudos

Also, if you think the java object produce say n number of fields and you are using m in xi where m<n, and in future if you want to use more fields, yes, with out changing the java code, and by just changing the XI and the subsequent proxy objects, you could accomplish this.

VJ

Former Member
0 Kudos

Hello VJ,

Yes.. My scenario is going to be Java -- XI -- R3

Also you are right, from XI to R3.. i will use RFC adapter or Server Proxy. In fact, I didn't think about it.

Now my concern is first part, java --- XI

If i convert out my java object to XSD and deploy as web service in XI, there is nothing much i am gaining using XI. Infact, I was doing the same thing by calling ABAP web service from my java.

<b>The reason i brought XI is to remove java code changes, where as i can do those changes in XI.</b>

eg.. if i have 10 elements in my java object and mapped(used) 4 in XI based on requirement. In future i want to 4 more elements, then i can do it in XI rather than touching my java code. That is my idea.

Now, my concern is what is the best way i can do it. I mean which adpater ..

Also, My java object is complex object having several sub elements....

<b>is it possible by sending using HTTP. i mean Java object as payload in HTTP body.

If i use file, it will be come very complex to do content conversion.

No idea on JMS as of now.</b>

Any body experienced similar scenario, please let me know.

Thanks,

Srinivas.

henrique_pinto
Active Contributor
0 Kudos

Hi Sri,

you're approaching it wrongly. You shouldn't use WSDL from XI.

Instead, do it like this:

1. create data type, message type and a outbound interface containing all the fields you may wanna use (for example, containing all objects that you may have in java).

2. then, create a java proxy for this interface in IB (EJB); you'll have to get the EJB code into NWDS, create the EAR, deploy it in XI and activate the proxy*;

3. from now on, call this EJB from your java code.

Now, in XI part:

4. import ABAP function as RFC;

5. develop a mapping between your outbound interface and the RFC;

Now configure a simple scenario from your outbound interface into the RFC interface. You just need a communication channel for the RFC, no need for it in sender java proxy.

If you choose to use abap proxy in the receiver side, then it's even simpler. Define an inbound interface and use it in your configuration instead of RFC.

Just to make it easier, you could even create 2 interfaces (1 inbound and 1 outbound) for the same data/message types, and define a mapping between them just to decide which fields to map; you could disable the fields you dont need right now in the target message. Just make sure to define the fields you want to disable as optional in the data type, or the abap proxy in receiver side will throw a default exception because of missing mandatory fields.

Regards,

Henrique.

VijayKonam
Active Contributor
0 Kudos

> From XI, i call ABAP web service

> using SOAP adapter.

> Now, the question is how can i convert my java(proxy)

> objects in XI. The out object i am sending is very

> complex, i am using some other objects in the out

> Object to call ABAP web service.

> Do i need to put my objects in File or Database ot

> Message queue... in order to use them in XI. What is

> the better option in this case...

If I understood correctly, your scenario is going to be JavaCode -> XI -> R3.

Y would you want to use SOAP adapter for communicating with ABAP stack? Server Proxy or RFC would be the best choice for that.

Also, if you can convert you out obj from Java Code to XSD.. then create a web service exposed by XI and call in your Java code by supplying your out object from Java.

VJ

Former Member
0 Kudos

Hello,

anybody has idea on which adapter is better to replace my java code base (proxy) to call ABAP web service. I mean what is the better option to convert these object as datatypes in XI.

Thanks,

Srinivas