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 "Shelli D. Orton" <sh...@wmode.com> on 2006/01/06 23:57:07 UTC

Deserialization(?) Error on String Array

Hi,

I have to make some modifications to an existing (working) webservice.  We
needed to add a new parameter to one of the existing methods, an array of
strings.  I originall created a a new type as follows in the WSDL:

    <wsdl:types>
        <xsd:schema
targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">

            <xsd:element name="SOCArray">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="SOC" type="xsd:string"
maxOccurs="unbounded"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

        </xsd:schema>
    </wsdl:types>

and added it to the message definiton:

    <wsdl:message name="addRequest">
        <wsdl:part name="username" type="xsd:string"/>
        <wsdl:part name="password" type="xsd:string"/>
        ...
        <wsdl:part name="gender" type="xsd:string"/>
        <wsdl:part name="state" type="xsd:string"/>
        <wsdl:part name="timeZone" type="xsd:string"/>
        <wsdl:part name="SOCs" element="impl:SOCArray"/>
    </wsdl:message>

When I ran WSDL2Java, it created an SOCArray class.  During testing of the
modified service, I get the following error when I try to call the
addRequest:


Exception caught: java.lang.reflect.InvocationTargetException
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
	{http://xml.apache.org/axis/}hostname:localhost

java.lang.reflect.InvocationTargetException
	at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:2
21)
	at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:12
8)
	at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo
ntext.java:1087)
	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
	at org.apache.crimson.parser.Parser2.content(Unknown Source)
	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
	at org.apache.crimson.parser.Parser2.content(Unknown Source)
	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
	at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
	at org.apache.crimson.parser.Parser2.parse(Unknown Source)
	at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(Unknown Source)
	at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext
.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
	at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChe
cker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
	at org.apache.axis.client.Call.invoke(Call.java:2748)
	at org.apache.axis.client.Call.invoke(Call.java:2424)
	at org.apache.axis.client.Call.invoke(Call.java:2347)
	at org.apache.axis.client.Call.invoke(Call.java:1804)
	at
com.wmode.clearmode.applications.provisioningengine..ConsumerProvisionSoapBi
ndingStub.add(ConsumerProvisionSoapBindingStub.java:119)
	at
com.wmode.clearmode.applications.provisioningengine.ClientTest.main(ClientTe
st.java:111)

Since I couldn't figure out what the serialization problem was, I modified
the WSDL again to define the type like this:

    <wsdl:types>
        <xsd:schema
targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:complexType name="SOCArray">
                <xsd:complexContent>
                    <xsd:restriction base="soapenc:Array">
                        <xsd:attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]"/>
                    </xsd:restriction>
                </xsd:complexContent>
            </xsd:complexType>
        </xsd:schema>
    </wsdl:types>

and the message to be:

    <wsdl:message name="addRequest">
        <wsdl:part name="username" type="xsd:string"/>
        <wsdl:part name="password" type="xsd:string"/>
        ...
        <wsdl:part name="gender" type="xsd:string"/>
        <wsdl:part name="state" type="xsd:string"/>
        <wsdl:part name="timeZone" type="xsd:string"/>
        <wsdl:part name="SOCs" type="impl:SOCArray"/>
    </wsdl:message>

I am still getting the same error as before when I try to call the add
method.  I've looked for solutions on the net, but the error message is
pretty vague, so it's not an easy search.

Can anybody help me identify what I'm doing wrong?

Thanks in advance,
Shelli


RE: Deserialization(?) Error on String Array

Posted by "Shelli D. Orton" <sh...@wmode.com>.
Anne,

I'm using rpc/encoded.  So, I understand from what you said that I should
define the type as:

<wsdl:types>

    <xsd:schema
targetNamespace="http://rogers.clearmode.com:80/ws/ConsumerProvision"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

        <xsd:complexType name="SOCArray">
             <xsd:complexContent>
                 <xsd:restriction base="soapenc:Array">
                     <xsd:attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]"/>
                 </xsd:restriction>
             </xsd:complexContent>
         </xsd:complexType>

    </xsd:schema>

</wsdl:types>

Maybe the complexContent is not required?  And the message as:

    <wsdl:message name="addModifyRequest">
        <wsdl:part name="username" type="xsd:string"/>
        <wsdl:part name="password" type="xsd:string"/>
        ....
        <wsdl:part name="gender" type="xsd:string"/>
        <wsdl:part name="state" type="xsd:string"/>
        <wsdl:part name="timeZone" type="xsd:string"/>
        <wsdl:part name="SOCs" type="impl:SOCArray"/>
    </wsdl:message>

