This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Pablo Pires
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!"
 
Pablo Pires
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic