cancel
Showing results for 
Search instead for 
Did you mean: 

consuming webservice

former_member219446
Participant
0 Kudos

Hi All,

I have requirement like this....

First read the value objects(out put) of webservice,create class using the above(specified) value object fields and finally create the xml file using the above class.

can any body give suggestion to done the above task

regards,

LSR

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I don't exactly understand what your problem is. If I'm right the flow you want to establish is:

1. Consume webservice

2. Create your own new class from the answer of the webservice-call

3. Create an XML-File that corresponds to the new class created in the last step.

Is this right?

Okay, my remarks about this flow are:

ad 1) Generate a webservice-proxy. This proxy gives you a Java-Interface to the Webservice and you will get the answer of the webservice call as an Java-Object

ad 2) This is your business logic, you must know how to convert the external business objects into your own ones

ad 3) There are libraries that can convert from Java-classes to xml and back: jax-p, xmlbeans etc. Don't know, wwether SAP got its own library to do this.

Hope this helps, Thomas

former_member219446
Participant
0 Kudos

Hi ,

Thanks for u r reply

ya u r right,my requirement is same as urs thinking.

from u r 3 steps.

3.create an xml-file that corresponds to the new class created,

can u help me, how to do the step3.(xml file creation using java class)

by using help given by sap i done the step1.

Is there any help for xml-file generation ?

regards,

LSR

Former Member
0 Kudos

Because you want to create an XML file, DOM would be the best option.

check

http://java.sun.com/developer/codesamples/xml.html#dom

for samples related to this.

Former Member
0 Kudos

Hi,

don't go the basic way with SAX or DOM!! Don't to this at home, kids!!

Please, use some binding-tool to do the work for you. The main advantage is that you get the right xml and don't have to code any conversion and formatting manually.

Take a look at this article <a href="http://www-128.ibm.com/developerworks/xml/library/x-databdopt/">Data binding, Part 1: Code generation approaches -- JAXB and more</a> by Dennis Sosnoski.

Thomas

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

There are XML parsers like DOM and SAX, available to create or process XML files.

Refer this link to get into Java APIs for XML creation.

http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/TOC.html

Regards,

Uma