axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ian_d_stew...@bankone.com
Subject Re: Error trying to do typemapping and deploy
Date Mon, 20 Oct 2003 13:40:03 GMT


There is an XMLSchema definition for WSDD, but it's buried in CVS.

The online version is available at
http://cvs.apache.org/viewcvs/ws-axis/java/wsdd/WSDD.xsd

The section pertenant <sp?> to <typeMapping> appears below:

<!-- ====================================================================
-->
    <!-- typeMapping -->
    <!--
==================================================================== -->
    <xsd:element name="typeMapping">
        <xsd:annotation>
            <xsd:documentation>
            This describes the mapping between XML and a programming
language specific object.
            LanguageSpecificType refers to the type name in the programming
language that is being coverted to/from XML.
            Serializer and deserializer refer to type names in the
programming language.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element ref="wsdd:documentation" minOccurs="0"/>
                <xsd:any namespace="##other" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="encodingStyle" type="xsd:string" use
="optional"/>
            <xsd:attribute name="qname" type="xsd:QName" use="optional"/>
            <xsd:attribute name="languageSpecificType" type="xsd:QName" use
="optional"/>
            <xsd:attribute name="serializer" type="xsd:anyURI" use
="optional"/>
            <xsd:attribute name="deserializer" type="xsd:anyURI" use
="optional"/>
            <xsd:attribute name="type" type="xsd:anyURI"/>
            <xsd:attribute name="name" type="xsd:anyURI" use="optional"/>
        </xsd:complexType>
    </xsd:element>


HTH,
Ian

Ian D. Stewart
Open Systems Engineer II
Enterprise Midrange - Bank One Infrastructure & Operations
ian_d_stewart@bankone.com
(614) 244-2564




"DealRaider.com" <logbot@uhmc.biz> on 10/19/2003 08:00:58 PM

Please respond to axis-user@ws.apache.org

To:   axis-user@ws.apache.org
cc:

Subject:  Error trying to do typemapping and deploy



Hello,

    I'm fairly new to Axis, and thought I had figured it out until I got
to the typemapping. Since I have been unable to find a DTD/XSD for the
WSDD file, I've had to try and use others' examples. This has consumed
10+ hours of my day now, so I would greatly appreciate any help. Please
reply to my email address as well.

In any case, no matter what I've tried, I am getting an error. I've
attached the WSDL file that was used to generate Java classes with
WSDL2Java. Each of those complex types has a serializer/deserializer in
the code, so I thought you could specify them as the serializer or
deserializer in the type mapping.

I'm trying to just get one method of the web service working. I tried
creating a test client, but it failed with a ClassNotFound trying to
find org/apache/axis/Deserializer. I then realized I need to do
typemapping since my parameters are not primitive types.

For example, look at GetOutstandingOrders type. I've tried setting my
deploy.wsdd as follows:

<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
    xmlns:ns="urn:LibraryDemo\\srvcGeneral\\srvcdoc">

    <service name="ElectronicMarketService" provider="java:EJB">
        <parameter name="beanJndiName"
value="ElectronicMarketServiceLocal"/>
        <parameter name="homeInterfaceName"
value="edu.uiuc.cs427.j2e3.service.ElectronicMarketServiceLocalHome"/>
        <parameter name="remoteInterfaceName"
value="edu.uiuc.cs427.j2e3.service.ElectronicMarketServiceLocal"/>
        <parameter name="allowedMethods" value="*"/>
        <parameter name="jndiURL" value="jnp://localhost:1099"/>
        <parameter name="jndiContextClass"
value="org.jnp.interfaces.NamingContextFactory"/>
        <wsdlFile>ElectronicMarket.wsdl</wsdlFile>

        <!-- This type mapping I believe is causing the problem not
allowing a client to connect -->
        <!-- Can only get to complete target if type is set to
"classname" -->
        <!-- Serializer is not letting me put my class, deserializer is -->
        <!--
        <typeMapping
            qname="ns:GetOutstandingOrders"
            classname="java:edu.uiuc.cs427.soap.CollectionOfOrder"
            serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
            deserializer="edu.uiuc.cs427.soap.CollectionOfOrder"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        -->
        <beanMapping
            qname="ns:GetOutstandingOrders"
            xmlns:ns="urn:LibraryDemo\\srvcGeneral\\srvcdoc"

languageSpecificType="java:edu.uiuc.cs427.soap.CollectionOfOrder"/>

    </service>
