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 Tom Bollwitt <Bo...@crlcorp.com> on 2006/05/05 20:24:23 UTC

Calendar classCastException

Hello,
 
Im a newbie to AXIS and am having troubles with Calendars.
I assume its something simple, but cant seem to figure it out.
Any help is MUCH appreciated.
 
 
 
Here is the error
 
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode: 
faultString: java.lang.ClassCastException: java.util.GregorianCalendar
faultActor: 
faultNode: 
 
faultDetail: 
{http://xml.apache.org/axis/}hostname:C1002441
java.lang.ClassCastException: java.util.GregorianCalendar
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
va:222)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
a:129)
at
org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
onContext.java:1087)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(
AbstractSAXParser.java:633)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEnd
Element(XMLNSDocumentScannerImpl.java:719)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:16
85)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(XMLDocumentFragmentScannerImpl.java:368)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:834)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
a:148)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstr
actSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
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:435)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstan
dChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at
com.crlcorp.webservice.AuthorizeLabSoapBindingStub.processAuthorization(
AuthorizeLabSoapBindingStub.java:205)
at test.TestClient.main(TestClient.java:36)
 
 
 
 
Here is the generated WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:AuthorizeLabTest"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:AuthorizeLabTest" xmlns:intf="urn:AuthorizeLabTest"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://model.webservice.crlcorp.com"
xmlns:tns2="http://datautil.crlcorp.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
 <wsdl:types>
  <schema targetNamespace="http://model.webservice.crlcorp.com"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="urn:AuthorizeLabTest"/>
   <import namespace="http://datautil.crlcorp.com"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="AuthorizationRequest">
    <sequence>
     <element name="bloodState" nillable="true" type="soapenc:string"/>
     <element name="cocID" nillable="true" type="soapenc:string"/>
     <element name="urinState" nillable="true" type="soapenc:string"/>
     <element name="userId" nillable="true" type="soapenc:string"/>
     <element name="userPwd" nillable="true" type="soapenc:string"/>
    </sequence>
   </complexType>
   <complexType name="AuthorizationResult">
    <sequence>
     <element name="bloodMessage" nillable="true"
type="soapenc:string"/>
     <element name="cocId" nillable="true" type="soapenc:string"/>
     <element name="message" nillable="true" type="soapenc:string"/>
     <element name="urinMessage" nillable="true" type="soapenc:string"/>
    </sequence>
   </complexType>
   <complexType name="LabTestAuthorization">
    <sequence>
     <element name="id" nillable="true" type="soapenc:long"/>
     <element name="cocID" nillable="true" type="soapenc:string"/>
     <element name="bloodTestState" nillable="true"
type="soapenc:string"/>
     <element name="urinTestState" nillable="true"
type="soapenc:string"/>
     <element name="lastDateModified" nillable="true"
type="xsd:dateTime"/>
    </sequence>
   </complexType>
  </schema>
  <schema targetNamespace="http://datautil.crlcorp.com"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="urn:AuthorizeLabTest"/>
   <import namespace="http://model.webservice.crlcorp.com"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="DatabaseException">
    <sequence/>
   </complexType>
  </schema>
  <schema targetNamespace="urn:AuthorizeLabTest"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://datautil.crlcorp.com"/>
   <import namespace="http://model.webservice.crlcorp.com"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_tns2_LabTestAuthorization">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:LabTestAuthorization[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="getAuthorizationsResponse">

      <wsdl:part name="getAuthorizationsReturn"
type="impl:ArrayOf_tns2_LabTestAuthorization"/>

   </wsdl:message>

   <wsdl:message name="getAuthorizationByCocIdResponse">

      <wsdl:part name="getAuthorizationByCocIdReturn"
type="tns1:LabTestAuthorization"/>

   </wsdl:message>

   <wsdl:message name="getAuthorizationByCocIdRequest">

      <wsdl:part name="in0" type="soapenc:string"/>

   </wsdl:message>

   <wsdl:message name="getAuthorizationsRequest">

   </wsdl:message>

   <wsdl:message name="DatabaseException">

      <wsdl:part name="fault" type="tns2:DatabaseException"/>

   </wsdl:message>

   <wsdl:message name="processAuthorizationRequest">

      <wsdl:part name="in0" type="tns1:AuthorizationRequest"/>

   </wsdl:message>

   <wsdl:message name="processAuthorizationResponse">

      <wsdl:part name="processAuthorizationReturn"