If this is correct, I have tried that combination and I still receive the
deserializtion error.  Any other suggestions?

Thanks,
Shelli
  -----Original Message-----
  From: Anne Thomas Manes [mailto:atmanes@gmail.com]
  Sent: Saturday, January 07, 2006 3:38 PM
  To: axis-user@ws.apache.org
  Subject: Re: Deserialization(?) Error on String Array


  Shelli,

  Are you using rpc/encoded or rpc/literal?

  If you are using rpc/encoded, then you need to define the array using
soapenc:Array. If you are using rpc/literal, then you need to define the
array as a complex type (not an element) with a maxOccurs="unbounded" and
reference the type from your message part. (You can't mix elements and types
in your message parts -- the fact that your other parts reference types
tells me that you are using rpc style rather than document style).

  So, if you are using rpc/literal, your definition should look something
like this:

  <wsdl:types>
         <xsd:schema
  targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema">

                <xsd:complexType name="SOCArray">
                     <xsd:sequence>
                         <xsd:element name="SOC" type="xsd:string"
  maxOccurs="unbounded"/>
                     </xsd:sequence>
                </xsd:complexType>

         </xsd:schema>
     </wsdl:types>

  and add it to the message definiton:

     <wsdl:message name="addRequest">
         <wsdl:part name="username" type="xsd:string"/>
         <wsdl:part name="password" type="xsd:string"/>
         ...
         <wsdl:part name="gender" type="xsd:string"/>
         <wsdl:part name="state" type="xsd:string"/>
         <wsdl:part name="timeZone" type="xsd:string"/>
         <wsdl:part name="SOCs" type="impl:SOCArray"/>
     </wsdl:message>

  Anne


  On 1/6/06, Shelli D. Orton <sh...@wmode.com> wrote:
    I should have mentioned in the original post, that with the second WSDL,
    there is no SOCArray class.  The Java methods receive/pass a String[]
array.
    I was hoping by changing to that I wouldn't have the deserialization
error
    I'm getting.

    Thanks again,
    Shelli

    -----Original Message-----
    From: Shelli D. Orton [mailto:shelli.orton@wmode.com]
    Sent: Friday, January 06, 2006 3:57 PM
    To: axis-user@ws.apache.org
    Subject: Deserialization(?) Error on String Array


    Hi,

    I have to make some modifications to an existing (working) webservice.
We
    needed to add a new parameter to one of the existing methods, an array
of
    strings.  I originall created a a new type as follows in the WSDL:

        <wsdl:types>
            <xsd:schema
    targetNamespace=" http://clearmode.com:80/ws/ConsumerProvision"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema">

                <xsd:element name="SOCArray">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="SOC" type="xsd:string"
    maxOccurs="unbounded"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>

            </xsd:schema>
        </wsdl:types>

    and added it to the message definiton:

        <wsdl:message name="addRequest">
            <wsdl:part name="username" type="xsd:string"/>
            <wsdl:part name="password" type="xsd:string"/>
            ...
            <wsdl:part name="gender" type="xsd:string"/>
            <wsdl:part name="state" type="xsd:string"/>
            <wsdl:part name="timeZone" type="xsd:string"/>
            <wsdl:part name="SOCs" element="impl:SOCArray"/>
        </wsdl:message>

    When I ran WSDL2Java, it created an SOCArray class.  During testing of
the
    modified service, I get the following error when I try to call the
    addRequest:


    Exception caught: java.lang.reflect.InvocationTargetException
    AxisFault
    faultCode: {
http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.reflect.InvocationTargetException
    faultActor:
    faultNode:
    faultDetail:
            { http://xml.apache.org/axis/}hostname:localhost

    java.lang.reflect.InvocationTargetException
            at
    org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
va:2
    21)
            at
    org.apache.axis.message.SOAPFaultBuilder.endElement
(SOAPFaultBuilder.java:12
    8)
            at
    org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
onCo
    ntext.java:1087)
            at org.apache.crimson.parser.Parser2.maybeElement(Unknown
Source)
            at org.apache.crimson.parser.Parser2.content(Unknown Source)
            at org.apache.crimson.parser.Parser2.maybeElement(Unknown
Source)
            at org.apache.crimson.parser.Parser2.content(Unknown Source)
            at org.apache.crimson.parser.Parser2.maybeElement(Unknown
Source)
            at org.apache.crimson.parser.Parser2.parseInternal(Unknown
Source)
            at org.apache.crimson.parser.Parser2.parse(Unknown Source)
            at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
            at javax.xml.parsers.SAXParser.parse(Unknown Source)
            at
    org.apache.axis.encoding.DeserializationContext.parse(DeserializationCon
text
    .java:227)
            at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
            at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
            at
    org.apache.axis.handlers.soap.MustUnderstandChecker.invoke
