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 TAnnison <ta...@trisystems.co.uk> on 2007/11/26 09:47:36 UTC

Changing Axis SOAP from rpc/encoded to document/literal or wrapped

I'm a SOAP newbie, working on a project that has already been configured by
coders that have since departed. And I'm floundering about a bit, and
wondering if you could possibly give me some advice? 

We have a Java project built with the Spring framework, using Axis in order
to provide webservices for access via SOAP. As I understand it (ie not very
well!) Axis works to accept these SOAP messages from the client and
transform them into calls on our Java methods, and do the reverse with the
responses! And to handle SOAP calls going outwards in a similar way. Which
is excellent, and it works well with the config files we have already set
up.

All our webservices all talk to each other just fine, and will talk also to
an external service using rpc/encoded. But now I need to make them talk to
other things also, that want document/literal or wrapped styles, and don't
like multirefs, and so on. So I tried changing the "sendMultiRefs" and
"style" and "use" settings in our axis config file, server-config.wsdd : 

    <globalConfiguration>
        <parameter name="sendXsiTypes" value="true"/>
        <parameter name="sendMultiRefs" value="false"/>  [was "true"]
        <parameter name="sendXMLDeclaration" value="true"/>
        <parameter name="axis.sendMinimizedElements" value="true"/>
    </globalConfiguration>

    <service name="TestMessageSender" provider="Handler" style="document"
use="literal"> [was just "rpc"]
        <parameter name="handlerClass"
value="com.workingmouse.webservice.axis.SpringBeanRPCProvider"/>
        <parameter name="springBean" value="testMessageSender"/>
        <parameter name="springBeanClass"
value="uk.co.wibblewibble.AxisTestMessageSender"/>
        <parameter name="allowedMethods" value="*"/>
        <parameter name="scope" value="application"/>
    </service>


But none of them seem to have any effect whatsoever! Whatever I set, I still
get SOAP sent that looks like this : 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ns1:getResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://hostName/recieverLiteral">
            <link xsi:type="xsd:string">Link</link>
            <cCode href="#id0"/>
            <dCode href="#id1"/>
            <pNumber xsi:type="xsd:string">Poster</pNumber>
            <replyMessage xsi:type="xsd:string">test message information to
send</replyMessage>
            <authenticationUser
xsi:type="xsd:string">Admin</authenticationUser>
        </ns1:getResponse>
        <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
        <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">6</multiRef>
    </soapenv:Body>
</soapenv:Envelope>

I'm confused, and just wondering if these are not taking effect because the
choice of SpringBeanRPCProvider as the handlerClass (whatever these things
are!) is overriding them. Could you possibly tell me if this is the case?

I'd also greatly appreciate any help you could possibly give me on how to
proceed with changing the SOAP styles, as I'm really in the dark about the
whole thing. All the advice I see anywhere seems to say that what I've done
is all that's needed, and yet nothing changes! 

Thanks!
-- 
View this message in context: http://www.nabble.com/Changing-Axis-SOAP-from-rpc-encoded-to-document-literal-or-wrapped-tf4873899.html#a13945944
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Changing Axis SOAP from rpc/encoded to document/literal or wrapped

Posted by TAnnison <ta...@trisystems.co.uk>.
Thanks, Anne

Oddly enough, I did locate and try a SpringBeanMsgProvider just yesyerday,
and that's meant to handle the other sorts of messages. But it made no
difference at all to the XML it put out! Which is mystifying to me. I'm
wondering if maybe the wsdd only controls Axis for incoming messages or
something, though the inclusion of a "sendMultirefs" is a bit of a puzzler
if that's the case. :)

All very confusing! Wish I had a working example of Spring, Axis and both
sending & receiving service code...

Cheers
Tracey


Anne Thomas Manes wrote:
> 
> My guess is that your provider class
> (com.workingmouse.webservice.axis.SpringBeanRPCProvider) only knows
> how to produce rpc/encoded messages. You will need to replace it. I
> suggest you use style="wrapped" rather than style="document".
> Otherwise you will need to change your application code .
> 
> Anne
> 

