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 Sathish Amba <sa...@kryptiq.com> on 2007/11/12 21:13:32 UTC

WSDL has undefined objects..(Axis 1 to Axis2)

Hi,

 

I have an application which was quite a few webservices. I want to first
convert one particular webservice from Axis1 to Axis2. The reason we are
doing this is that because of the huge performance improvement that
axis2 claims, since we have a huge xml that goes across the wire.

 

This is the services.xml that I have.

 

<serviceGroup>

<service name=" WSAPI " scope="application">

    <description>

        Choreo Web Service

    </description>

    <parameter name="ServiceClass">com.company.WSAPI</parameter>

    <messageReceivers>

        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"

 
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>

        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"

 
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>

    </messageReceivers>    

</service>

</serviceGroup>

 

This class WSAPI has methods like createObject(KObject *),
updateObject(KObject *). Internally we have some torque objects which
speak to database for CRUD operations.

 

Now if I deploy this webservice and access the WSDL from the browser
(http://localhost:8080/context/axis2/WSAPI?wsdl, the WSDL has lot of
other object definitions that are not defined in the services.xml.

 

For example, it has Torque objects, logging objects and other internal
objects that our application uses. Here is the sample WSDL that I am
getting

 

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:schema xmlns:ax212="http://map.torque.apache.org/xsd"
xmlns:ax217="http://oid.torque.apache.org/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://map.torque.apache.org/xsd">

  <xs:import namespace="http://oid.torque.apache.org/xsd" /> 

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:complexType name="TableMap">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:sequence>

  <xs:element maxOccurs="unbounded" minOccurs="0" name="columns"
nillable="true" type="ns1:ColumnMap" /> 

  <xs:element minOccurs="0" name="databaseMap" nillable="true"
type="ns1:DatabaseMap" /> 

  <xs:element minOccurs="0" name="dbMap" nillable="true"
type="ns1:DatabaseMap" /> 

  <xs:element minOccurs="0" name="description" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="idGenerator" nillable="true"
type="ax217:IdGenerator" /> 

  <xs:element minOccurs="0" name="javaName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="managerClass" nillable="true"
type="xs:anyType" /> 

  <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"
/> 

  <xs:element minOccurs="0" name="oMClass" nillable="true"
type="xs:anyType" /> 

  <xs:element minOccurs="0" name="peerClass" nillable="true"
type="xs:anyType" /> 

  <xs:element minOccurs="0" name="prefix" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="primaryKeyMethod" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="primaryKeyMethodInfo" nillable="true"
type="xs:anyType" /> 

  <xs:element minOccurs="0" name="useInheritance" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="useManager" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="AUTO_INCREMENT" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="ID_BROKER" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="NATIVE" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="NO_ID_METHOD" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="SEQUENCE" nillable="true"
type="xs:string" /> 

  </xs:sequence>

  </xs:complexType>

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:complexType name="ColumnMap">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:sequence>

  <xs:element minOccurs="0" name="autoIncrement" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="columnName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="default" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="description" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="foreignKey" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="fullyQualifiedName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="inheritance" nillable="true"
type="xs:string" /> 

  <xs:element maxOccurs="unbounded" minOccurs="0" name="inheritanceMaps"
nillable="true" type="ns1:InheritanceMap" /> 

  <xs:element minOccurs="0" name="inputValidator" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="javaName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="javaNamingMethod" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="javaType" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="notNull" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="pk" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="position" type="xs:int" /> 

  <xs:element minOccurs="0" name="primaryKey" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="protected" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="relatedColumnName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="relatedName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="relatedTableName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="scale" type="xs:int" /> 

  <xs:element minOccurs="0" name="size" type="xs:int" /> 

  <xs:element minOccurs="0" name="table" nillable="true"
type="ns1:TableMap" /> 

  <xs:element minOccurs="0" name="tableName" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="torqueType" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="type" nillable="true"
type="xs:anyType" /> 

  <xs:element minOccurs="0" name="useInheritance" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="usePrimitive" type="xs:boolean" /> 

  </xs:sequence>

  </xs:complexType>

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:complexType name="InheritanceMap">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:sequence>

  <xs:element minOccurs="0" name="className" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="column" nillable="true"
type="ns1:ColumnMap" /> 

  <xs:element minOccurs="0" name="extends" nillable="true"
type="xs:string" /> 

  <xs:element minOccurs="0" name="key" nillable="true" type="xs:string"
/> 

  </xs:sequence>

  </xs:complexType>

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:complexType name="DatabaseMap">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:sequence>

  <xs:element minOccurs="0" name="iDBroker" nillable="true"
type="ax217:IDBroker" /> 

  <xs:element minOccurs="0" name="idTable" nillable="true"
type="ns1:TableMap" /> 

  <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"
/> 

  <xs:element maxOccurs="unbounded" minOccurs="0" name="tables"
nillable="true" type="ns1:TableMap" /> 

  <xs:element minOccurs="0" name="SCHEMA_SEPARATOR_CHAR"
type="xs:anyType" /> 

  <xs:element minOccurs="0" name="STD_SEPARATOR_CHAR" type="xs:anyType"
/> 

  <xs:element minOccurs="0" name="INIT_CLASS_NAME_FORMAT"
nillable="true" type="xs:string" /> 

  </xs:sequence>

  </xs:complexType>

  </xs:schema>

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:schema xmlns:ax210="http://logging.commons.apache.org/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://logging.commons.apache.org/xsd">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:complexType name="Log">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<xs:sequence>

  <xs:element minOccurs="0" name="debugEnabled" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="errorEnabled" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="fatalEnabled" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="infoEnabled" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="traceEnabled" type="xs:boolean" /> 

  <xs:element minOccurs="0" name="warnEnabled" type="xs:boolean" /> 

  </xs:sequence>

  </xs:complexType>

  </xs:schema>

 

 

The WSDL definition also has some namespace definitions which are not
valid. Please note the namespace jdom.org/xsd which is not valid at
all..

 

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>  <
wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns4="http://oid.torque.apache.org/xsd"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:ns0="http://configuration.commons.apache.org/xsd"
xmlns:ns7="http://adaptorws.kryptiq.com"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:ns5="http://util.torque.apache.org/xsd"
xmlns:ns12="http://util.java/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns6="http://jdom.org/xsd"
xmlns:ns11="http://om.torque.apache.org/xsd"
xmlns:ns9="http://adaptorws.kryptiq.com/xsd"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns1="http://map.torque.apache.org/xsd"
xmlns:ns3="http://busObj.cms.kryptiq.com/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://logging.commons.apache.org/xsd"
xmlns:ns10="http://security.om.turbine.apache.org/xsd"
xmlns:ns8="http://language.service.cms.kryptiq.com/xsd"
targetNamespace="http://adaptorws.kryptiq.com">

 

So when I try to generate my stub client classes the system throws lot
of weird exceptions. It tries to lookup jdom.org and fails most of the
time..

 

I have no idea why the system generates all these unnecessary objects.
All I need to expose is the WSAPI methods and the KObjects that we use.

 

To test, I tried deploying a dummy WSAPI object without any torque or
our application code. It that case, it works fine and the system exposes
just the methods in WSAPI and KObjects in the WSDL.

 

So can some one help me to fix this problem?

 

Also the other problem that I noticed is that in WSDL my application
points to wrong URL

 

wwwsdl:service name="WSAPI">

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<wsdl:port name="WSAPISOAP11port_http" binding="ns7: WSAPI
SOAP11Binding">

  <soap:address location="http://localhost:8080/context/services/ WSAPI
" /> 

  </wsdl:port>

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<wsdl:port name=" WSAPI SOAP12port_http" binding="ns7: WSAPI
SOAP12Binding">

  <soap12:address location="http://localhost:8080/context/services/WSAPI
" /> 

  </wsdl:port>

- <http://localhost:8080/guardian/axis2services/KAdaptorAPI?wsdl##>
<wsdl:port name=" WSAPI Httpport" binding="ns7:KAdaptorAPIHttpBinding">

  <http:address location="http://localhost:8080/context/services/WSAPI "
/> 

  </wsdl:port>

  </wsdl:service>

 

Ideally the URL should be http://localhost:8080/context/axis2/.

 

I would really appreciate if someone can help me fix this. Please note
that I have both axis1 and axis2 jars and I want to just convert one
Service from axis1 to axis2. 

 

Thanks,

Sathish