(MustUnderstandChe
    cker.java:62)
            at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
            at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
            at org.apache.axis.client.Call.invoke (Call.java:2748)
            at org.apache.axis.client.Call.invoke(Call.java:2424)
            at org.apache.axis.client.Call.invoke(Call.java:2347)
            at org.apache.axis.client.Call.invoke(Call.java:1804)
            at
    com.wmode.clearmode.applications.provisioningengine..ConsumerProvisionSo
apBi
    ndingStub.add(ConsumerProvisionSoapBindingStub.java:119)
            at
    com.wmode.clearmode.applications.provisioningengine.ClientTest.main
(ClientTe
    st.java:111)

    Since I couldn't figure out what the serialization problem was, I
modified
    the WSDL again to define the type like this:

        <wsdl:types>
            <xsd:schema
    targetNamespace=" http://clearmode.com:80/ws/ConsumerProvision"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema ">
                <xsd:complexType name="SOCArray">
                    <xsd:complexContent>
                        <xsd:restriction base="soapenc:Array">
                            <xsd:attribute ref="soapenc:arrayType"
    wsdl:arrayType="xsd:string[]"/>
                        </xsd:restriction>
                    </xsd:complexContent>
                </xsd:complexType>
            </xsd:schema>
        </wsdl:types>

    and the message to be:

        <wsdl:message name="addRequest">
            <wsdl:part name="username" type="xsd:string"/>
            <wsdl:part name="password" type="xsd:string"/>
            ...
            <wsdl:part name="gender" type="xsd:string"/>
            <wsdl:part name="state" type="xsd:string"/>
            <wsdl:part name="timeZone" type="xsd:string"/>
            <wsdl:part name="SOCs" type="impl:SOCArray"/>
        </wsdl:message>

    I am still getting the same error as before when I try to call the add
    method.  I've looked for solutions on the net, but the error message is
    pretty vague, so it's not an easy search.

    Can anybody help me identify what I'm doing wrong?

    Thanks in advance,
    Shelli




Re: Deserialization(?) Error on String Array

Posted by Anne Thomas Manes <at...@gmail.com>.
Shelli,

Are you using rpc/encoded or rpc/literal?

If you are using rpc/encoded, then you need to define the array using
soapenc:Array. If you are using rpc/literal, then you need to define the
array as a complex type (not an element) with a maxOccurs="unbounded" and
reference the type from your message part. (You can't mix elements and types
in your message parts -- the fact that your other parts reference types
tells me that you are using rpc style rather than document style).

So, if you are using rpc/literal, your definition should look something like
this:

<wsdl:types>
       <xsd:schema
targetNamespace="http://clearmode.com:80/ws/ConsumerProvision<http://clearmode.com/ws/ConsumerProvision>
"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema">

              <xsd:complexType name="SOCArray">
                   <xsd:sequence>
                       <xsd:element name="SOC" type="xsd:string"
maxOccurs="unbounded"/>
                   </xsd:sequence>
              </xsd:complexType>

       </xsd:schema>
   </wsdl:types>

and add it to the message definiton:

   <wsdl:message name="addRequest">
       <wsdl:part name="username" type="xsd:string"/>
       <wsdl:part name="password" type="xsd:string"/>
       ...
       <wsdl:part name="gender" type="xsd:string"/>
        <wsdl:part name="state" type="xsd:string"/>
       <wsdl:part name="timeZone" type="xsd:string"/>
       <wsdl:part name="SOCs" type="impl:SOCArray"/>
   </wsdl:message>

Anne

