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 John Baker <jb...@sasami.atomised.org> on 2005/07/13 12:19:12 UTC

SOAP message 'missing' element?

Hi,

If you point your browser at
http://www.javasystemsolutions.com/serviceRequestConnector.wsdl then you'll
be presented with a WSDL. I've used this to generate some stubs and have
called the 'SubmitGeneralServiceRequest' method. Here is the message
generated by Axis:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://sc
hemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" x
mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>

<SubmittedGeneralServiceRequest
xmlns="http://www.caps-solutions.co.uk/schema/un
iform/72b/servicerequest/sr/srtypes">
  <ServiceRequestIdentification>
   <AlternativeReferences/>
  </ServiceRequestIdentification>
  <ComplaintType>A</ComplaintType>
  <SiteLocation><Address>A</Address>
  <UPRN>B</UPRN></SiteLocation><NatureOfComplaint>B</NatureOfComplaint>
  <HowComplaintReceived>C</HowComplaintReceived><Complainants/>
  <AllocatedTo>D</AllocatedTo><ReceivedBy>E</ReceivedBy>
  <SubjectName>F</SubjectName><TradingAs>G</TradingAs>
  <AreaTeam>H</AreaTeam>
</SubmittedGeneralServiceRequest>
</soapenv:Body></soapenv:Envelope>
        
What worries me is it seems to be 'missing' an element! I'd expect to see
the <SubmitGeneralServiceRequest> element as the parent of
<SubmittedGeneralServiceRequest>.

Why is this not happening?

Thanks,


John


Re: SOAP message 'missing' element?

Posted by Anne Thomas Manes <at...@gmail.com>.
<soap:operation> inherits its style from <soap:binding>. If you don't
specify a style, it defaults to "document". The only two valid values
for WSDL style are "document" and "rpc". "wrapped" style is only used
in the WSDD -- never in WSDL.

>From the WSDL perspective, "wrapped" is a programming convention, not
a style. In order to follow the "wrapped" convention, you must
specify:
- style="document" and use="literal"
- the input element and output elements (the wrapper elements) must be
defined as complexTypes which are a sequence of elements. You may not
include attributes in the wrapper elements.
- the input wrapper element name must be the same as the operation name

Anne

On 7/13/05, John Baker <jb...@sasami.atomised.org> wrote:
> So to answer my own question again, the WSDL file has a style="wrapped"
> attribute that controls this. However perhaps I have found a bug. Consider
> this:
> 
>     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="SubmitGeneralServiceRequest">
>           <soap:operation soapAction="http://blah" />
> 
> I thought that style="document" would automatically be applied to the
> soap:operation tag, because as soap:operation doesn't supply one, it
> automatically inherits the style attribute set on the soap:binding?
> 
> 
> John
> 
> On Wed, Jul 13, 2005 at 12:36:54PM +0100, John Baker wrote:
> > In response to my own post, it would appear that the Stub source has the following:
> >
> >         oper.setStyle(org.apache.axis.constants.Style.DOCUMENT);
> >
> > but it needs:
> >
> >         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
> >
> > What causes Axis to add DOCUMENT and not WRAPPED? Something in the WSDL I
> > assume?
> >
> >
> > John
> >
> > On Wed, Jul 13, 2005 at 11:19:12AM +0100, John Baker wrote:
> > > Hi,
> > >
> > > If you point your browser at
> > > http://www.javasystemsolutions.com/serviceRequestConnector.wsdl then you'll
> > > be presented with a WSDL. I've used this to generate some stubs and have
> > > called the 'SubmitGeneralServiceRequest' method. Here is the message
> > > generated by Axis:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> > > xmlns:soapenv="http://sc
> > > hemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" x
> > > mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
> > >
> > > <SubmittedGeneralServiceRequest
> > > xmlns="http://www.caps-solutions.co.uk/schema/un
> > > iform/72b/servicerequest/sr/srtypes">
> > >   <ServiceRequestIdentification>
> > >    <AlternativeReferences/>
> > >   </ServiceRequestIdentification>
> > >   <ComplaintType>A</ComplaintType>
> > >   <SiteLocation><Address>A</Address>
> > >   <UPRN>B</UPRN></SiteLocation><NatureOfComplaint>B</NatureOfComplaint>
> > >   <HowComplaintReceived>C</HowComplaintReceived><Complainants/>
> > >   <AllocatedTo>D</AllocatedTo><ReceivedBy>E</ReceivedBy>
> > >   <SubjectName>F</SubjectName><TradingAs>G</TradingAs>
> > >   <AreaTeam>H</AreaTeam>
> > > </SubmittedGeneralServiceRequest>
> > > </soapenv:Body></soapenv:Envelope>
> > >
> > > What worries me is it seems to be 'missing' an element! I'd expect to see
> > > the <SubmitGeneralServiceRequest> element as the parent of
> > > <SubmittedGeneralServiceRequest>.
> > >
> > > Why is this not happening?
> > >
> > > Thanks,
> > >
> > >
> > > John
>

