WSDL: Generated Namespace for Faults are Wrong
----------------------------------------------

                 Key: TUSCANY-3793
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3793
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Databinding-SDO
    Affects Versions: Java-SCA-1.6
         Environment: Linux, Fedora 10, 2.6.27.38-170.2.113.fc10.i686.PAE
            Reporter: Christian Nolte


Refering to mailing list post:
http://osdir.com/ml/user-tuscany.apache.org/2010-10/msg00059.html

The namespaces for faults (Exceptions) are wrong. Consider this example 
(modified HelloWorldService):

helloWorldService.composite:
---
<?xml version="1.0" encoding="UTF-8"?>
<sca:composite xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"; 
    name="helloWorldService" 
    
targetNamespace="http://eclipse.org/HelloWorldService/src/resources/HelloWorldService";>
  <sca:component name="HelloWorldServiceComponent">
    <sca:implementation.java class="implementations.HelloWorldServiceImpl"/>
    <sca:service name="IHelloWorldService">
      <sca:interface.java interface="service.IHelloWorldService"/>
      <sca:binding.ws/>
    </sca:service>
  </sca:component>
</sca:composite>
---

IHelloWorldService.java:
---
package service;

import javax.jws.WebService;

@WebService
public interface IHelloWorldService {
        public String sayHello() throws Exception;
}
---

HelloWorldServiceImpl.java:
---
package implementations;

import org.osoa.sca.annotations.Service;
import service.IHelloWorldService;

@Service(IHelloWorldService.class)
public class HelloWorldServiceImpl implements IHelloWorldService{
        private String sayHello = "Hello remote SCA";
        
        @Override
        public String sayHello() throws Exception {
                return this.sayHello;
        }
}
---

Generated http://localhost:8080/HelloWorldServiceComponent?wsdl
---
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="IHelloWorldServiceService" 
targetNamespace="http://service/"; xmlns="http://service/"; 
xmlns:ns4="http://lang.java/"; 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 targetNamespace="http://lang.java/"; version="1.0" 
xmlns:tns="http://lang.java/"; xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<xs:element name="Exception" type="tns:Exception"/>
<xs:complexType name="Exception"><xs:sequence><xs:element minOccurs="0" 
name="message" type="xs:string"/></xs:sequence></xs:complexType>
</xs:schema>
    <xs:schema attributeFormDefault="qualified" 
elementFormDefault="unqualified" targetNamespace="http://service/"; 
xmlns:tns="http://service/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";><xs:element 
name="sayHelloResponse"><xs:complexType><xs:sequence><xs:element minOccurs="0" 
name="return" nillable="true" 
type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:element 
name="sayHello"><xs:complexType/></xs:element></xs:schema>
  </wsdl:types>
  <wsdl:message name="sayHelloResponse">
    <wsdl:part name="sayHelloResponse" element="sayHelloResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="sayHello">
    <wsdl:part name="sayHello" element="sayHello">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="Exception">
    <wsdl:part name="Exception" element="ns4:Exception">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="IHelloWorldService">
    <wsdl:operation name="sayHello">
      <wsdl:input message="sayHello">
    </wsdl:input>
      <wsdl:output message="sayHelloResponse">
    </wsdl:output>
      <wsdl:fault name="Exception" message="ns4:Exception">
    </wsdl:fault>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="IHelloWorldServiceBinding" type="IHelloWorldService">
    <SOAP:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="sayHello">
      <SOAP:operation/>
      <wsdl:input>
        <SOAP:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <SOAP:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="Exception">
        <SOAP:fault name="Exception" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="IHelloWorldServiceService">
    <wsdl:port name="IHelloWorldServicePort" 
binding="IHelloWorldServiceBinding">
      <SOAP:address location="http://velian01:8080/HelloWorldServiceComponent"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
---

The solution is to change the namespace

message="ns4:Exception"

to

message="tns:Exception"

These faults should always be placed into Namespace tns.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to