type="tns1:AuthorizationResult"/>

   </wsdl:message>

   <wsdl:portType name="AuthorizeLabTest">

      <wsdl:operation name="processAuthorization" parameterOrder="in0">

         <wsdl:input message="impl:processAuthorizationRequest"
name="processAuthorizationRequest"/>

         <wsdl:output message="impl:processAuthorizationResponse"
name="processAuthorizationResponse"/>

         <wsdl:fault message="impl:DatabaseException"
name="DatabaseException"/>

      </wsdl:operation>

      <wsdl:operation name="getAuthorizations">

         <wsdl:input message="impl:getAuthorizationsRequest"
name="getAuthorizationsRequest"/>

         <wsdl:output message="impl:getAuthorizationsResponse"
name="getAuthorizationsResponse"/>

         <wsdl:fault message="impl:DatabaseException"
name="DatabaseException"/>

      </wsdl:operation>

      <wsdl:operation name="getAuthorizationByCocId"
parameterOrder="in0">

         <wsdl:input message="impl:getAuthorizationByCocIdRequest"
name="getAuthorizationByCocIdRequest"/>

         <wsdl:output message="impl:getAuthorizationByCocIdResponse"
name="getAuthorizationByCocIdResponse"/>

         <wsdl:fault message="impl:DatabaseException"
name="DatabaseException"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="AuthorizeLabSoapBinding"
type="impl:AuthorizeLabTest">

      <wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="processAuthorization">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="processAuthorizationRequest">

            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:AuthorizeLabTest" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="processAuthorizationResponse">

            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:AuthorizeLabTest" use="encoded"/>

         </wsdl:output>

         <wsdl:fault name="DatabaseException">

            <wsdlsoap:fault
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
name="DatabaseException" namespace="urn:AuthorizeLabTest"
use="encoded"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="getAuthorizations">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getAuthorizationsRequest">

            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:AuthorizeLabTest" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="getAuthorizationsResponse">

            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:AuthorizeLabTest" use="encoded"/>

         </wsdl:output>

         <wsdl:fault name="DatabaseException">

            <wsdlsoap:fault
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
name="DatabaseException" namespace="urn:AuthorizeLabTest"
use="encoded"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="getAuthorizationByCocId">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getAuthorizationByCocIdRequest">

            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:AuthorizeLabTest" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="getAuthorizationByCocIdResponse">

            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:AuthorizeLabTest" use="encoded"/>

         </wsdl:output>

         <wsdl:fault name="DatabaseException">

            <wsdlsoap:fault
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
name="DatabaseException" namespace="urn:AuthorizeLabTest"
use="encoded"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="AuthorizeLabTestService">

      <wsdl:port binding="impl:AuthorizeLabSoapBinding"
name="AuthorizeLab">

         <wsdlsoap:address
location="http://127.0.0.1:8080/escreen-test/services/AuthorizeLab"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>


Re: Calendar classCastException

Posted by robert lazarski <ro...@gmail.com>.
I'm not sure if you can use GregorianCalendar directly with xsd:dateTime in
all databinding frameworks. I know this works:

Calendar cal = new GregorianCalendar();

And this also works:

Calendar now = Calendar.getInstance();

What may not as I've never tried it is this:

GregorianCalendar gregCal = new GregorianCalendar(2021,02,01);

And then gregCal as your param to your complex object. So I'd try a vanilla
Calendar to see if the problem is xsd:dateTime in axis 1.x doesn't accept a
sub-type of calendar.

HTH,
Robert
http://www.braziloutsource.com/