-- 
View this message in context: http://www.nabble.com/Changing-Axis-SOAP-from-rpc-encoded-to-document-literal-or-wrapped-tf4873899.html#a13971788
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Changing Axis SOAP from rpc/encoded to document/literal or wrapped

Posted by Anne Thomas Manes <at...@gmail.com>.
My guess is that your provider class
(com.workingmouse.webservice.axis.SpringBeanRPCProvider) only knows
how to produce rpc/encoded messages. You will need to replace it. I
suggest you use style="wrapped" rather than style="document".
Otherwise you will need to change your application code .

Anne

On Nov 26, 2007 3:47 AM, TAnnison <ta...@trisystems.co.uk> wrote:
>
> I'm a SOAP newbie, working on a project that has already been configured by
> coders that have since departed. And I'm floundering about a bit, and
> wondering if you could possibly give me some advice?
>
> We have a Java project built with the Spring framework, using Axis in order
> to provide webservices for access via SOAP. As I understand it (ie not very
> well!) Axis works to accept these SOAP messages from the client and
> transform them into calls on our Java methods, and do the reverse with the
> responses! And to handle SOAP calls going outwards in a similar way. Which
> is excellent, and it works well with the config files we have already set
> up.
>
> All our webservices all talk to each other just fine, and will talk also to
> an external service using rpc/encoded. But now I need to make them talk to
> other things also, that want document/literal or wrapped styles, and don't
> like multirefs, and so on. So I tried changing the "sendMultiRefs" and
> "style" and "use" settings in our axis config file, server-config.wsdd :
>
>     <globalConfiguration>
>         <parameter name="sendXsiTypes" value="true"/>
>         <parameter name="sendMultiRefs" value="false"/>  [was "true"]
>         <parameter name="sendXMLDeclaration" value="true"/>
>         <parameter name="axis.sendMinimizedElements" value="true"/>
>     </globalConfiguration>
>
>     <service name="TestMessageSender" provider="Handler" style="document"
> use="literal"> [was just "rpc"]
>         <parameter name="handlerClass"
> value="com.workingmouse.webservice.axis.SpringBeanRPCProvider"/>
>         <parameter name="springBean" value="testMessageSender"/>
>         <parameter name="springBeanClass"
> value="uk.co.wibblewibble.AxisTestMessageSender"/>
>         <parameter name="allowedMethods" value="*"/>
>         <parameter name="scope" value="application"/>
>     </service>
>
>
> But none of them seem to have any effect whatsoever! Whatever I set, I still
> get SOAP sent that looks like this :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>     <soapenv:Body>
>         <ns1:getResponse
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns1="http://hostName/recieverLiteral">
>             <link xsi:type="xsd:string">Link</link>
>             <cCode href="#id0"/>
>             <dCode href="#id1"/>
>             <pNumber xsi:type="xsd:string">Poster</pNumber>
>             <replyMessage xsi:type="xsd:string">test message information to
> send</replyMessage>
>             <authenticationUser
> xsi:type="xsd:string">Admin</authenticationUser>
>         </ns1:getResponse>
>         <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:decimal"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
>         <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:decimal"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">6</multiRef>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> I'm confused, and just wondering if these are not taking effect because the
> choice of SpringBeanRPCProvider as the handlerClass (whatever these things
> are!) is overriding them. Could you possibly tell me if this is the case?
>
> I'd also greatly appreciate any help you could possibly give me on how to
> proceed with changing the SOAP styles, as I'm really in the dark about the
> whole thing. All the advice I see anywhere seems to say that what I've done
> is all that's needed, and yet nothing changes!
>
> Thanks!
> --
> View this message in context: http://www.nabble.com/Changing-Axis-SOAP-from-rpc-encoded-to-document-literal-or-wrapped-tf4873899.html#a13945944
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org