Re: SOAP message 'missing' element?

Posted by John Baker <jb...@sasami.atomised.org>.
Oh. It does work.

On Wed, Jul 13, 2005 at 03:13:16PM +0100, John Baker wrote:
> So to answer my own question again, the WSDL file has a style="wrapped"
> attribute that controls this. However perhaps I have found a bug. Consider
> this:
> 
>     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="SubmitGeneralServiceRequest">
>           <soap:operation soapAction="http://blah" />
>           
> I thought that style="document" would automatically be applied to the
> soap:operation tag, because as soap:operation doesn't supply one, it
> automatically inherits the style attribute set on the soap:binding?
> 
> 
> John
> 
> On Wed, Jul 13, 2005 at 12:36:54PM +0100, John Baker wrote:
> > In response to my own post, it would appear that the Stub source has the following:
> > 
> >         oper.setStyle(org.apache.axis.constants.Style.DOCUMENT);
> >         
> > but it needs:
> > 
> >         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
> > 
> > What causes Axis to add DOCUMENT and not WRAPPED? Something in the WSDL I
> > assume?
> > 
> > 
> > John
> > 
> > On Wed, Jul 13, 2005 at 11:19:12AM +0100, John Baker wrote:
> > > Hi,
> > > 
> > > If you point your browser at
> > > http://www.javasystemsolutions.com/serviceRequestConnector.wsdl then you'll
> > > be presented with a WSDL. I've used this to generate some stubs and have
> > > called the 'SubmitGeneralServiceRequest' method. Here is the message
> > > generated by Axis:
> > > 
> > > <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> > > xmlns:soapenv="http://sc
> > > hemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" x
> > > mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
> > > 
> > > <SubmittedGeneralServiceRequest
> > > xmlns="http://www.caps-solutions.co.uk/schema/un
> > > iform/72b/servicerequest/sr/srtypes">
> > >   <ServiceRequestIdentification>
> > >    <AlternativeReferences/>
> > >   </ServiceRequestIdentification>
> > >   <ComplaintType>A</ComplaintType>
> > >   <SiteLocation><Address>A</Address>
> > >   <UPRN>B</UPRN></SiteLocation><NatureOfComplaint>B</NatureOfComplaint>
> > >   <HowComplaintReceived>C</HowComplaintReceived><Complainants/>
> > >   <AllocatedTo>D</AllocatedTo><ReceivedBy>E</ReceivedBy>
> > >   <SubjectName>F</SubjectName><TradingAs>G</TradingAs>
> > >   <AreaTeam>H</AreaTeam>
> > > </SubmittedGeneralServiceRequest>
> > > </soapenv:Body></soapenv:Envelope>
> > >         
> > > What worries me is it seems to be 'missing' an element! I'd expect to see
> > > the <SubmitGeneralServiceRequest> element as the parent of
> > > <SubmittedGeneralServiceRequest>.
> > > 
> > > Why is this not happening?
> > > 
> > > Thanks,
> > > 
> > > 
> > > John

Re: SOAP message 'missing' element?

Posted by John Baker <jb...@sasami.atomised.org>.
So to answer my own question again, the WSDL file has a style="wrapped"
attribute that controls this. However perhaps I have found a bug. Consider
this:

    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="SubmitGeneralServiceRequest">
          <soap:operation soapAction="http://blah" />
          
I thought that style="document" would automatically be applied to the
soap:operation tag, because as soap:operation doesn't supply one, it
automatically inherits the style attribute set on the soap:binding?


