You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Dave Overbeck <do...@turnkey.com> on 2005/12/13 15:33:28 UTC

wsdl2java deployment

Hello,

I'm trying to understand an error I get when deploying a service generated 
by WSDL2Java "-s -S true". I add logic to the Impl, compile the Skeleton, 
and install the resulting class files. When I click on the wsdl in Axis' 
View page, I just get an Internal Server 500 error. But when I try to import 
it from .NET, I get this:

There was an error downloading 
'http://192.168.1.6:8080/axis/services/tky:AxisWSPort?wsdl'.
The request failed with the error message:
--
<h2>AXIS error</h2>
<p>Sorry, something seems to have gone wrong... here are the details:</p>
<pre>Fault - Attempted to write schema for bad QName (no namespace) : 
return<br>
AxisFault
 faultCode: {h

Unfortunately that's all that fits in the dialog. The only QName is in the 
typemappings, but it looks right to me, specifically, the namespace is 
defined in the line above. Also, the service name is preceded by "tky:", 
which is not defined, but if I remove both occurrences of that I get the 
same error. I can get services with simple parameter types to work fine 
(without having to resort to wsdl2java), but I'm trying to send an array of 
structures and I need the serializers.

Any suggestions as to why this service won't deploy?

Thanks in advance,
DaveO.



<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <service name="tky:AxisWSPort" provider="java:RPC" style="document" 
use="literal">
      <parameter name="wsdlTargetNamespace" value="urn:AxisWS3"/>
      <parameter name="wsdlServiceElement" value="AxisWSService"/>
      <parameter name="wsdlServicePort" value="tky:AxisWSPort"/>
      <parameter name="className" value="AxisWS3.AxisWSBindingSkeleton"/>
      <parameter name="wsdlPortType" value="AxisWSPort"/>
      <parameter name="allowedMethods" value="*"/>

      <typeMapping
        xmlns:ns="urn:AxisWS3"
        qname="ns:DhoWS3Array"
        type="java:AxisWS3.DhoWS3Array"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle=""
      />
      <typeMapping
        xmlns:ns="urn:AxisWS3"
        qname="ns:DhoWS3"
        type="java:AxisWS3.DhoWS3"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle=""
      />
  </service>
</deployment>




<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
    name="urn:AxisWS3"
    targetNamespace="urn:AxisWS3"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tky="urn:AxisWS3"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xse="http://schemas.xmlsoap.org/soap/encoding/">
    <wsdl:types>
        <schema targetNamespace="urn:AxisWS3" 
xmlns="http://www.w3.org/2001/XMLSchema">
            <complexType name="DhoWS3">
                <sequence>
                    <element name="Number" type="xsd:int"/>
                    <element name="Name" nillable="true" type="xsd:string"/>
                </sequence>
            </complexType>
            <complexType name="DhoWS3Array">
                <sequence>
                    <element maxOccurs="unbounded" minOccurs="0" name="item" 
type="tky:DhoWS3"/>
                </sequence>
            </complexType>
        </schema>
    </wsdl:types>
    <wsdl:message name="empty">   </wsdl:message>
    <wsdl:message name="strtestResponse">
        <wsdl:part name="return" type="xsd:int"/>
        <wsdl:part name="struct" type="tky:DhoWS3Array"/>
    </wsdl:message>
    <wsdl:portType name="AxisWSPort">
        <wsdl:operation name="strtest" parameterOrder="struct">
            <wsdl:input message="tky:empty"/>
            <wsdl:output message="tky:strtestResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="AxisWSBinding" type="tky:AxisWSPort">
        <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="strtest">
            <soap:operation soapAction="strtest"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="AxisWSService">
        <wsdl:port binding="tky:AxisWSBinding" name="tky:AxisWSPort">
            <soap:address 
location="http://192.168.1.6:8080/axis/services/AxisWS3/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions> 


Re: wsdl2java deployment

Posted by Anne Thomas Manes <at...@gmail.com>.
You have a few problems with your WSDL.
I suggest you use a WSDL editor in the future. The Cape Clear SOA Editor is
free and has a pretty decent WSDL validation utility.

When using document style, you must have at most one body part in your input
and output messages, and your message parts must reference elements, not
types. Your return message currently says:

    <wsdl:message name="strtestResponse">
        <wsdl:part name="return" type="xsd:int"/>
        <wsdl:part name="struct" type="tky:DhoWS3Array"/>
    </wsdl:message>

You should define a wrapper element that contains a sequence of these two
types, and your message should contain one part that references this
element.

Also, you specify a parameter order on your strtest operation, but your
input message contains no parameters. Besides, you shouldn't specify
parameter order with document style because you are passing documents, not
parameters.

For best interoperability, you should always used wrapped document/literal.
Here's a corrected WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
    name="urn:AxisWS3"
    targetNamespace="urn:AxisWS3"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tky="urn:AxisWS3"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
        <schema
            targetNamespace="urn:AxisWS3"
            elementFormDefault="qualified"
            xmlns="http://www.w3.org/2001/XMLSchema">

            <xsd:element name="strtestResponse">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="strtestReturn" type="tky:StrtestReturn"
/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="strtest">
              <xsd:complexType>
                <xsd:sequence/>
              </xsd:complexType>
            </xsd:element>

            <complexType name="DhoWS3">
                <sequence>
                    <element name="Number" type="xsd:int"/>
                    <element name="Name" minOccurs="0" type="xsd:string"/>
                </sequence>
            </complexType>

            <complexType name="DhoWS3Array">
                <sequence>
                    <element maxOccurs="unbounded" minOccurs="0"
                      name="item" type="tky:DhoWS3"/>
                </sequence>
            </complexType>

            <xsd:complexType name="StrtestReturn">
              <xsd:sequence>
                <xsd:element name="return" type="xsd:int"/>
                <xsd:element name="struct" type="tky:DhoWS3Array"/>
              </xsd:sequence>
            </xsd:complexType>
        </schema>
    </wsdl:types>
    <wsdl:message name="strtestRequest">
        <wsdl:part name="parameters" element="tky:strtest"/>
    </wsdl:message>
    <wsdl:message name="strtestResponse">
        <wsdl:part name="parameters" element="tky:strtestResponse"/>
    </wsdl:message>
    <wsdl:portType name="AxisWSPort">
        <wsdl:operation name="strtest">
            <wsdl:input message="tky:strtestRequest"/>
            <wsdl:output message="tky:strtestResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="AxisWSBinding" type="tky:AxisWSPort">
        <soap:binding style="document"
             transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="strtest">
            <soap:operation soapAction="strtest"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="AxisWSService">
        <wsdl:port binding="tky:AxisWSBinding" name="tky:AxisWSPort">
            <soap:address
                 location="http://192.168.1.6:8080/axis/services/AxisWS3/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

Anne


On 12/13/05, Dave Overbeck <do...@turnkey.com> wrote:
>
> Hello,
>
> I'm trying to understand an error I get when deploying a service generated
> by WSDL2Java "-s -S true". I add logic to the Impl, compile the Skeleton,
> and install the resulting class files. When I click on the wsdl in Axis'
> View page, I just get an Internal Server 500 error. But when I try to
> import
> it from .NET, I get this:
>
> There was an error downloading
> 'http://192.168.1.6:8080/axis/services/tky:AxisWSPort?wsdl'.
> The request failed with the error message:
> --
> <h2>AXIS error</h2>
> <p>Sorry, something seems to have gone wrong... here are the details:</p>
> <pre>Fault - Attempted to write schema for bad QName (no namespace) :
> return<br>
> AxisFault
> faultCode: {h
>
> Unfortunately that's all that fits in the dialog. The only QName is in the
> typemappings, but it looks right to me, specifically, the namespace is
> defined in the line above. Also, the service name is preceded by "tky:",
> which is not defined, but if I remove both occurrences of that I get the
> same error. I can get services with simple parameter types to work fine
> (without having to resort to wsdl2java), but I'm trying to send an array
> of
> structures and I need the serializers.
>
> Any suggestions as to why this service won't deploy?
>
> Thanks in advance,
> DaveO.
>
>
>
> <deployment
>     xmlns="http://xml.apache.org/axis/wsdd/"
>     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>   <service name="tky:AxisWSPort" provider="java:RPC" style="document"
> use="literal">
>       <parameter name="wsdlTargetNamespace" value="urn:AxisWS3"/>
>       <parameter name="wsdlServiceElement" value="AxisWSService"/>
>       <parameter name="wsdlServicePort" value="tky:AxisWSPort"/>
>       <parameter name="className" value="AxisWS3.AxisWSBindingSkeleton"/>
>       <parameter name="wsdlPortType" value="AxisWSPort"/>
>       <parameter name="allowedMethods" value="*"/>
>
>       <typeMapping
>         xmlns:ns="urn:AxisWS3"
>         qname="ns:DhoWS3Array"
>         type="java:AxisWS3.DhoWS3Array"
>         serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>         deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory
> "
>         encodingStyle=""
>       />
>       <typeMapping
>         xmlns:ns="urn:AxisWS3"
>         qname="ns:DhoWS3"
>         type="java:AxisWS3.DhoWS3"
>         serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>         deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory
> "
>         encodingStyle=""
>       />
>   </service>
> </deployment>
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions
>     name="urn:AxisWS3"
>     targetNamespace="urn:AxisWS3"
>     xmlns="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>     xmlns:tky="urn:AxisWS3"
>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xse="http://schemas.xmlsoap.org/soap/encoding/">
>     <wsdl:types>
>         <schema targetNamespace="urn:AxisWS3"
> xmlns="http://www.w3.org/2001/XMLSchema">
>             <complexType name="DhoWS3">
>                 <sequence>
>                     <element name="Number" type="xsd:int"/>
>                     <element name="Name" nillable="true"
> type="xsd:string"/>
>                 </sequence>
>             </complexType>
>             <complexType name="DhoWS3Array">
>                 <sequence>
>                     <element maxOccurs="unbounded" minOccurs="0"
> name="item"
> type="tky:DhoWS3"/>
>                 </sequence>
>             </complexType>
>         </schema>
>     </wsdl:types>
>     <wsdl:message name="empty">   </wsdl:message>
>     <wsdl:message name="strtestResponse">
>         <wsdl:part name="return" type="xsd:int"/>
>         <wsdl:part name="struct" type="tky:DhoWS3Array"/>
>     </wsdl:message>
>     <wsdl:portType name="AxisWSPort">
>         <wsdl:operation name="strtest" parameterOrder="struct">
>             <wsdl:input message="tky:empty"/>
>             <wsdl:output message="tky:strtestResponse"/>
>         </wsdl:operation>
>     </wsdl:portType>
>     <wsdl:binding name="AxisWSBinding" type="tky:AxisWSPort">
>         <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>         <wsdl:operation name="strtest">
>             <soap:operation soapAction="strtest"/>
>             <wsdl:input>
>                 <soap:body use="literal"/>
>             </wsdl:input>
>             <wsdl:output>
>                 <soap:body use="literal"/>
>             </wsdl:output>
>         </wsdl:operation>
>     </wsdl:binding>
>     <wsdl:service name="AxisWSService">
>         <wsdl:port binding="tky:AxisWSBinding" name="tky:AxisWSPort">
>             <soap:address
> location="http://192.168.1.6:8080/axis/services/AxisWS3/"/>
>         </wsdl:port>
>     </wsdl:service>
> </wsdl:definitions>
>
>