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 Tanguy von Stebut <ta...@fnac.tm.fr> on 2007/08/01 16:49:09 UTC

Can't deal with complex types


When calling my webservice, which takes a Room object as parameter : it is a
simple bean

I've got this error :

############################################################################
#############

org.xml.sax.SAXException: Bad types (class
com.fnac.corp.testws.beans.Room -> class com.fnac.corp.testws.beans.Room)


org.xml.sax.SAXException: Bad types (class
com.fnac.corp.testws.beans.Room -> class com.fnac.corp.testws.beans.Room)
	at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:2
22)
	at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:12
9)
	at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationCo
ntext.java:1087)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
	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.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796
)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
	at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
	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.fnac.corp.testws.components.gen.TestwsSoapBindingStub.getMessage(TestwsS
oapBindingStub.java:155)
	at TestWebService.main(TestWebService.java:26)


############################################################################
#############

As you can see it is the same type, so what is the problem ??



Here is the wsdl :

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="service"
xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="service"
xmlns:intf="service"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://beans.testws.corp.fnac.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.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema targetNamespace="http://beans.testws.corp.fnac.com"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="Room">
    <sequence>
     <element name="color" nillable="true" type="xsd:string"/>
     <element name="floorMaterial" nillable="true" type="xsd:string"/>
     <element name="name" nillable="true" type="xsd:string"/>
     <element name="wallMaterial" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="getMessageRequest">

      <wsdl:part name="room" type="tns1:Room"/>

   </wsdl:message>

   <wsdl:message name="getMessageResponse">

      <wsdl:part name="getMessageReturn" type="xsd:string"/>

   </wsdl:message>

   <wsdl:portType name="WSTesterImpl">

      <wsdl:operation name="getMessage" parameterOrder="room">

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

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

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="testwsSoapBinding" type="impl:WSTesterImpl">

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

      <wsdl:operation name="getMessage">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getMessageRequest">

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

         </wsdl:input>

         <wsdl:output name="getMessageResponse">

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

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="WSTesterImplService">

      <wsdl:port binding="impl:testwsSoapBinding" name="testws">

         <wsdlsoap:address
location="http://127.0.0.1:7001/ws/services/testws"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>




And the bean object class :

package com.fnac.corp.testws.beans;

public class Room {

	private String Name;

	private String color;

	private String wallMaterial;

	private String floorMaterial;

	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public String getWallMaterial() {
		return wallMaterial;
	}

	public void setWallMaterial(String wallMaterial) {
		this.wallMaterial = wallMaterial;
	}

	public String getFloorMaterial() {
		return floorMaterial;
	}

	public void setFloorMaterial(String floorMaterial) {
		this.floorMaterial = floorMaterial;
	}


}



Any help would be welcomed,

Regards,

Tanguy von Stebut

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