File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Need Help in Webservices  design Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need Help in Webservices  design Please" Watch "Need Help in Webservices  design Please" New topic

Need Help in Webservices design Please

Preethi Krishna

Joined: May 13, 2009
Posts: 11

I need to develop a webservice to accept xml files and send string as response. I am using weblogic 10.0. So my thoughts are to use JAX-RPC with rpc literal binding and use mime attachments for xml files. I will create a wsdl and generate java class from wsdl and add the implementation in the java class generated. Please correct me if Iam wrong or let me know if there is any other way to implement the same. I am using webservices for first time. and my sample wsdl is

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:message name="Request">
<wsdl:part name="attachment_1" type="xsd:hexBinary"/>
<wsdl:message name="Response">
<wsdl:part name="result" type="xsd:string"/>
<wsdl:portType name="ServiceHandler">
<wsdlperation name="Attachment">
<wsdl:input message="tns:Request"/>
<wsdlutput message="tns:Response"/>
<wsdl:binding name="ServiceHandlerSOAP" type="tns:ServiceHandler">
<soap:binding style="rpc" transport=""/>
<wsdlperation name="Attachment">
<soapperation soapAction=""/>
<soap:body use="literal"/>
<mime:content part="attachment_1" type="text/xml"/>
<soap:body parts="result" use="literal"/>
<wsdl:service name="ServiceHandler">
<wsdl:port binding="tns:ServiceHandlerSOAP" name="ServiceHandlerSOAP">
<soap:address location="http://localhost:7001/Webservice/ServiceHandlerImpl/"/>

Preethi Krishna

Joined: May 13, 2009
Posts: 11
My main concern is I need to send large xml files so is it ok to send as mime or should I use any other option???

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Can't you use JAX-WS?
Attaching files to SOAP messages using SwA (SOAP with Attahcments) may provide a solution to your problem. If you could use MTOM, in order to compress the attachments, there may be gains to be made, especially if you are to send large files. The problem is that, as far as I know, JAX-RPC does not support MTOM.
Best wishes!
I agree. Here's the link:
subject: Need Help in Webservices design Please
jQuery in Action, 3rd edition