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 dancantong <da...@hotmail.com> on 2008/04/30 17:35:15 UTC

Bad types exception whith DataHandler attatchment invocation

Hi!
I'm trying to invoke a Web Service published through AXIS from a Spring
based web application.
The operation being invoked has some DataHandler arguments.
Here is how I construct the DataHandler client code:

Code:

OctetStreamDataSource("objectData", new OctetStream(readBytes(themeFile)));
DataHandler objectData = new DataHandler(dataSource);

The invocation returns with the following exception:

Code:

org.xml.sax.SAXException: Bad types (class [B -> class
javax.activation.DataHandler)
 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(Unknown
Source)
 at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.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: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
org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.performJaxRpcCall(JaxRpcPortClientInterceptor.java:657)
 at
org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.doInvoke(JaxRpcPortClientInterceptor.java:591)
 at
org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.invoke(JaxRpcPortClientInterceptor.java:562)
 at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 at $Proxy11.addMediaObject(Unknown Source)
 at ...


The generated SOAP invocation is as follows:

Code:

POST /oma-dl-server/services/ThemeProvisioningService HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 127.0.0.1:8085
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1130

<?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>
<addMediaObject xmlns="http://theme-provisioning">
<objectID>testObjectID</objectID><objectVersion>1</objectVersion>
<objectSize>1111</objectSize><objectInstallSize>1111</objectInstallSize>
<progressiveDownloadData>false</progressiveDownloadData><mimeType>asdf</mimeType>
<fileName>testFile</fileName><objectData
xsi:nil="true"/><metaName>asdf</metaName>
<metaDescription>asdf</metaDescription><metaTextDisplay>asdf</metaTextDisplay>
<metaTextID>asdf</metaTextID><metaInfoURL>sdfg</metaInfoURL><metaInstallParam>asdf</metaInstallParam>
<metaLicenseMimeType>asdf</metaLicenseMimeType><metaLicenseType>asdf</metaLicenseType>
<metaLicenseOrder>asdf</metaLicenseOrder><metaLicenseData xsi:nil="true"/>
<metaEnvironmentType>asdf</metaEnvironmentType><metaEnvironmentData
xsi:nil="true"/>
<metaSupressUserConfirmation>ad</metaSupressUserConfirmation></addMediaObject>
</soapenv:Body>
</soapenv:Envelope>

The WSDL operations is:

Code:

<element name="addMediaObject">
    <complexType>
     <sequence>
      <element name="objectID" type="xsd:string"/>
      <element name="objectVersion" type="xsd:string"/>
      <element name="objectSize" type="xsd:int"/>
      <element name="objectInstallSize" type="xsd:int"/>
      <element name="progressiveDownloadData" type="xsd:boolean"/>
      <element name="mimeType" type="xsd:string"/>
      <element name="fileName" type="xsd:string"/>
      <element name="objectData" type="xsd:base64Binary"/>
      <element name="metaName" type="xsd:string"/>
      <element name="metaDescription" type="xsd:string"/>
      <element name="metaTextDisplay" type="xsd:string"/>
      <element name="metaTextID" type="xsd:string"/>
      <element name="metaInfoURL" type="xsd:string"/>
      <element name="metaInstallParam" type="xsd:string"/>
      <element name="metaLicenseMimeType" type="xsd:string"/>
      <element name="metaLicenseType" type="xsd:string"/>
      <element name="metaLicenseOrder" type="xsd:string"/>
      <element name="metaLicenseData" type="xsd:base64Binary"/>
      <element name="metaEnvironmentType" type="xsd:string"/>
      <element name="metaEnvironmentData" type="xsd:base64Binary"/>
      <element name="metaSupressUserConfirmation" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="addMediaObjectResponse">
    <complexType>
     <sequence>
      <element name="addMediaObjectReturn" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>

Any help will be appreciated.

Thank you in advance.
Edit/Delete Message
-- 
View this message in context: http://www.nabble.com/Bad-types-exception-whith-DataHandler-attatchment-invocation-tp16985566p16985566.html
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