Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What WS should I use?  RSS feed

 
Alex Philippi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have to realize a small project where I have to handle xml files via web service.

1. The WS receives a xml file from a system A.
2. The WS has to transform (with xsl) this xml file to an other xml file.
3. The WS has to check the new generated xml file with a xsd and send the this file to a system B.

Does anyone know if this A->WS->B problem could be solved with a special WS easily? Or doesn't it matter what kind of webservice I choose?

Regards
Alex
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first questions that occur to me:

1. Is this a public service that will need to be exposed to the world with a WSDL so that anybody can use it - or is it going to be restricted to a few known clients.

2. I'm assuming the connection is via the Internet - correct? Is the transfer method already settled? FTP vrs HTTP vrs email vrs ??.

3. Does system A have to submit any other control information or just the XML input file?

Bill
 
Alex Philippi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


1. Is this a public service that will need to be exposed to the world with a WSDL so that anybody can use it - or is it going to be restricted to a few known clients.


1. This service don't expose a wsdl. It only transform XML Streams (which are "enveloped" in soap) and sends it to System B. And yes, its restricted to a hand full of clients.



2. I'm assuming the connection is via the Internet - correct? Is the transfer method already settled? FTP vrs HTTP vrs email vrs ??.


2. The transfer method will be a https post to this service and later to the System B.



3. Does system A have to submit any other control information or just the XML input file?


3. The System A post the XML File and perhaps a few soap attachements.


Can I use the jax-ws for this? Or should I use a framework (axis, metro, xfire...).

Regards
Alex
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alex Philippi:
3. The System A post the XML File and perhaps a few soap attachements.

Can I use the jax-ws for this? Or should I use a framework (axis, metro, xfire...).

Regards
Alex


JAX-WS is an api specification. The three frameworks that you mentioned, Axis 2, Metro, and Apache CXF all implement JAX-WS to some extent.

What is probably more important is the style of attachment that you need to support; DIME, SwA, MTOM?

Here are some links that may be of some help.
Web Services, Opaque Data, and the Attachments Problems
Fear of Attachments
JAX-WS 2.0 MTOM and swaRef
MTOM in JAXWS RI 2.0 Final
Handling Binary Data with Axis2 (MTOM/SwA)
MTOM between Java and .NET
 
Alex Philippi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks for the links. I think I have to use Axis2.

I tried to use Metro with Eclipse and Tomcat 6, but to use Metro I will have to put some libs in the endorsement folder of the Tomcat. I don't have access to the Tomcat directly ( I can only deploy stuff). I think if I want to use Metro I should switch to Netbeans and Glassfish .

CXF looks good too. But I think Axis2 has the best tool support for Eclipse and therefore that will be my choice (I think ). I only have to figure out how I could use jax-ws 2.0 with Axis2 (in fact I want to be "close" the specification while I realizing the WS).

Regards
Alex
 
Alex Philippi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edit: I had a look at the Java EE Tutorial by SUN. Do you think I could solve my "issue" (project) by using only the jax-ws for the service, StAX to transform/read the xml and finally SAAJ to send attachements?
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it looks like you may be more interested in a Document Oriented Web Service.
Have a Look at this article: Document Handling Using JAX-WS Dispatch and Provider APIs

You can certainly use SAAJ on the client-side, however that will limit you to SOAP with Attachment (SwA) attachments.

Send binary data without using attachments
An Introduction to StAX
[ October 07, 2007: Message edited by: Peer Reynders ]
 
Dan Evans
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to use Apache Axis (widely used). The Jt framework has a Web services adapter based on Axis. This should greatly expedite/simplify your efforts. Jt also provides built-in support for XML. The invocation of your web service would look like the following (a few simple lines of code).
Using the web service is like using a local class (thanks to the Jt Web services Adapter). The Web services adapter takes care of all the complexities associated with using a Web service. For instance you don't need to define an additiona WSDL, deal with service a parameters. or do conversions.



JtWebServicesAdapter myService;
JtMessage msg = new JtMessage ("XML");


// Create the Jt Web service Adapter

myService = (JtWebServicesAdapter) main.createObject ("Jt.axis.JtWebServicesAdapter",
"service");

// Set the service url property

main.setValue (myService, "url",
"http://localhost:8080/axis/services/JtAxisService");



// Create a remote instance of your class. The Jt Web service adaptor
// can be used to create remote instances of a class.

myService.createObject ("com.package.anyclass", "remoteClass");


// Send XML document to the remote class

msg.content ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n .....");
Object reply = myService.sendMessage ("remoteClass", msg);

The following links should give you additional info

https://jt.dev.java.net/
http://www.fsw.com/Jt/Jt.htm (Jt documentation)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!