On 5/5/06, Tom Bollwitt <BollwittT@crlcorp.com > wrote:
>
> Hello,
>
> Im a newbie to AXIS and am having troubles with Calendars.
> I assume its something simple, but cant seem to figure it out.
> Any help is MUCH appreciated.
>
>
>
> Here is the error
>
> AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException<http://schemas.xmlsoap.org/soap/envelope/%7DServer.userException>
> faultSubcode:
> faultString: java.lang.ClassCastException: java.util.GregorianCalendar
> faultActor:
> faultNode:
>
> faultDetail:
> {http://xml.apache.org/axis/}hostname:C1002441<http://xml.apache.org/axis/%7Dhostname:C1002441>
> java.lang.ClassCastException: java.util.GregorianCalendar
> at org.apache.axis.message.SOAPFaultBuilder.createFault(
> SOAPFaultBuilder.java:222)
> at org.apache.axis.message.SOAPFaultBuilder.endElement(
> SOAPFaultBuilder.java:129)
> at org.apache.axis.encoding.DeserializationContext.endElement(
> DeserializationContext.java:1087)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement
> (AbstractSAXParser.java:633)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement
> (XMLNSDocumentScannerImpl.java:719)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
> (XMLDocumentFragmentScannerImpl.java:1685)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
> (XMLDocumentFragmentScannerImpl.java:368)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(
> XML11Configuration.java:834)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(
> XML11Configuration.java:764)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(
> XMLParser.java:148)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(
> AbstractSAXParser.java:1242)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
> 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:435)
> at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(
> MustUnderstandChecker.java:62)
> at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
> at org.apache.axis.client.Call.invoke(Call.java:2767)
> at org.apache.axis.client.Call.invoke(Call.java:2443)
> at org.apache.axis.client.Call.invoke(Call.java:2366)
> at org.apache.axis.client.Call.invoke(Call.java:1812)
> at com.crlcorp.webservice.AuthorizeLabSoapBindingStub.processAuthorization
> (AuthorizeLabSoapBindingStub.java:205)
> at test.TestClient.main(TestClient.java:36)
>
>
>
>
> Here is the generated WSDL:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:AuthorizeLabTest"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="urn:AuthorizeLabTest" xmlns:intf="urn:AuthorizeLabTest"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="
> http://model.webservice.crlcorp.com" xmlns:tns2="
> http://datautil.crlcorp.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.3
> Built on Oct 05, 2005 (05:23:37 EDT)-->
>  <wsdl:types>
>   <schema targetNamespace="http://model.webservice.crlcorp.com " xmlns="
> http://www.w3.org/2001/XMLSchema">
>    <import namespace="urn:AuthorizeLabTest"/>
>    <import namespace="http://datautil.crlcorp.com"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/<http://schemas.xmlsoap.org/soap/encoding/%22/>
> >
>    <complexType name="AuthorizationRequest">
>     <sequence>
>      <element name="bloodState" nillable="true" type="soapenc:string"/>
>      <element name="cocID" nillable="true" type="soapenc:string"/>
>      <element name="urinState" nillable="true" type="soapenc:string"/>
>      <element name="userId" nillable="true" type="soapenc:string"/>
>      <element name="userPwd" nillable="true" type="soapenc:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="AuthorizationResult">
>     <sequence>
>      <element name="bloodMessage" nillable="true" type="soapenc:string"/>
>      <element name="cocId" nillable="true" type="soapenc:string"/>
>      <element name="message" nillable="true" type="soapenc:string"/>
>      <element name="urinMessage" nillable="true" type="soapenc:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="LabTestAuthorization">
>     <sequence>
>      <element name="id" nillable="true" type="soapenc:long"/>
>      <element name="cocID" nillable="true" type="soapenc:string"/>
>      <element name="bloodTestState" nillable="true"
> type="soapenc:string"/>
>      <element name="urinTestState" nillable="true" type="soapenc:string"/>
>      <element name="lastDateModified" nillable="true"
> type="xsd:dateTime"/>
>     </sequence>
>    </complexType>
>   </schema>
>   <schema targetNamespace="http://datautil.crlcorp.com" xmlns="http://www.w3.org/2001/XMLSchema
> ">
>    <import namespace="urn:AuthorizeLabTest"/>
>    <import namespace="http://model.webservice.crlcorp.com"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/<http://schemas.xmlsoap.org/soap/encoding/%22/>
> >
>    <complexType name="DatabaseException">
>     <sequence/>
>    </complexType>
>   </schema>
>   <schema targetNamespace="urn:AuthorizeLabTest" xmlns="
> http://www.w3.org/2001/XMLSchema">
>    <import namespace="http://datautil.crlcorp.com"/>
>    <import namespace="http://model.webservice.crlcorp.com"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/<http://schemas.xmlsoap.org/soap/encoding/%22/>
> >
>    <complexType name="ArrayOf_tns2_LabTestAuthorization">
>     <complexContent>
>      <restriction base="soapenc:Array">
>       <attribute ref="soapenc:arrayType"
> wsdl:arrayType="tns1:LabTestAuthorization[]"/>
>      </restriction>
>     </complexContent>
>    </complexType>
>   </schema>
>  </wsdl:types>
>
>    <wsdl:message name="getAuthorizationsResponse">
>
>       <wsdl:part name="getAuthorizationsReturn"
> type="impl:ArrayOf_tns2_LabTestAuthorization"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="getAuthorizationByCocIdResponse">
>
>       <wsdl:part name="getAuthorizationByCocIdReturn"
> type="tns1:LabTestAuthorization"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="getAuthorizationByCocIdRequest">
>
>       <wsdl:part name="in0" type="soapenc:string"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="getAuthorizationsRequest">
>
>    </wsdl:message>
>
>    <wsdl:message name="DatabaseException">
>
>       <wsdl:part name="fault" type="tns2:DatabaseException"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="processAuthorizationRequest">
>
>       <wsdl:part name="in0" type="tns1:AuthorizationRequest"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="processAuthorizationResponse">
>
>       <wsdl:part name="processAuthorizationReturn"
> type="tns1:AuthorizationResult"/>
>
>    </wsdl:message>
>
>    <wsdl:portType name="AuthorizeLabTest">
>
>       <wsdl:operation name="processAuthorization" parameterOrder="in0">
>
>          <wsdl:input message="impl:processAuthorizationRequest"
> name="processAuthorizationRequest"/>
>
>          <wsdl:output message="impl:processAuthorizationResponse"
> name="processAuthorizationResponse"/>
>
>          <wsdl:fault message="impl:DatabaseException"
> name="DatabaseException"/>
>
>       </wsdl:operation>
>
>       <wsdl:operation name="getAuthorizations">
>
>          <wsdl:input message="impl:getAuthorizationsRequest"
> name="getAuthorizationsRequest"/>
>
>          <wsdl:output message="impl:getAuthorizationsResponse"
> name="getAuthorizationsResponse"/>
>
>          <wsdl:fault message="impl:DatabaseException"
> name="DatabaseException"/>
>
>       </wsdl:operation>
>
>       <wsdl:operation name="getAuthorizationByCocId" parameterOrder="in0">
>
>          <wsdl:input message="impl:getAuthorizationByCocIdRequest"
> name="getAuthorizationByCocIdRequest"/>
>
>          <wsdl:output message="impl:getAuthorizationByCocIdResponse"
> name="getAuthorizationByCocIdResponse"/>
>
>          <wsdl:fault message="impl:DatabaseException"
> name="DatabaseException"/>
>
>       </wsdl:operation>
>
>    </wsdl:portType>
>
>    <wsdl:binding name="AuthorizeLabSoapBinding"
> type="impl:AuthorizeLabTest">
>
>       <wsdlsoap:binding style="rpc" transport="
> http://schemas.xmlsoap.org/soap/http"/<http://schemas.xmlsoap.org/soap/http%22/>
> >
>
>       <wsdl:operation name="processAuthorization">
>
>          <wsdlsoap:operation soapAction=""/>
>
>          <wsdl:input name="processAuthorizationRequest">
>
>             <wsdlsoap:body encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:input>
>
>          <wsdl:output name="processAuthorizationResponse">
>
>             <wsdlsoap:body encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:output>
>
>          <wsdl:fault name="DatabaseException">
>
>             <wsdlsoap:fault encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/" name="DatabaseException"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:fault>
>
>       </wsdl:operation>
>
>       <wsdl:operation name="getAuthorizations">
>
>          <wsdlsoap:operation soapAction=""/>
>
>          <wsdl:input name="getAuthorizationsRequest">
>
>             <wsdlsoap:body encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:input>
>
>          <wsdl:output name="getAuthorizationsResponse">
>
>             <wsdlsoap:body encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:output>
>
>          <wsdl:fault name="DatabaseException">
>
>             <wsdlsoap:fault encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/" name="DatabaseException"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:fault>
>
>       </wsdl:operation>
>
>       <wsdl:operation name="getAuthorizationByCocId">
>
>          <wsdlsoap:operation soapAction=""/>
>
>          <wsdl:input name="getAuthorizationByCocIdRequest">
>
>             <wsdlsoap:body encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:input>
>
>          <wsdl:output name="getAuthorizationByCocIdResponse">
>
>             <wsdlsoap:body encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:output>
>
>          <wsdl:fault name="DatabaseException">
>
>             <wsdlsoap:fault encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/" name="DatabaseException"
> namespace="urn:AuthorizeLabTest" use="encoded"/>
>
>          </wsdl:fault>
>
>       </wsdl:operation>
>
>    </wsdl:binding>
>
>    <wsdl:service name="AuthorizeLabTestService">
>
>       <wsdl:port binding="impl:AuthorizeLabSoapBinding"
> name="AuthorizeLab">
>
>          <wsdlsoap:address location="http://127.0.0.1:8080/escreen-test/services/AuthorizeLab"/
> <http://127.0.0.1:8080/escreen-test/services/AuthorizeLab%22/>>
>
>       </wsdl:port>
>
>    </wsdl:service>
>
> </wsdl:definitions>
>

