aspose file tools*
The moose likes Web Services and the fly likes Help neded for developing the web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Help neded for developing the web service" Watch "Help neded for developing the web service" New topic
Author

Help neded for developing the web service

punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
Hi,
I have a requirement for develop a web service between two applications. it's just like transfer data between two applications.

the data will come in the form of xml from one application i have to extrace the data from xml and store in another application.

my method will take input as a xml String .

the code look like

public String test(String pXML) throws Exception{

//convert the string to document
//get the data from document object
//return the S or F (Sucess or Failur)
}

how i can make the above method as web service.

any one can help which is best one either axis or ws-j

my xml look like
<Stock>
<itemCode>10</itemCode>
<price>23.000</price>
....
</Stock>

what is the format of wsdl for this xml file.



Help needed .

thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
There are several introductory articles linked in the Web Services FAQ which should help you get going, e.g. this one.

But let's take a step back: Is the requirement that there should be a web service? Or is the requirement that the two applications should communicate? Web Services imply a web server with servlet engine and SOAP engine running (generalizing somewhat). Is that in place?


Ping & DNS - my free Android networking tools app
punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
thanks for Quick feed back

i want communicate the two applications using the soap protocal.because communication will happen with the help of XML only.

any help it's appriciated greatly
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
I'm asking because sending XML does not imply sending SOAP. XML can be sent just fine over an HttpURLConnection without using SOAP. If you do not need all the other facilities SOAP and WS provide, then a simple HTTP connection may be sufficient, and would need a lot less infrastructure.
punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
your correct,
but in feature this application may be communicate with more than one application. that why now it self we make it as web service. any application can interact with this application just using the service.


please help how to create the wsdl for the xml file and which techonology is best one i mean axis or ibm web services because we are using websphare in our production environment.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
You don't create a WSDL for an XML file - you create WSDL for an existing web service. The article I pointed you to has an example how of to use the java2wsdl tool (which comes with Axis) to generate a WSDL file for an existing Java WS implementation/interface. You can then use the wsdl2java tool (also part of Axis) to generate client-side Java classes. (Note that the client-side classes will depend on Axis libraries; but you needn't use Axis on the server to use them.)

Websphere (or WSAD) may have other/better tools available; look through the documentation to see what's available.
[ March 15, 2006: Message edited by: Ulf Dittmer ]
punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
thanks for quick info

can you send the links for websphare application server with web services.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Help neded for developing the web service