On 1/6/06, Shelli D. Orton <sh...@wmode.com> wrote:
>
> I should have mentioned in the original post, that with the second WSDL,
> there is no SOCArray class.  The Java methods receive/pass a String[]
> array.
> I was hoping by changing to that I wouldn't have the deserialization error
> I'm getting.
>
> Thanks again,
> Shelli
>
> -----Original Message-----
> From: Shelli D. Orton [mailto:shelli.orton@wmode.com]
> Sent: Friday, January 06, 2006 3:57 PM
> To: axis-user@ws.apache.org
> Subject: Deserialization(?) Error on String Array
>
>
> Hi,
>
> I have to make some modifications to an existing (working) webservice.  We
> needed to add a new parameter to one of the existing methods, an array of
> strings.  I originall created a a new type as follows in the WSDL:
>
>     <wsdl:types>
>         <xsd:schema
> targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
>           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>             <xsd:element name="SOCArray">
>                 <xsd:complexType>
>                     <xsd:sequence>
>                         <xsd:element name="SOC" type="xsd:string"
> maxOccurs="unbounded"/>
>                     </xsd:sequence>
>                 </xsd:complexType>
>             </xsd:element>
>
>         </xsd:schema>
>     </wsdl:types>
>
> and added it to the message definiton:
>
>     <wsdl:message name="addRequest">
>         <wsdl:part name="username" type="xsd:string"/>
>         <wsdl:part name="password" type="xsd:string"/>
>         ...
>         <wsdl:part name="gender" type="xsd:string"/>
>         <wsdl:part name="state" type="xsd:string"/>
>         <wsdl:part name="timeZone" type="xsd:string"/>
>         <wsdl:part name="SOCs" element="impl:SOCArray"/>
>     </wsdl:message>
>
> When I ran WSDL2Java, it created an SOCArray class.  During testing of the
> modified service, I get the following error when I try to call the
> addRequest:
>
>
> Exception caught: java.lang.reflect.InvocationTargetException
> AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> faultSubcode:
> faultString: java.lang.reflect.InvocationTargetException
> faultActor:
> faultNode:
> faultDetail:
>         {http://xml.apache.org/axis/}hostname:localhost
>
> java.lang.reflect.InvocationTargetException
>         at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java
> :2
> 21)
>         at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java
> :12
> 8)
>         at
> org.apache.axis.encoding.DeserializationContext.endElement
> (DeserializationCo
> ntext.java:1087)
>         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
>         at org.apache.crimson.parser.Parser2.content(Unknown Source)
>         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
>         at org.apache.crimson.parser.Parser2.content(Unknown Source)
>         at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
>         at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
>         at org.apache.crimson.parser.Parser2.parse(Unknown Source)
>         at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(Unknown Source)
>         at
> org.apache.axis.encoding.DeserializationContext.parse
> (DeserializationContext
> .java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>         at
> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke
> (MustUnderstandChe
> cker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
>         at org.apache.axis.client.Call.invoke(Call.java:2748)
>         at org.apache.axis.client.Call.invoke(Call.java:2424)
>         at org.apache.axis.client.Call.invoke(Call.java:2347)
>         at org.apache.axis.client.Call.invoke(Call.java:1804)
>         at
>
> com.wmode.clearmode.applications.provisioningengine..ConsumerProvisionSoapBi
> ndingStub.add(ConsumerProvisionSoapBindingStub.java:119)
>         at
> com.wmode.clearmode.applications.provisioningengine.ClientTest.main
> (ClientTe
> st.java:111)
>
> Since I couldn't figure out what the serialization problem was, I modified
> the WSDL again to define the type like this:
>
>     <wsdl:types>
>         <xsd:schema
> targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
>                     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>             <xsd:complexType name="SOCArray">
>                 <xsd:complexContent>
>                     <xsd:restriction base="soapenc:Array">
>                         <xsd:attribute ref="soapenc:arrayType"
> wsdl:arrayType="xsd:string[]"/>
>                     </xsd:restriction>
>                 </xsd:complexContent>
>             </xsd:complexType>
>         </xsd:schema>
>     </wsdl:types>
>
> and the message to be:
>
>     <wsdl:message name="addRequest">
>         <wsdl:part name="username" type="xsd:string"/>
>         <wsdl:part name="password" type="xsd:string"/>
>         ...
>         <wsdl:part name="gender" type="xsd:string"/>
>         <wsdl:part name="state" type="xsd:string"/>
>         <wsdl:part name="timeZone" type="xsd:string"/>
>         <wsdl:part name="SOCs" type="impl:SOCArray"/>
>     </wsdl:message>
>
> I am still getting the same error as before when I try to call the add
> method.  I've looked for solutions on the net, but the error message is
> pretty vague, so it's not an easy search.
>
> Can anybody help me identify what I'm doing wrong?
>
> Thanks in advance,
> Shelli
>
>

Re: Deserialization(?) Error on String Array

Posted by iksrazal <ik...@gmail.com>.
Shelli, 

I'm not a big fan of soap encoded arrays, but I used to use them alot and I 
may be able to help. Doc / Lit is the way things are going. Nevertheless, try 
posting your original wsdl, and mention where you want to put your String 
array. Chances are though, your wsdl may be fine. 

Your Deserialization Error may just mean that your client can't find the wsdl 
or its mapping. It can be a tricky problem. Try searching for 
org.apache.axis.encoding.ser.BeanSerializerFactory and 
org.apache.axis.encoding.ser.BeanDeserializerFactory . 

HTH,
iksrazal

Em Sexta 06 Janeiro 2006 21:09, o Shelli D. Orton escreveu:
> I should have mentioned in the original post, that with the second WSDL,
> there is no SOCArray class.  The Java methods receive/pass a String[]
> array. I was hoping by changing to that I wouldn't have the deserialization
> error I'm getting.
>
> Thanks again,
> Shelli
>
> -----Original Message-----
> From: Shelli D. Orton [mailto:shelli.orton@wmode.com]
> Sent: Friday, January 06, 2006 3:57 PM
> To: axis-user@ws.apache.org
> Subject: Deserialization(?) Error on String Array
>
>
> Hi,
>
> I have to make some modifications to an existing (working) webservice.  We
> needed to add a new parameter to one of the existing methods, an array of
> strings.  I originall created a a new type as follows in the WSDL:
>
>     <wsdl:types>
>         <xsd:schema
> targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
>           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>             <xsd:element name="SOCArray">
>                 <xsd:complexType>
>                     <xsd:sequence>
>                         <xsd:element name="SOC" type="xsd:string"
> maxOccurs="unbounded"/>
>                     </xsd:sequence>
>                 </xsd:complexType>
>             </xsd:element>
>
>         </xsd:schema>
>     </wsdl:types>
>
> and added it to the message definiton:
>
>     <wsdl:message name="addRequest">
>         <wsdl:part name="username" type="xsd:string"/>
>         <wsdl:part name="password" type="xsd:string"/>
>         ...
>         <wsdl:part name="gender" type="xsd:string"/>
>         <wsdl:part name="state" type="xsd:string"/>
>         <wsdl:part name="timeZone" type="xsd:string"/>
>         <wsdl:part name="SOCs" element="impl:SOCArray"/>
>     </wsdl:message>
>
> When I ran WSDL2Java, it created an SOCArray class.  During testing of the
> modified service, I get the following error when I try to call the
> addRequest:
>
>
> Exception caught: java.lang.reflect.InvocationTargetException
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: java.lang.reflect.InvocationTargetException
>  faultActor:
>  faultNode:
>  faultDetail:
> 	{http://xml.apache.org/axis/}hostname:localhost
>
> java.lang.reflect.InvocationTargetException
> 	at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:
>2 21)
> 	at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:1
>2 8)
> 	at
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationC
>o ntext.java:1087)
> 	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
> 	at org.apache.crimson.parser.Parser2.content(Unknown Source)
> 	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
> 	at org.apache.crimson.parser.Parser2.content(Unknown Source)
> 	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
> 	at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
> 	at org.apache.crimson.parser.Parser2.parse(Unknown Source)
> 	at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(Unknown Source)
> 	at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContex
>t .java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at
> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandCh
>e cker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at
> com.wmode.clearmode.applications.provisioningengine..ConsumerProvisionSoapB
>i ndingStub.add(ConsumerProvisionSoapBindingStub.java:119)
> 	at
> com.wmode.clearmode.applications.provisioningengine.ClientTest.main(ClientT
>e st.java:111)
>
> Since I couldn't figure out what the serialization problem was, I modified
> the WSDL again to define the type like this:
>
>     <wsdl:types>
>         <xsd:schema
> targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
>                     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>             <xsd:complexType name="SOCArray">
>                 <xsd:complexContent>
>                     <xsd:restriction base="soapenc:Array">
>                         <xsd:attribute ref="soapenc:arrayType"
> wsdl:arrayType="xsd:string[]"/>
>                     </xsd:restriction>
>                 </xsd:complexContent>
>             </xsd:complexType>
>         </xsd:schema>
>     </wsdl:types>
>
> and the message to be:
>
>     <wsdl:message name="addRequest">
>         <wsdl:part name="username" type="xsd:string"/>
>         <wsdl:part name="password" type="xsd:string"/>
>         ...
>         <wsdl:part name="gender" type="xsd:string"/>
>         <wsdl:part name="state" type="xsd:string"/>
>         <wsdl:part name="timeZone" type="xsd:string"/>
>         <wsdl:part name="SOCs" type="impl:SOCArray"/>
>     </wsdl:message>
>
> I am still getting the same error as before when I try to call the add
> method.  I've looked for solutions on the net, but the error message is
> pretty vague, so it's not an easy search.
>
> Can anybody help me identify what I'm doing wrong?
>
> Thanks in advance,
> Shelli

