[ 
https://issues.apache.org/jira/browse/TUSCANY-2251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592374#action_12592374
 ] 

Simon Nash commented on TUSCANY-2251:
-------------------------------------

This problem is caused by an error in the WSDL that Tuscany generates at 
runtime.  Your WSDL file includes the lines:

<wsdl:definitions targetNamespace="http://example.com"; 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; 
xmlns:ns0="http://example.com"; 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
xmlns:ns1="http://example.com/xsd"; 
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
  <wsdl:types>
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace="http://example.com"; xmlns:ns="http://example.com";>
            <xs:element name="processBean">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="param0" nillable="true" 
type="ns1:SimpleBean"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="processBeanResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" nillable="true" 
type="ns1:SimpleBean"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace="http://example.com/xsd"; xmlns:ax21="http://example.com/xsd";>
            <xs:complexType name="SimpleBean">
                <xs:sequence>
                    <xs:element minOccurs="0" name="age" type="xs:int"/>
                    <xs:element minOccurs="0" name="name" nillable="true" 
type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
  </wsdl:types>

The elements "processBean" and "processBeanResponse" are correctly generated in 
the namespace http://example.com, but the elements "age" and "name" are 
incorrectly generated in the namespace http://example.com/xsd.

This mapping from Java interfaces to WSDL is not consistent with the JAX-WS and 
JAXB specifications as implemented by the Tuscany runtime.  This is why the 
Tuscany runtime is unmarshalling these elements as null or zero.

A workaround to the problem is to edit the WSDL to put the generated elements 
in the correct namespace.  You would need to change the lines above to the 
following:

<wsdl:definitions targetNamespace="http://example.com"; 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; 
xmlns:ns0="http://example.com"; 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
xmlns:ns1="http://example.com/xsd"; 
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
  <wsdl:types>
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace="http://example.com"; xmlns:ns="http://example.com";>
            <xs:element name="processBean">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="param0" nillable="true" 
type="ns0:SimpleBean"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="processBeanResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" nillable="true" 
type="ns0:SimpleBean"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:complexType name="SimpleBean">
                <xs:sequence>
                    <xs:element minOccurs="0" name="age" type="xs:int"/>
                    <xs:element minOccurs="0" name="name" nillable="true" 
type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
  </wsdl:types>

The reason this used to work is that the incorrect namespace in the WSDL and in 
the SOAP body sent on the wire by Axis used to be ignored by the Tuscany 
unmarshalling code.  The problem occurs now because the Tuscany unmarshalling 
code was changed to check for exact namespace matches.  (I believe this 
happened some time ago, before the Tuscany 1.1 release.)

The fix for the problem is to change Tuscany's WSDL generation to make it 
correct according to the JAX-WS and JAXB specifications.  I am currently 
working on this.


> Problem with 1.2 RC4 with simple JavaBean
> -----------------------------------------
>
>                 Key: TUSCANY-2251
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2251
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Data Binding Runtime
>    Affects Versions: Java-SCA-1.2
>         Environment: Eclipse 3.3, Tuscany SCA 1.2 - RC4
>            Reporter: Nishant Joshi
>             Fix For: Java-SCA-1.2
>
>         Attachments: generatedClientCode.zip, SimpleBeanProblem.zip
>
>
> Hi there,
> I have one sample which was perfectly working with 1.0 incubating... when i 
> have tried same with 1.2 RC4 all the data come from client was null for all 
> the values for a simple bean.
> Please note that I m creating Client on Eclipse 3.3... using WebService 
> client generation facility of eclipse...
> I m attaching detail for more detail...
> When tried same with SCA client it was giving me perfect result... 

-- 
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