John

On Wed, Jul 13, 2005 at 12:36:54PM +0100, John Baker wrote:
> In response to my own post, it would appear that the Stub source has the following:
> 
>         oper.setStyle(org.apache.axis.constants.Style.DOCUMENT);
>         
> but it needs:
> 
>         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
> 
> What causes Axis to add DOCUMENT and not WRAPPED? Something in the WSDL I
> assume?
> 
> 
> John
> 
> On Wed, Jul 13, 2005 at 11:19:12AM +0100, John Baker wrote:
> > Hi,
> > 
> > If you point your browser at
> > http://www.javasystemsolutions.com/serviceRequestConnector.wsdl then you'll
> > be presented with a WSDL. I've used this to generate some stubs and have
> > called the 'SubmitGeneralServiceRequest' method. Here is the message
> > generated by Axis:
> > 
> > <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> > xmlns:soapenv="http://sc
> > hemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema" x
> > mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
> > 
> > <SubmittedGeneralServiceRequest
> > xmlns="http://www.caps-solutions.co.uk/schema/un
> > iform/72b/servicerequest/sr/srtypes">
> >   <ServiceRequestIdentification>
> >    <AlternativeReferences/>
> >   </ServiceRequestIdentification>
> >   <ComplaintType>A</ComplaintType>
> >   <SiteLocation><Address>A</Address>
> >   <UPRN>B</UPRN></SiteLocation><NatureOfComplaint>B</NatureOfComplaint>
> >   <HowComplaintReceived>C</HowComplaintReceived><Complainants/>
> >   <AllocatedTo>D</AllocatedTo><ReceivedBy>E</ReceivedBy>
> >   <SubjectName>F</SubjectName><TradingAs>G</TradingAs>
> >   <AreaTeam>H</AreaTeam>
> > </SubmittedGeneralServiceRequest>
> > </soapenv:Body></soapenv:Envelope>
> >         
> > What worries me is it seems to be 'missing' an element! I'd expect to see
> > the <SubmitGeneralServiceRequest> element as the parent of
> > <SubmittedGeneralServiceRequest>.
> > 
> > Why is this not happening?
> > 
> > Thanks,
> > 
> > 
> > John

Re: SOAP message 'missing' element?

Posted by John Baker <jb...@sasami.atomised.org>.
In response to my own post, it would appear that the Stub source has the following:

        oper.setStyle(org.apache.axis.constants.Style.DOCUMENT);
        
but it needs:

        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);

What causes Axis to add DOCUMENT and not WRAPPED? Something in the WSDL I
assume?


John

On Wed, Jul 13, 2005 at 11:19:12AM +0100, John Baker wrote:
> Hi,
> 
> If you point your browser at
> http://www.javasystemsolutions.com/serviceRequestConnector.wsdl then you'll
> be presented with a WSDL. I've used this to generate some stubs and have
> called the 'SubmitGeneralServiceRequest' method. Here is the message
> generated by Axis:
> 
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> xmlns:soapenv="http://sc
> hemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" x
> mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
> 
> <SubmittedGeneralServiceRequest
> xmlns="http://www.caps-solutions.co.uk/schema/un
> iform/72b/servicerequest/sr/srtypes">
>   <ServiceRequestIdentification>
>    <AlternativeReferences/>
>   </ServiceRequestIdentification>
>   <ComplaintType>A</ComplaintType>
>   <SiteLocation><Address>A</Address>
>   <UPRN>B</UPRN></SiteLocation><NatureOfComplaint>B</NatureOfComplaint>
>   <HowComplaintReceived>C</HowComplaintReceived><Complainants/>
>   <AllocatedTo>D</AllocatedTo><ReceivedBy>E</ReceivedBy>
>   <SubjectName>F</SubjectName><TradingAs>G</TradingAs>
>   <AreaTeam>H</AreaTeam>
> </SubmittedGeneralServiceRequest>
> </soapenv:Body></soapenv:Envelope>
>         
> What worries me is it seems to be 'missing' an element! I'd expect to see
> the <SubmitGeneralServiceRequest> element as the parent of
> <SubmittedGeneralServiceRequest>.
> 
> Why is this not happening?
> 
> Thanks,
> 
> 
> John