-- 
http://www.braziloutsource.com/

RE: Deserialization(?) Error on String Array

Posted by "Shelli D. Orton" <sh...@wmode.com>.
I should have mentioned in the original post, that with the second WSDL,
there is no SOCArray class.  The Java methods receive/pass a String[] array.
I was hoping by changing to that I wouldn't have the deserialization error
I'm getting.

Thanks again,
Shelli

-----Original Message-----
From: Shelli D. Orton [mailto:shelli.orton@wmode.com]
Sent: Friday, January 06, 2006 3:57 PM
To: axis-user@ws.apache.org
Subject: Deserialization(?) Error on String Array


Hi,

I have to make some modifications to an existing (working) webservice.  We
needed to add a new parameter to one of the existing methods, an array of
strings.  I originall created a a new type as follows in the WSDL:

    <wsdl:types>
        <xsd:schema
targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">

            <xsd:element name="SOCArray">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="SOC" type="xsd:string"
maxOccurs="unbounded"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

        </xsd:schema>
    </wsdl:types>

and added it to the message definiton:

    <wsdl:message name="addRequest">
        <wsdl:part name="username" type="xsd:string"/>
        <wsdl:part name="password" type="xsd:string"/>
        ...
        <wsdl:part name="gender" type="xsd:string"/>
        <wsdl:part name="state" type="xsd:string"/>
        <wsdl:part name="timeZone" type="xsd:string"/>
        <wsdl:part name="SOCs" element="impl:SOCArray"/>
    </wsdl:message>