Re: Calendar classCastException

Posted by Rhimbo <rh...@yahoo.com>.
Hi Tom,

I am not an expert myself but will try to help until one of the 
other folks replies.

Your error could be unrelated to AXIS itself. It could be that you
just have a bug in your Java code.  

Are you trying to cast a Calendar to a GregorianCalendar anywhere?

Or, are you trying to return a GregorianCalendar object as the
return type of a web service end point?  If so, you might need
a bean mapping construct in your WSDD deployment file for your
service.

Something like this:

  <beanMapping 
      qname="ns:GregorianCalendar" 
      xmlns:ns="http://model.webservice.crlcorp.com"
      languageSpecificType="java:com.crlcorp.webservice.model"/>


If you're writing a JAX-RPC DII client, you will need a 
serializer and de-serializer to help AXIS marshall and unmarshall
the GregorianCalendar object.  Add something like this to your
call.

	Service service = serviceFactory.createService(...);
	Call call = (Call) service.createCall(...);

	BeanSerializerFactory bsf = 
             new BeanSerializerFactory(cl, classQName);
	BeanDeserializerFactory bdf = 
	     new BeanDeserializerFactory(cl, classQName);
	call.registerTypeMapping(cl, classQName, bsf, bdf);


Again, I'm relatively new to AXIS myself, so my apologies if I'm
sending you on the wrong track.

