axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Reynolds" <...@RonReynolds.com>
Subject RE: encoded only works once?
Date Wed, 28 Sep 2005 23:56:01 GMT
but why would 2 identical calls result in 2 different XML requests?  and since the error is
on the client-side (the
server is perfectly happy with the request and produces the same, correct, response for all
3 calls) it feels like the
client-side code makes some decisions about how to call the server and handle the response
and for whatever reason
after the first call's response it changes its decisions and starts calling the server differently
(and expecting
something different in the response) and that's when things go south.

(i tried the resend - server's still happy with the request)

since it's specific to the encoded operation i was wondering about this bit in my wsdl:

    <wsdl:operation name="encodedTest">
      <soap:operation/>
      <wsdl:input ><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:amgen.com/freezer/data"/></wsdl:input>
      <wsdl:output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:amgen.com/freezer/data"/></wsdl:output>
    </wsdl:operation>

i couldn't find any real solid info about the proper namespace value to use for the <soap:body>
element.  i read
section 3.5 of WSDL 1.1 spec and that didn't help ("The part names, types, and value of the
namespace attribute are
all inputs to the encoding, although the namespace attribute only applies to content not explicitly
defined by the
abstract types" - for some reason these sorts of sentences don't make sense until AFTER i
understand what they mean).

i thought that it made sense that the body have the same namespace as my data objects (i put
my api in one namespace
and my data types in a sub-namespace ".../data", which doesn't seem to be the case in most
sample wsdls i've seen). 
leaving the namespace off entirely gets this warning
org.apache.axis.wsdl.toJava.Utils getOperationQName
WARNING: soap:body in Binding com.amgen.seattle.appdev.freezer.webservice.server.SOAPHTTPBinding
/ Operation
encodedTest has an empty namespace

which is probably not a good thing.  that namespace value is my latest guess, anyway...

>
> Not sure it will help, but did you try 'resend request' from tcpmon? If
> the first request is a little different, maybe it really is the hint you
> need...
> Chris
>
>
> -----Original Message-----
> From: Ron Reynolds [mailto:Ron@RonReynolds.com]
> Sent: Wednesday, September 28, 2005 15:18
> To: Axis Users
> Subject: encoded only works once?
>
> ok, i've started this email 3 times now, then stopped, certain i could
> figure it out myself, but i'm ready to admit i'm stumped.
>
> i've been trying to nail a problem i see only with rpc-encoded -
> basically i can only call it once.  tcpmon shows that the xml being sent
> on the first call (the one that works) is not exactly encoded, but it's
> not exactly literal either.
>  all subsequent calls look like properly encoded requests, but parsing
> the response by the client fails with "SimpleDeserializer encountered a
> child element, which is NOT expected...".  of course the responses from
> all calls (encoded and literal) are exactly the same xml which make the
> client-side failure all the more confusing to me.
>
> the WSDL/XSD of my request/response:
>
>   <wsdl:message name="TestRequest">
>     <wsdl:part name="request" type="data:ArrayOfLong"/>
>   </wsdl:message>
>   <wsdl:message name="TestResponse">
>     <wsdl:part name="response" type="data:ArrayOfTestDatum"/>
>   </wsdl:message>
>
>   <complexType name="TestDatum">
>     <sequence>
>       <element name="name" type="string"/>
>       <element name="value" type="string"/>
>     </sequence>
>   </complexType>
>   <complexType name="ArrayOfTestDatum">
>     <sequence><element name="data" minOccurs="0" maxOccurs="unbounded"
> type="tns:TestDatum"/></sequence>
>   </complexType>
>   <complexType name="ArrayOfLong">
>     <sequence><element name="data" minOccurs="0" maxOccurs="unbounded"
> type="long"/></sequence>
>   </complexType>
>
> the first (working encoded-ish) call:
>    <soapenv:Envelope ...>
>       <soapenv:Body>
>          <encodedTest xmlns="urn:amgen.com/freezer/data">
>             <request xsi:type="ns1:ArrayOfLong" xmlns=""
> xmlns:ns1="urn:amgen.com/freezer/data">
>                <ns1:data xsi:type="xsd:long">1</ns1:data>
>                <ns1:data xsi:type="xsd:long">2</ns1:data>
>                <ns1:data xsi:type="xsd:long">3</ns1:data>
>                <ns1:data xsi:type="xsd:long">0</ns1:data>
>             </request>
>          </encodedTest>
>       </soapenv:Body>
>    </soapenv:Envelope>
>
> the second (failed encoded) call:
>
>    <soapenv:Envelope ...>
>       <soapenv:Body>
>          <ns1:encodedTest
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns1="urn:amgen.com/freezer/data">
>             <request soapenc:arrayType="ns1:ArrayOfLong[4]"
> xsi:type="soapenc:Array"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>                <ns1:data href="#id0"/>
>                <ns1:data href="#id1"/>
>                <ns1:data href="#id2"/>
>                <ns1:data href="#id3"/>
>             </request>
>          </ns1:encodedTest>
>          <multiRef id="id3" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:long"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2</multiRef>
>          <multiRef id="id2" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:long"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">3</multiRef>
>          <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:long"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2</multiRef>
>          <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:long"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
>       </soapenv:Body>
>    </soapenv:Envelope>
>
> the (always successful) literal call:
>
>    <soapenv:Envelope ...>
>       <soapenv:Body>
>          <literalTest xmlns="">
>             <request>
>                <ns1:data
> xmlns:ns1="urn:amgen.com/freezer/data">1</ns1:data>
>                <ns2:data
> xmlns:ns2="urn:amgen.com/freezer/data">2</ns2:data>
>                <ns3:data
> xmlns:ns3="urn:amgen.com/freezer/data">3</ns3:data>
>                <ns4:data
> xmlns:ns4="urn:amgen.com/freezer/data">1</ns4:data>
>             </request>
>          </literalTest>
>       </soapenv:Body>
>    </soapenv:Envelope>
>
> i can't continue to spend billable time beating my head against this
> problem - please, somebody, toss me a hint. :-/
>
> ..................ron.
>
>



Mime
View raw message