When I ran WSDL2Java, it created an SOCArray class.  During testing of the
modified service, I get the following error when I try to call the
addRequest:


Exception caught: java.lang.reflect.InvocationTargetException
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
	{http://xml.apache.org/axis/}hostname:localhost

java.lang.reflect.InvocationTargetException
	at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:2
21)
	at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:12
8)
	at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo
ntext.java:1087)
	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
	at org.apache.crimson.parser.Parser2.content(Unknown Source)
	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
	at org.apache.crimson.parser.Parser2.content(Unknown Source)
	at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
	at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
	at org.apache.crimson.parser.Parser2.parse(Unknown Source)
	at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(Unknown Source)
	at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext
.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
	at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChe
cker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
	at org.apache.axis.client.Call.invoke(Call.java:2748)
	at org.apache.axis.client.Call.invoke(Call.java:2424)
	at org.apache.axis.client.Call.invoke(Call.java:2347)
	at org.apache.axis.client.Call.invoke(Call.java:1804)
	at
com.wmode.clearmode.applications.provisioningengine..ConsumerProvisionSoapBi
ndingStub.add(ConsumerProvisionSoapBindingStub.java:119)
	at
com.wmode.clearmode.applications.provisioningengine.ClientTest.main(ClientTe
st.java:111)

Since I couldn't figure out what the serialization problem was, I modified
the WSDL again to define the type like this:

    <wsdl:types>
        <xsd:schema
targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:complexType name="SOCArray">
                <xsd:complexContent>
                    <xsd:restriction base="soapenc:Array">
                        <xsd:attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]"/>
                    </xsd:restriction>
                </xsd:complexContent>
            </xsd:complexType>
        </xsd:schema>
    </wsdl:types>

and the message to be:

    <wsdl:message name="addRequest">
        <wsdl:part name="username" type="xsd:string"/>
        <wsdl:part name="password" type="xsd:string"/>
        ...
        <wsdl:part name="gender" type="xsd:string"/>
        <wsdl:part name="state" type="xsd:string"/>
        <wsdl:part name="timeZone" type="xsd:string"/>
        <wsdl:part name="SOCs" type="impl:SOCArray"/>
    </wsdl:message>

I am still getting the same error as before when I try to call the add
method.  I've looked for solutions on the net, but the error message is
pretty vague, so it's not an easy search.

Can anybody help me identify what I'm doing wrong?

Thanks in advance,
Shelli