Vartan




--- Tom Bollwitt <Bo...@crlcorp.com> wrote:

> Hello,
>  
> Im a newbie to AXIS and am having troubles with Calendars.
> I assume its something simple, but cant seem to figure it out.
> Any help is MUCH appreciated.
>  
>  
>  
> Here is the error
>  
> AxisFault
> faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> faultSubcode: 
> faultString: java.lang.ClassCastException: java.util.GregorianCalendar
> faultActor: 
> faultNode: 
>  
> faultDetail: 
> {http://xml.apache.org/axis/}hostname:C1002441
> java.lang.ClassCastException: java.util.GregorianCalendar
> at
>
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
> va:222)
> at
>
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
> a:129)
> at
>
org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
> onContext.java:1087)
> at
>
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(
> AbstractSAXParser.java:633)
> at
>
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEnd
> Element(XMLNSDocumentScannerImpl.java:719)
> at
>
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
>
ragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:16
> 85)
> at
>
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
> canDocument(XMLDocumentFragmentScannerImpl.java:368)
> at
>
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
> 1Configuration.java:834)
> at
>
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
> 1Configuration.java:764)
> at
>
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
> a:148)
> at
>
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstr
> actSAXParser.java:1242)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
> 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:435)
> at
>
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstan
> dChecker.java:62)
> at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
> at org.apache.axis.client.Call.invoke(Call.java:2767)
> at org.apache.axis.client.Call.invoke(Call.java:2443)
> at org.apache.axis.client.Call.invoke(Call.java:2366)
> at org.apache.axis.client.Call.invoke(Call.java:1812)
> at
>
com.crlcorp.webservice.AuthorizeLabSoapBindingStub.processAuthorization(
> AuthorizeLabSoapBindingStub.java:205)
> at test.TestClient.main(TestClient.java:36)
>  
>  
>  
>  
> Here is the generated WSDL:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:AuthorizeLabTest"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="urn:AuthorizeLabTest" xmlns:intf="urn:AuthorizeLabTest"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns1="http://model.webservice.crlcorp.com"
> xmlns:tns2="http://datautil.crlcorp.com"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.3
> Built on Oct 05, 2005 (05:23:37 EDT)-->
>  <wsdl:types>
>   <schema targetNamespace="http://model.webservice.crlcorp.com"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <import namespace="urn:AuthorizeLabTest"/>
>    <import namespace="http://datautil.crlcorp.com"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>    <complexType name="AuthorizationRequest">
>     <sequence>
>      <element name="bloodState" nillable="true" type="soapenc:string"/>
>      <element name="cocID" nillable="true" type="soapenc:string"/>
>      <element name="urinState" nillable="true" type="soapenc:string"/>
>      <element name="userId" nillable="true" type="soapenc:string"/>
>      <element name="userPwd" nillable="true" type="soapenc:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="AuthorizationResult">
>     <sequence>
>      <element name="bloodMessage" nillable="true"
> type="soapenc:string"/>
>      <element name="cocId" nillable="true" type="soapenc:string"/>
>      <element name="message" nillable="true" type="soapenc:string"/>
>      <element name="urinMessage" nillable="true"
> type="soapenc:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="LabTestAuthorization">
>     <sequence>
>      <element name="id" nillable="true" type="soapenc:long"/>
>      <element name="cocID" nillable="true" type="soapenc:string"/>
>      <element name="bloodTestState" nillable="true"
> type="soapenc:string"/>
>      <element name="urinTestState" nillable="true"
> type="soapenc:string"/>
>      <element name="lastDateModified" nillable="true"
> type="xsd:dateTime"/>
>     </sequence>
>    </complexType>
>   </schema>
>   <schema targetNamespace="http://datautil.crlcorp.com"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <import namespace="urn:AuthorizeLabTest"/>
>    <import namespace="http://model.webservice.crlcorp.com"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>    <complexType name="DatabaseException">
>     <sequence/>
>    </complexType>
>   </schema>
>   <schema targetNamespace="urn:AuthorizeLabTest"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <import namespace="http://datautil.crlcorp.com"/>
>    <import namespace="http://model.webservice.crlcorp.com"/>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>    <complexType name="ArrayOf_tns2_LabTestAuthorization">
>     <complexContent>
>      <restriction base="soapenc:Array">
>       <attribute ref="soapenc:arrayType"
> wsdl:arrayType="tns1:LabTestAuthorization[]"/>
>      </restriction>
>     </complexContent>
>    </complexType>
>   </schema>
>  </wsdl:types>
> 
>    <wsdl:message name="getAuthorizationsResponse">
> 
>       <wsdl:part name="getAuthorizationsReturn"
> type="impl:ArrayOf_tns2_LabTestAuthorization"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="getAuthorizationByCocIdResponse">
> 
>       <wsdl:part name="getAuthorizationByCocIdReturn"
> type="tns1:LabTestAuthorization"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="getAuthorizationByCocIdRequest">
> 
>       <wsdl:part name="in0" type="soapenc:string"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="getAuthorizationsRequest">
> 
>    </wsdl:message>
> 
>    <wsdl:message name="DatabaseException">
> 
>       <wsdl:part name="fault" type="tns2:DatabaseException"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="processAuthorizationRequest">
> 
>       <wsdl:part name="in0" type="tns1:AuthorizationRequest"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="processAuthorizationResponse">
> 
>       <wsdl:part name="processAuthorizationReturn"
> type="tns1:AuthorizationResult"/>
> 
>    </wsdl:message>
> 
>    <wsdl:portType name="AuthorizeLabTest">
> 
>       <wsdl:operation name="processAuthorization" parameterOrder="in0">
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com