WSDL data types not generated correctly
---------------------------------------
Key: TUSCANY-3869
URL: https://issues.apache.org/jira/browse/TUSCANY-3869
Project: Tuscany
Issue Type: Bug
Components: Java SCA Axis Binding Extension
Affects Versions: Java-SCA-2.0-Beta2
Environment: All
Reporter: David Cueva
Fix For: Java-SCA-2.0-Beta2
When a @Remotable interface receives or returns a POJO, the WSDL generated when
using <binding.ws /> is not valid.
This limits the applicability of <binding.ws /> to methods receiving or
returning primitive types or wrappers only.
If the WSDL is loaded in SoapUI, following error is thrown:
{noformat}
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)?
{noformat}
It seems that the namespace being used for the type definition is missing or
misplaced
---
More information:
Mail thread
[http://mail-archives.apache.org/mod_mbox/tuscany-user/201106.mbox/%[email protected]%3E]
Sample project to reproduce the issue:
[http://cid-6f107cd11157608a.office.live.com/self.aspx/Tuscany/02.SimpleWS.zip]
The offending WSDL
[http://cid-6f107cd11157608a.office.live.com/self.aspx/Tuscany/Registration.wsdl]
Scott Kurz has indicated this is probably related to
[https://issues.apache.org/jira/browse/TUSCANY-3298]
Info on the 1.x issue already resolved
[http://www.mail-archive.com/dev%40tuscany.apache.org/msg10002.html]
---
Copy of the original mail thread
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:
{noformat}
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)?
{noformat}
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:
{noformat}
// -------------------------------
// 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
}
{noformat}
{noformat}
// -------------------------------
// 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);
}
{noformat}
{noformat}
// -------------------------------
// 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
}
}
{noformat}
{noformat}
// -------------------------------
// 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>
{noformat}
No errors or warnings during compilation. I am using Gradle with the following
dependencies:
{noformat}
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'
{noformat}
I install the contribution using bin\tuscany.bat. This is what Tuscany reports
once loaded:
{noformat}
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
{noformat}
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:
{noformat}
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)?
{noformat}
Adarna Storm 1.1 says:
{noformat}
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)
{noformat}
When validating with wclipse WTP says:
{noformat}
- 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" />
{noformat}
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira