axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Gomez <rafael.go...@avaintec.com>
Subject wsdl challenge
Date Thu, 18 Nov 2004 16:33:20 GMT
Hi,

I provide 2 wsdl definitions below, ch1.wsdl and ch4.wsdl.

When running wsdl2java, I get:
* for ch1.wsdl the method signature:
public ChunkIdentifier putChunk(javax.xml.namespace.QName chunkType, 
java.lang.String extraData, javax.activation.DataHandler chunk)

*for ch4.wsdl the method signature:
public ChunkIdentifier putChunk(javax.xml.namespace.QName chunkType, 
java.lang.String extraData, Chunk chunk)

The wsdl files are almost the same (one is using default namespace and 
the other is not). But the results are totally different. Why? What am I 
missing?

I have used tcpmon to see how requests look like with both cases and the 
results are also different:
* for a client using stubs created from ch1.wsdl, the request is 
actually using SwA and MIME multipart/Related
* for a client using stubs created from ch4.wsdl, the request is not 
using SwA nor MIME. Instead, the 'chunk' is base64-encoded and located 
in the soap-envelope.

Why?

Rgds,
-R

********
ch1.wsdl
********
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="http://bla" xmlns:a="http://bla" 
xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!-- ===========================================================
    Notes:
    ============================================================== -->
    <!-- =====================
          Types
    ======================== -->
    <types>
        <xsd:schema targetNamespace="http://bla" xmlns:a="http://bla" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:complexType name="chunkIdentifier">
                <xsd:sequence>
                    <xsd:element name="uniqueIdentifier" 
type="xsd:token" minOccurs="1"/>
                    <xsd:element name="chunkType" type="xsd:QName"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="chunk">
                <xsd:choice>
                    <xsd:element name="xmlData" type="xsd:string"/>
                    <xsd:element name="binaryData" type="xsd:base64Binary"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:schema>
    </types>
    <!-- =====================
          Messages
    ======================== -->
    <message name="PutChunkRequest">
        <part name="chunkType" type="xsd:QName"/>
        <part name="extraData" type="xsd:string"/>
        <part name="chunk" type="a:chunk"/>
    </message>
    <message name="PutChunkResponse">
        <part name="chunkIdentifier" type="a:chunkIdentifier"/>
    </message>
    <message name="Error">
        <part name="code" type="xsd:nonNegativeInteger"/>
        <part name="description" type="xsd:string"/>
    </message>
    <!-- =====================
          Port type
    ======================== -->
    <portType name="NormalPortType">
        <operation name="putChunk">
            <input message="a:PutChunkRequest"/>
            <output message="a:PutChunkResponse"/>
            <fault message="a:Error"/>
        </operation>
    </portType>
    <!-- =====================
          Binding
    ======================== -->
    <binding name="NormalBinding" type="a:NormalPortType">
        <soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="putChunk">
            <soap:operation soapAction="putChunk"/>
            <input>
                <mime:multipartRelated>
                    <mime:part>
                        <soap:body use="literal" parts="chunkType 
extraData"/>
                    </mime:part>
                    <mime:part>
                        <mime:content part="chunk" type="*/*"/>
                    </mime:part>
                </mime:multipartRelated>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <soap:fault use="literal"/>
        </operation>
    </binding>
    <!-- =====================
          Service
    ======================== -->
    <service name="NormalService">
        <port name="NormalPort" binding="a:NormalBinding">
            <soap:address 
location="http://localhost:8080/axis/services/Normal"/>
        </port>
    </service>
</definitions>

********
ch4.wsdl
********
<?xml version="1.0" encoding="UTF-8"?>
<ws:definitions targetNamespace="http://bla" xmlns:a="http://bla" 
xmlns:ws="http://schemas.xmlsoap.org/wsdl/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- ===========================================================
    Notes:
    ============================================================== -->
    <!-- =====================
          Types
    ======================== -->
    <ws:types>
        <xs:schema targetNamespace="http://bla" xmlns:a="http://bla" 
xmlns:ws="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:complexType name="chunkIdentifier">
                <xs:annotation/>
                <xs:sequence>
                    <xs:element name="uniqueIdentifier" type="xs:token" 
minOccurs="1"/>
                    <xs:element name="chunkType" type="xs:QName"/>
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="chunk">
                <xs:choice>
                    <xs:element name="xmlData" type="xs:string"/>
                    <xs:element name="binaryData" type="xs:base64Binary"/>
                </xs:choice>
            </xs:complexType>
        </xs:schema>
    </ws:types>
    <!-- =====================
          Messages
    ======================== -->
    <ws:message name="PutChunkRequest">
        <ws:part name="chunkType" type="xs:QName"/>
        <ws:part name="extraData" type="xs:string"/>
        <ws:part name="chunk" type="a:chunk"/>
    </ws:message>
    <ws:message name="PutChunkResponse">
        <ws:part name="chunkIdentifier" type="a:chunkIdentifier"/>
    </ws:message>
    <ws:message name="Error">
        <ws:part name="code" type="xs:nonNegativeInteger"/>
        <ws:part name="description" type="xs:string"/>
    </ws:message>
    <!-- =====================
          Port type
    ======================== -->
    <ws:portType name="NormalPortType">
        <ws:operation name="putChunk">
            <ws:input message="a:PutChunkRequest"/>
            <ws:output message="a:PutChunkResponse"/>
            <ws:fault message="a:Error"/>
        </ws:operation>
    </ws:portType>
    <!-- =====================
          Binding
    ======================== -->
    <ws:binding name="NormalBinding" type="a:NormalPortType">
        <soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
        <ws:operation name="putChunk">
            <soap:operation soapAction="putChunk"/>
            <ws:input>
                <mime:multipartRelated>
                    <mime:part>
                        <soap:body use="literal" parts="recordType 
extraData"/>
                    </mime:part>
                    <mime:part>
                        <mime:content part="chunk" type="*/*"/>
                    </mime:part>
                </mime:multipartRelated>
            </ws:input>
            <ws:output>
                <soap:body use="literal"/>
            </ws:output>
            <soap:fault use="literal"/>
        </ws:operation>
    </ws:binding>
    <!-- =====================
          Service
    ======================== -->
    <ws:service name="NormalService">
        <ws:port name="NormalPort" binding="a:NormalBinding">
            <soap:address 
location="http://localhost:8080/axis/services/Normal"/>
        </ws:port>
    </ws:service>
</ws:definitions>


Mime
View raw message