Hi there I am building a composite using the Tuscany 2.0-Beta2, The composite includes a single component with one service. After compiling, the contribution loads in Tuscany with no issues. I can even open the WSDL in the browser, but when trying to test the service I get the following exception in SoapUI/AdarnaStorm/EclipseWTP:
Fri Jun 03 11:43:04 EDT 2011:WARN:Error: http://localhost:8090/Registration?wsdl:0: error: src-resolve.a: Could not find type 'conference@http://dc.simple/'. Do you mean to refer to the type named conference (in Registration_3Fwsdl)? I hit a wall with this problem, I have searched the web quite a lot but nothing. It may be a trivial setting that I am overlooking in my code. Basically, the contribution is supposed to be a service to register for a conference. It has three very simple classes, and the composite definition: // ------------------------------- // The Conference POJO: Conference.java package simple.dc.model; public class Conference { private int id; private String topic; // Here getters and setters generated by Eclipse } // ------------------------------- // The remotable interface: Registration.java package simple.dc; import org.oasisopen.sca.annotation.Remotable; import simple.dc.model.Conference; @Remotable public interface Registration { public int register(Conference conference); } // ------------------------------- // The component implementation: RegistrationImpl.java package simple.dc.impl; import org.oasisopen.sca.annotation.Service; import simple.dc.Registration; import simple.dc.model.Conference; @Service(Registration.class) public class RegistrationImpl implements Registration { @Override public int register(Conference conference) { System.out.println("Registering for conference: " + conference.getTopic()); return 1234; //confirmation number } } // ------------------------------- // The composite: SimpleWS.composite <?xml version="1.0" encoding="UTF-8" standalone="no"?> <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="SimpleWSComposite" targetNamespace="http://dc.simple"> <component name="RegistrationComponent"> <implementation.java class="simple.dc.impl.RegistrationImpl"/> <service name="Registration"> <binding.ws uri="http://localhost:8090/Registration"/> </service> </component> </composite> No errors or warnings during compilation. I am using Gradle with the following dependencies: compile group: 'org.apache.tuscany.sca', name: 'tuscany-base-runtime', version: '2.0-Beta2' compile group: 'org.apache.tuscany.sca', name: 'tuscany-binding-ws-runtime-axis2', version: '2.0-Beta2' compile group: 'org.apache.tuscany.sca', name: 'tuscany-host-jetty', version: '2.0-Beta2' compile group: 'org.apache.tuscany.sca', name: 'tuscany-host-http', version: '2.0-Beta2' I install the contribution using bin\tuscany.bat. This is what Tuscany reports once loaded: default> installed main file:/C:/Users/dcueva/Documents/SimpleWS/build/classes/main/ SimpleWS.composite {http://dc.simple}SimpleWSComposite ***running*** default> services RegistrationComponent/Registration binding.ws http://localhost:8090/Registration The generated WSDL does not seem to be valid. I will attach it to this email. I have used several tools to test the WSDL: SoapUI 3.6.1 says: Fri Jun 03 11:43:04 EDT 2011:WARN:Error: http://localhost:8090/Registration?wsdl:0: error: src-resolve.a: Could not find type 'conference@http://dc.simple/'. Do you mean to refer to the type named conference (in Registration_3Fwsdl)? Adarna Storm 1.1 says: System.InvalidOperationException: Unable to import binding 'RegistrationBinding' from namespace 'http://dc.simple/'. ---> System.InvalidOperationException: Unable to import operation 'register'. ---> System.InvalidOperationException: The datatype ' http://dc.simple/:conference' is missing. at System.Xml.Serialization.XmlSchemaImporter.FindDataType(XmlQualifiedName name, TypeFlags flags) WHen validating with wclipse WTP says: - schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. On the following line (warning): <xs:import /> - src-resolve: Cannot resolve the name 'conference' to a(n) 'type definition' component. On the following line (error): <xs:element minOccurs="0" name="arg0" nillable="true" type="conference" /> It seems to be a problem with the namespaces int he generated WSDL. I have changed the namespace declaration in my composite to try various forms, but it did not work. I'd appreciate if someone could take a look and give me some pointers in the right direction. Dave
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="RegistrationService" targetNamespace="http://dc.simple/" xmlns="http://dc.simple/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/"> <wsdl:types> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="conference"> <xs:sequence> <xs:element name="id" type="xs:int" /> <xs:element minOccurs="0" name="topic" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:schema> <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://dc.simple/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import /> <xs:element name="register"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="arg0" nillable="true" type="conference" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="registerResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" type="xs:int" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> </wsdl:types> <wsdl:message name="register"> <wsdl:part name="register" element="register"> </wsdl:part> </wsdl:message> <wsdl:message name="registerResponse"> <wsdl:part name="registerResponse" element="registerResponse"> </wsdl:part> </wsdl:message> <wsdl:portType name="Registration"> <wsdl:operation name="register"> <wsdl:input message="register"> </wsdl:input> <wsdl:output message="registerResponse"> </wsdl:output> </wsdl:operation> </wsdl:portType> <wsdl:binding name="RegistrationBinding" type="Registration"> <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="register"> <SOAP:operation /> <wsdl:input> <SOAP:body use="literal" /> </wsdl:input> <wsdl:output> <SOAP:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Registration"> <wsdl:port name="RegistrationSOAP11Port" binding="RegistrationBinding"> <SOAP:address location="http://localhost:8090/Registration" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