</deployment>

I've tried several combinations of typeMapping and beanMapping yet none
work. What I'd like to do is something like:
<typeMapping
    qname="ns:GetOutstandingOrders"
    classname="java:edu.uiuc.cs427.soap.CollectionOfOrder"
    serializer="edu.uiuc.cs427.soap.CollectionOfOrder"
    deserializer="edu.uiuc.cs427.soap.CollectionOfOrder"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

However, I get a variety of errors depending on which attempt I make:

One error if I use the first typeMapping example with classname and with
the BeanSerializerFactory serializer I get:

19:56:58,453 ERROR [WSDDDeployableItem] Unable to deploy typemapping:
{urn:LibraryDemo\\srvcGeneral\\srvcdoc}GetOutstandingOrders
java.lang.ClassNotFoundException: Found languageSpecificType namespace
'', expected 'http://xml.apache.org/axis/wsdd/providers/java'
        at
org.apache.axis.deployment.wsdd.WSDDTypeMapping.getLanguageSpecificType(WSDDTypeMapping.java:213)

        at
org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:549)

        at
org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:267)
        at
org.apache.axis.deployment.wsdd.WSDDService.<init>(WSDDService.java:247)
        at
org.apache.axis.deployment.wsdd.WSDDDeployment.<init>(WSDDDeployment.java:243)

        at
org.apache.axis.deployment.wsdd.WSDDDocument.<init>(WSDDDocument.java:118)

If I try one of the other combinations, I often get an
InvocationTargetException when trying to execute the axis-admin Ant task.

If I try putting the java: in front of the serializer/deserializer, it
gives me another error.

If anyone can see something obvious here, or can show me better
documentation on this besides example 5 of the user guide, please help
me out.

I've also attached the source code for the generated CollectionOfOrder
type.

If you need any more info from me, let me know.

Thanks

<?xml version="1.0" encoding="utf-8" ?>
<definitions targetNamespace="urn:LibraryDemo\\srvcGeneral\\srvcdoc" xmlns
="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns
="urn:LibraryDemo\\srvcGeneral\\srvcdoc">
     <types>
          <schema targetNamespace="urn:LibraryDemo\\srvcGeneral\\srvcdoc"
elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:LibraryDemo\\srvcGeneral\\srvcdoc" xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
               <complexType name="CollectionOfOrder">
                    <sequence>
                         <element name="Order" minOccurs="0" maxOccurs
="unbounded" type="ns:Order"/>
                    </sequence>
               </complexType>
               <complexType name="Market">
                    <sequence>
                         <element name="settings" minOccurs="1" maxOccurs
="1" type="ns:TradingSettings"/>
                         <element name="segments" minOccurs="1" maxOccurs
="1" type="ns:CollectionOfSegment"/>
                    </sequence>
               </complexType>
               <complexType name="CollectionOfSegment">
                    <sequence>
                         <element name="Segment" minOccurs="0" maxOccurs
="unbounded" type="ns:Segment"/>
                    </sequence>
               </complexType>
               <complexType name="TradingSettings">
                    <sequence>
                         <element name="stateCycleSpec" minOccurs="0"
maxOccurs="1" type="xsd:string"/>
                         <element name="stopTradingRange" minOccurs="0"
maxOccurs="1" type="xsd:double"/>
                         <element name="priceIncrement" minOccurs="1"
maxOccurs="1" type="xsd:double"/>
                    </sequence>
               </complexType>
               <complexType name="Segment">
                    <sequence>
                         <element name="name" minOccurs="1" maxOccurs="1"
type="xsd:string"/>
                         <element name="settings" minOccurs="1" maxOccurs
="1" type="ns:TradingSettings"/>
                         <element name="securities" minOccurs="1" maxOccurs
="1" type="ns:CollectionOfSecurity"/>
                         <element name="market" minOccurs="1" maxOccurs="1"
type="ns:Market"/>
                    </sequence>
               </complexType>
               <complexType name="CollectionOfSecurity">
                    <sequence>
                         <element name="Security" minOccurs="0" maxOccurs
="unbounded" type="ns:Security"/>
                    </sequence>
               </complexType>
               <complexType name="Security">
                    <sequence>
                         <element name="name" minOccurs="1" maxOccurs="1"
type="xsd:string"/>
                         <element name="settings" minOccurs="1" maxOccurs
="1" type="ns:TradingSettings"/>
                         <element name="segment" minOccurs="1" maxOccurs
