You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2006/11/09 00:24:02 UTC

[jira] Commented: (SM-739) wsdl for pojos exported by jsr181 endpoint is missing complextypes from other namespaces than the service itself

    [ https://issues.apache.org/activemq/browse/SM-739?page=comments#action_37376 ] 
            
Christian Schneider commented on SM-739:
----------------------------------------

I have debuged the problem and found out where we get our wrong wsdl from.

The problem is inside Jsr181Endpoint.java in method registerService:
http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java

First the wsdl is generated by xfire:

 // If the wsdl has not been provided,
        // generate one
        if (this.description == null) {
            this.description = generateWsdl();

Then later it is overwritten:
// Flatten it
definition = new WSDLFlattener(definition).getDefinition(interfaceName);
description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);

The description that is generated by xfire is correct about the complextype. The decription from the WSDLFactory is wrong.
Does anybody know why the wsdl from xfire can not be used?


> wsdl for pojos exported by jsr181 endpoint is missing complextypes from other namespaces than the service itself
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SM-739
>                 URL: https://issues.apache.org/activemq/browse/SM-739
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-jsr181
>    Affects Versions: 3.0
>            Reporter: Christian Schneider
>         Attachments: jsr181wsdlproblem..zip
>
>
> I am exporting a pojo Service in namespace http://test1 that uses a Class from namespace http://test2 as a jsr181 endpoint.
> The wsdl I get from jconsole for the endpoint does not include the definition of the Complextype Person from http://test2.
> If you put the Person class in the package test1 the wsdl looks fine. The problem does not happen when using xfire without servicemix. 
> Thanks to Ken Berthelot for reporting the problem on the mailing list. http://mail-archives.apache.org/mod_mbox/geronimo-servicemix-users/200611.mbox/browser
> ---
> My xbean.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://xbean.org/schemas/spring/1.0"
> 	xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
> 	<classpath>
> 		<location>.</location>
> 	</classpath>
> 	<jsr181:endpoint
> 		pojoClass="test1.PersonServiceImpl"
> 		serviceInterface="test1.PersonService"
> 		style="wrapped">
> 	</jsr181:endpoint>
> </beans>
> ---
> My Classes
> package test1;
> import test2.Person;
> public interface PersonService {
> 	public abstract void testPerson(Person person);
> }
> package test1;
> import test2.Person;
> public class PersonServiceImpl implements PersonService {
> 	/* (non-Javadoc)
> 	 * @see test1.PersonService#testPerson(test2.Person)
> 	 */
> 	public void testPerson(Person person) {
> 		
> 	}
> }
> package test2;
> public class Person {
> 	String name;
> 	public String getName() {
> 		return name;
> 	}
> 	public void setName(String name) {
> 		this.name = name;
> 	}
> }
> ----
> The wsdl
> <?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://test2" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:tns="http://test1" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test1">
>   <wsdl:types>
>     <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://test1">
> <xsd:element name="testPerson">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="ns1:Person"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="testPersonResponse">
> <xsd:complexType/>
> </xsd:element>
> </xsd:schema>
>   </wsdl:types>
>   <wsdl:message name="testPersonResponse">
>     <wsdl:part element="tns:testPersonResponse" name="parameters"/>
>   </wsdl:message>
>   <wsdl:message name="testPersonRequest">
>     <wsdl:part element="tns:testPerson" name="parameters"/>
>   </wsdl:message>
>   <wsdl:portType name="PersonServicePortType">
>     <wsdl:operation name="testPerson">
>       <wsdl:input message="tns:testPersonRequest" name="testPersonRequest"/>
>       <wsdl:output message="tns:testPersonResponse" name="testPersonResponse"/>
>     </wsdl:operation>
>   </wsdl:portType>
> </wsdl:definitions>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira