Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Need Help in Webservices design Please

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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">
<wsdl:operation name="Attachment">
<wsdl:input message="tns:Request"/>
<wsdl:output message="tns:Response"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceHandlerSOAP" type="tns:ServiceHandler">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Attachment">
<soap:operation 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>
<wsdl:output>
<soap:body parts="result" use="literal"/>
</wsdl:output>
</wsdl:operation>
</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
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic