wood burning stoves*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need Help in Webservices  design Please" Watch "Need Help in Webservices  design Please" New topic
Author

Need Help in Webservices design Please

Preethi Krishna
Greenhorn

Joined: May 13, 2009
Posts: 11
Hi,

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:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://org.com.hc/WebServices/ServiceHandler/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://org.com.hc/WebServices/ServiceHandler/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
name="ServiceHandler"
targetNamespace="http://org.com.hc/WebServices/ServiceHandler/">

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

Thanks,
Preethi
Preethi Krishna
Greenhorn

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???

Thanks
Preethi
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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: http://aspose.com/file-tools
 
subject: Need Help in Webservices design Please
 
Similar Threads
i'm trying to create a webservice using netbeans 6.8 for weblogic 10.3.2 and J2EE 5
Use the simpliest web server ever
calling a .net web service from server
order of request parameters causing unexpected subelement exception
Webservice runtime error