You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rolando Pablos Sánchez <rp...@tid.es> on 2003/01/14 14:36:33 UTC

Re: Document service

Thank you very much for your help.
I have done what you told me and it works. I thought I had already done what
you told me.
Anyway, I have to say, for helping other people, that WSDL2Java generated a
"wrapped" service instead of a "document" service. I had to use the -W
switch option in the WSDL2Java tool.

PostData: I was on holidays, so I could not answer to you before.


----- Original Message -----
From: "Kevin Jones" <kj...@develop.com>
To: "Axis User" <ax...@xml.apache.org>
Sent: Friday, December 20, 2002 4:01 PM
Subject: Re: Document service


> Rolando,
>
> when you write a web service you typically choose one of two modes of
> operation, either rpc/encoded or document/literal, what you have
> described in your WSDL is document/encoded. While this is a valid mode
> most toolkits won't support it. If you want to use document style then
> you need to change your WSDL to reflect this.
>
> This means (and not all of these may be necessary) that the following
> changes:
>
> In the schema define elements that reference the complex types (if you
> haven't already)
> In the messages change the 'parts' to use element rather than type.
> In the operation 'use' should be 'literal' rather than 'encoded'
>
> There may be other things that I've missed but that's a start.
>
> > > wsdl file. Besides, the WSDL2Java tools generates the deploy.wsdd
> with
> > > > the provider attribute = java:RPC, just like with the rpc service.
> > > > Nothing about document style.
>
> java:RPC here is not an issue - it simply says to map the incoming XML
> onto parameters in a method.
>
> Another way to generate the WSDL would be to create an Axis web service
> (not .JWS) and in the wsdd file have an entry like this
>
> <service name="MyService" provider="java:RPC" style="document">
>   <parameter name=className value="MyService"/>
>   <parameter name="allowedMethods value="*"/>
> </service>
>
> Then browse to this service with ?wsdl on the end. The generated WSDL
> will be doc/literal and you should be able to edit it.
>
> Hope this helps,
>
> Kevin Jones
> DevelopMentor
>
> On Fri, 2002-12-20 at 14:02, Rolando Pablos Sánchez wrote:
> > Here below goes my wsdl. But I have to say that what I want finally is
to
> > avoid the param name in my soap body, because now what I get is the
method
> > name, the param name and then the information I want:
> > <ns2:SubmitReq
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:ns2="urn:prueba">
> >    <submitReqType xsi:type="ns2:submitReqType">
> >       <element1>
> >       <element2>
> >        [....]
> > And I want:
> > <ns2:SubmitReq
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:ns2="urn:prueba">
> >      <element1>
> >       <element2>
> >        [....]
> >
> > (I want to avoid de param or the method name. In this last case, I
rename
> > the param name to the method name. I think that document style has
something
> > to do with this.)
> > The wsdl file:
> > ===================
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:definitions targetNamespace="urn:prueba"
> > xmlns="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:prueba"
> > xmlns:tns="urn:prueba"
> > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema">
> > <wsdl:types>
> >   <schema targetNamespace="urn:prueba"
> > xmlns="http://www.w3.org/2001/XMLSchema">
> > <xs:complexType name="submitReqType">
> >   <xs:complexContent>
> >        <xs:sequence>
> >             [...] ( a lot of optional elements)
> >         </xs:sequence>
> >  </schema>
> >  </wsdl:types>
> >   <wsdl:message name="SubmitReqRequest">
> >
> >       <wsdl:part name="SubmitReqType" type="tns:submitReqType"/>
> >
> >    </wsdl:message>
> >
> >    <wsdl:message name="SubmitReqResponse">
> >     <wsdl:part name="submitRspType" type="tns:submitRspType"/>
> >
> >    </wsdl:message>
> >
> >    <wsdl:portType name="prueba">
> >
> >       <wsdl:operation name="SubmitReq">
> >
> >          <wsdl:input message="impl:SubmitReqRequest"
> > name="SubmitReqRequest"/>
> >
> >          <wsdl:output message="impl:SubmitReqResponse"
> > name="SubmitReqResponse"/>
> >
> >       </wsdl:operation>
> >
> >    </wsdl:portType>
> >
> >    <wsdl:binding name="PruebaSoapBinding" type="impl:prueba">
> >
> >       <wsdlsoap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> >
> >       <wsdl:operation name="SubmitReq">
> >
> >          <wsdlsoap:operation soapAction=""/>
> >
> >          <wsdl:input name="SubmitReqRequest">
> >
> >             <wsdlsoap:body use="encoded" namespace="urn:prueba"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >
> >          </wsdl:input>
> >
> >          <wsdl:output name="SubmitReqResponse">
> >
> >             <wsdlsoap:body use="encoded" namespace="urn:prueba"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
> >
> >          </wsdl:output>
> >
> >       </wsdl:operation>
> >
> >    </wsdl:binding>
> >
> >    <wsdl:service name="pruebaService">
> >
> >       <wsdl:port binding="impl:PruebaSoapBinding" name="Prueba">
> >
> >          <wsdlsoap:address
> > location="http://localhost:8080/axis/services/Prueba"/>
> >
> >       </wsdl:port>
> >
> >    </wsdl:service>
> >
> > </wsdl:definitions>
> >
> > ----- Original Message -----
> > From: "Kevin Jones" <kj...@develop.com>
> > To: "Axis User" <ax...@xml.apache.org>
> > Sent: Friday, December 20, 2002 2:48 PM
> > Subject: Re: Document service
> >
> >
> > > Ronaldo,
> > >
> > > you typically need to do more than simply change the style to
document.
> > > Can you post your WSDL here for us to see?
> > >
> > > Kevin Jones
> > > DevelopMentor
> > >
> > > On Fri, 2002-12-20 at 11:59, Rolando Pablos Sánchez wrote:
> > > > I have been doing a rpc service, but now I have modified my wdsl
file
> > > > and I have changed to: soap:binding style="document".
> > > > But it doesn´t work. I don't know if I have to make more changes in
my
> > > > wsdl file. Besides, the WSDL2Java tools generates the deploy.wsdd
with
> > > > the provider attribute = java:RPC, just like with the rpc service.
> > > > Nothing about document style.
> > > > I have seen what is in the wire with "tcpmon", and the client does
the
> > > > request correctly, but the server responds:
> > > > org.xml.sax.SAXException: SimpleDeserializer encountered a child
> > > > element, which is NOT expected, in something it was trying to
> > > > deserialize
> > > >
> > > > if you can help me, let me know.
> > > > Thanks
> > >
> >
>