="1" type="ns:Segment"/>
                    </sequence>
               </complexType>
               <complexType name="OrderStatus">
                    <sequence>
                         <element name="matchingShares" minOccurs="1"
maxOccurs="1" type="xsd:int"/>
                         <element name="order" minOccurs="1" maxOccurs="1"
type="ns:Order"/>
                         <element name="matchingPrice" minOccurs="1"
maxOccurs="1" type="xsd:double"/>
                         <element name="identification" minOccurs="1"
maxOccurs="1" type="xsd:string"/>
                         <element name="matchingParty" minOccurs="1"
maxOccurs="1" type="ns:Party"/>
                         <element name="status" minOccurs="1" maxOccurs="1"
type="xsd:string"/>
                    </sequence>
               </complexType>
               <complexType name="Order">
                    <sequence>
                         <element name="numberOfShares" minOccurs="1"
maxOccurs="1" type="xsd:int"/>
                         <element name="nominalPrice" minOccurs="0"
maxOccurs="1" type="xsd:double"/>
                         <element name="party" minOccurs="1" maxOccurs="1"
type="ns:Party"/>
                         <element name="instrument" minOccurs="1" maxOccurs
="1" type="xsd:string"/>
                    </sequence>
               </complexType>
               <complexType name="Party">
                    <sequence>
                         <element name="name" minOccurs="1" maxOccurs="1"
type="xsd:string"/>
                         <element name="identification" minOccurs="1"
maxOccurs="1" type="xsd:string"/>
                    </sequence>
               </complexType>
               <element name="x_GetOutstandingOrders" type
="ns:GetOutstandingOrders"/>
               <complexType name="GetOutstandingOrders">
                    <sequence>
                         <element name="PrderIdentification" minOccurs="1"
maxOccurs="1" type="xsd:int"/>
                    </sequence>
               </complexType>
               <element name="x_GetOutstandingOrdersResponse" type
="ns:CollectionOfOrder"/>
               <element name="x_CreateMarket" type="ns:CreateMarket"/>
               <complexType name="CreateMarket">
                    <sequence>
                         <element name="Market" minOccurs="1" maxOccurs="1"
type="ns:Market"/>
                    </sequence>
               </complexType>
               <element name="x_CreateMarketResponse" type="xsd:boolean"/>
               <element name="x_GetOrderStatus" type="ns:GetOrderStatus"/>
               <complexType name="GetOrderStatus">
                    <sequence>
                         <element name="OrderIdentification" minOccurs="1"
maxOccurs="1" type="xsd:int"/>
                    </sequence>
               </complexType>
               <element name="x_GetOrderStatusResponse" type
="ns:OrderStatus"/>
               <element name="x_AddSellOrder" type="ns:AddSellOrder"/>
               <complexType name="AddSellOrder">
                    <sequence>
                         <element name="Order" minOccurs="1" maxOccurs="1"
type="ns:Order"/>
                    </sequence>
               </complexType>
               <element name="x_AddSellOrderResponse" type
="ns:OrderStatus"/>
               <element name="x_AddBuyOrder" type="ns:AddBuyOrder"/>
               <complexType name="AddBuyOrder">
                    <sequence>
                         <element name="Order" minOccurs="1" maxOccurs="1"
type="ns:Order"/>
                    </sequence>
               </complexType>
               <element name="x_AddBuyOrderResponse" type
="ns:OrderStatus"/>
          </schema>
     </types>
     <message name="GetOutstandingOrders">
          <part name="parameter" element="ns:x_GetOutstandingOrders"/>
     </message>
     <message name="GetOutstandingOrdersResponse">
          <part name="return" element="ns:x_GetOutstandingOrdersResponse"/>
     </message>
     <message name="CreateMarket">
          <part name="parameter" element="ns:x_CreateMarket"/>
     </message>
     <message name="CreateMarketResponse">
          <part name="return" element="ns:x_CreateMarketResponse"/>
     </message>
     <message name="GetOrderStatus">
          <part name="parameter" element="ns:x_GetOrderStatus"/>
     </message>
     <message name="GetOrderStatusResponse">
          <part name="return" element="ns:x_GetOrderStatusResponse"/>
     </message>
     <message name="AddSellOrder">
          <part name="parameter" element="ns:x_AddSellOrder"/>
     </message>
     <message name="AddSellOrderResponse">
          <part name="return" element="ns:x_AddSellOrderResponse"/>
     </message>
     <message name="AddBuyOrder">
          <part name="parameter" element="ns:x_AddBuyOrder"/>
     </message>
     <message name="AddBuyOrderResponse">
          <part name="return" element="ns:x_AddBuyOrderResponse"/>
     </message>
     <portType name="ElectronicMarket">
          <operation name="GetOutstandingOrders">
               <documentation>It returns all the orders placed by a party
