File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes How to provide interoperabilty?? RPC or document??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to provide interoperabilty?? RPC or document???" Watch "How to provide interoperabilty?? RPC or document???" New topic
Author

How to provide interoperabilty?? RPC or document???

Pablo Pires
Greenhorn

Joined: May 19, 2003
Posts: 7
Hi folks!!
I have a big question and I'll appreciate some comments.
Suppose I have a RPC style webservice with a complextype. Can every kind of clients (independent written language) acess a webservice like this one or just Java clients?
What is the best way to provide this webservice? RPC or document?
Thanks
Pablo

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://goya:8080/jboss-net/services/ObjetoWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://goya:8080/jboss-net/services/ObjetoWS" xmlns:intf="http://goya:8080/jboss-net/services/ObjetoWS" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:ObjetoTO" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:ObjetoTO" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ObjetoTO">
<sequence>
<element name="description" nillable="true" type="xsd:string"/>
<element name="name" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="ObjetoTO" nillable="true" type="tns1:ObjetoTO"/>
</schema>
</wsdl:types>
<wsdl:message name="getObjetoRequest">
<wsdl:part name="in0" type="xsd:string"/>
<wsdl:part name="in1" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="createObjetoResponse">
<wsdl:part name="createObjetoReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getObjetoResponse">
<wsdl:part name="getObjetoReturn" type="tns1:ObjetoTO"/>
</wsdl:message>
<wsdl:message name="createObjetoRequest">
<wsdl:part name="in0" type="xsd:string"/>
<wsdl:part name="in1" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="ObjetoLocal">
<wsdlperation name="createObjeto" parameterOrder="in0 in1">
<wsdl:input message="impl:createObjetoRequest" name="createObjetoRequest"/>
<wsdlutput message="impl:createObjetoResponse" name="createObjetoResponse"/>
</wsdlperation>
<wsdlperation name="getObjeto" parameterOrder="in0 in1">
<wsdl:input message="impl:getObjetoRequest" name="getObjetoRequest"/>
<wsdlutput message="impl:getObjetoResponse" name="getObjetoResponse"/>
</wsdlperation>
</wsdl:portType>
<wsdl:binding name="ObjetoWSSoapBinding" type="impl:ObjetoLocal">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="createObjeto">
<wsdlsoapperation soapAction="ObjetoWS"/>
<wsdl:input name="createObjetoRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://goya:8080/jboss-net/services/ObjetoWS" use="encoded"/>
</wsdl:input>
<wsdlutput name="createObjetoResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://goya:8080/jboss-net/services/ObjetoWS" use="encoded"/>
</wsdlutput>
</wsdlperation>
<wsdlperation name="getObjeto">
<wsdlsoapperation soapAction="ObjetoWS"/>
<wsdl:input name="getObjetoRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://goya:8080/jboss-net/services/ObjetoWS" use="encoded"/>
</wsdl:input>
<wsdlutput name="getObjetoResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://goya:8080/jboss-net/services/ObjetoWS" use="encoded"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="ObjetoLocalService">
<wsdl:port binding="impl:ObjetoWSSoapBinding" name="ObjetoWS">
<wsdlsoap:address location="http://goya:8080/jboss-net/services/ObjetoWS"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions> ;)
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Sounds like the best way for interoperability is document.
That's why WS-I rallying cry is "rpc/encoded is dead; long live document/literal!"


/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Pablo Pires
Greenhorn

Joined: May 19, 2003
Posts: 7
Thanks Jean-Louis!
I have seen a lot of papers and I'm convinced document/literal is the best choice.
But my problem is that first I write my session bean and deploy it. When I try to get the wsdl file using ?WSDL I always have a rpc/encoded on JBoss.
What is the way to provide a document/literal webservice using Jboss/Axis?
Thanks
Pablo
Belo Horizonte - Brazil
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
No idea about jBoss and the way it uses Axis.
What I have seen so far is that all SOAP tools use RPC/Encoded by default.
I do not know if and how you can change that with jBoss (but I would be surpised if you can't)
Most of the time, there is special flags to use during generation, to specify you want to use Document/Literal or RPC/Encoded.
For instance, with Axis Java2WSDL, you've got :
-y, --style
The style of binding in the WSDL, either DOCUMENT, RPC, or WRAPPED.
-u, --use
The use of items in the binding, either LITERAL or ENCODED
 
Don't get me started about those stupid light bulbs.
 
subject: How to provide interoperabilty?? RPC or document???