that didn't match any other.</documentation>
               <input message="ns:GetOutstandingOrders"/>
               <output message="ns:GetOutstandingOrdersResponse"/>
          </operation>
          <operation name="CreateMarket">
               <documentation>It creates a market with segments, securities
and parties</documentation>
               <input message="ns:CreateMarket"/>
               <output message="ns:CreateMarketResponse"/>
          </operation>
          <operation name="GetOrderStatus">
               <documentation>It returns the status of an order posted
before</documentation>
               <input message="ns:GetOrderStatus"/>
               <output message="ns:GetOrderStatusResponse"/>
          </operation>
          <operation name="AddSellOrder">
               <documentation>It adds an order for selling the instrument
spedified by anOrder</documentation>
               <input message="ns:AddSellOrder"/>
               <output message="ns:AddSellOrderResponse"/>
          </operation>
          <operation name="AddBuyOrder">
               <documentation>It adds an order for buying the instrument
spedified by anOrder</documentation>
               <input message="ns:AddBuyOrder"/>
               <output message="ns:AddBuyOrderResponse"/>
          </operation>
     </portType>
     <binding name="ElectronicMarket" type="ns:ElectronicMarket">
          <soap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http/"/>
          <operation name="GetOutstandingOrders" selector
="getOutstandingOrders:">
               <soap:operation soapAction=""/>
               <input>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </input>
               <output>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </output>
          </operation>
          <operation name="CreateMarket" selector="createMarket:">
               <soap:operation soapAction=""/>
               <input>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </input>
               <output>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </output>
          </operation>
          <operation name="GetOrderStatus" selector="getOrderStatus:">
               <soap:operation soapAction=""/>
               <input>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </input>
               <output>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </output>
          </operation>
          <operation name="AddSellOrder" selector="addSellOrder:">
               <soap:operation soapAction=""/>
               <input>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </input>
               <output>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </output>
          </operation>
          <operation name="AddBuyOrder" selector="addBuyOrder:">
               <soap:operation soapAction=""/>
               <input>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </input>
               <output>
                    <soap:body use="literal" namespace
="urn:LibraryDemo\\srvcGeneral\\srvcdoc"/>
               </output>
          </operation>
     </binding>
</definitions>
/**
 * CollectionOfOrder.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package edu.uiuc.cs427.soap;

public class CollectionOfOrder  implements java.io.Serializable {
    private edu.uiuc.cs427.soap.Order[] order;

    public CollectionOfOrder() {
    }

    public edu.uiuc.cs427.soap.Order[] getOrder() {
        return order;
    }

    public void setOrder(edu.uiuc.cs427.soap.Order[] order) {
        this.order = order;
    }

    public edu.uiuc.cs427.soap.Order getOrder(int i) {
        return order[i];
    }

    public void setOrder(int i, edu.uiuc.cs427.soap.Order value) {
        this.order[i] = value;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof CollectionOfOrder)) return false;
        CollectionOfOrder other = (CollectionOfOrder) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.order==null && other.getOrder()==null) ||
             (this.order!=null &&
              java.util.Arrays.equals(this.order, other.getOrder())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getOrder() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getOrder());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getOrder
(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(CollectionOfOrder.class);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName
("urn:LibraryDemo\\srvcGeneral\\srvcdoc", "CollectionOfOrder"));
        org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
        elemField.setFieldName("order");
        elemField.setXmlName(new javax.xml.namespace.QName
("urn:LibraryDemo\\srvcGeneral\\srvcdoc", "Order"));
        elemField.setXmlType(new javax.xml.namespace.QName
("urn:LibraryDemo\\srvcGeneral\\srvcdoc", "Order"));
        elemField.setMinOccurs(0);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}









This transmission may contain information that is privileged, confidential and/or exempt from
disclosure under applicable law. If you are not the intended recipient, you are hereby notified
that any disclosure, copying, distribution, or use of the information contained herein (including
any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error,
please immediately contact the sender and destroy the material in its entirety, whether in
electronic or hard copy format. Thank you.


Mime
View raw message