Hi All,
I obtained the attached wsdl file for an Axis2 service I want to invoke,
but when I run Axis 1.4 wsdl2java the generated method signature for the
single operation (getReferences) provided by the service doesn't match
that defined in the wsdl (at least as far as I can see). In short, the
request should have 3 string parameters (id, db, organism), defined by:
<xsd:schema
targetNamespace="http://mips.gsf.de/xml/schemas/CrossRefRequest/v1">
<xsd:element name="getReferences">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="id"
type="xsd:string"
minOccurs="1"
maxOccurs="1" />
<xsd:element name="db"
type="xsd:string"
minOccurs="1"
maxOccurs="1" />
<xsd:element name="organism"
type="xsd:string"
minOccurs="1"
maxOccurs="1">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
and the response 1 string parameter (title) and 1 defined by a
complexType, defined by:
<xsd:schema
targetNamespace="http://mips.gsf.de/xml/schemas/CrossRefResult/v1">
<xsd:element name="XRefs">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="title"
type="xsd:string"
minOccurs="1"
maxOccurs="1" />
<xsd:element name="result"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:choice>
<xsd:element name="refseq"
type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="swiss"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="trembl"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<!--
some elements deleted here so that the e-mail isn't to long -->
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="entry">
<xsd:choice>
<xsd:element name="entry"
type="xsd:string"
minOccurs="1"
maxOccurs="unbounded" />
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="EnsemblGene">
<xsd:sequence>
<xsd:element name="entry" type="xsd:string"
minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="transcription"
type="sns:EnsemblTrascription" minOccurs="0" maxOccurs="1"></xsd:element>
</xsd:sequence></xsd:complexType>
<xsd:complexType name="EnsemblTrascription">
<xsd:sequence>
<xsd:element name="entry" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"></xsd:element>
<xsd:element name="translation"
type="sns:EnsemblTranslation" minOccurs="0" maxOccurs="1"></xsd:element>
</xsd:sequence></xsd:complexType>
<xsd:complexType name="EnsemblTranslation"></xsd:complexType>
</xsd:schema>
However, the method signature generated in the BindingStub (also
attached) contains all 5 parameters (the 3 input and 2 output):
public void getReferences(java.lang.String id, java.lang.String db,
java.lang.String organism, javax.xml.rpc.holders.StringHolder title,
de.gsf.mips.xml.schemas.CrossRefResult.v1.holders.XRefsResultArrayHolder
result)
Also, the title parameter in the method signature is a
javax.xml.rpc.holders.StringHolder rather than a string.
Does anyone have any idea what's going wrong? Is it a problem with the
wsdl which I just can't see, or is it a bug with wsdl2java. Any
suggestions would be gratefully appreciated.
Thanks.
Richard
--
==================================================
Richard Gregory
Biological Information Systems Group
MIPS/ Institute for Bioinformatics
GSF-National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
D-85764 Neuherberg , Munich, Germany
Tel.: +49-89-3187-3691 Fax:+49-89-3187-3585
Email: [EMAIL PROTECTED]
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="CrossRef"
targetNamespace="http://mips.gsf.de/xml/services/CrossRefService"
xmlns:tns="http://mips.gsf.de/xml/services/CrossRefService"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sns="http://mips.gsf.de/xml/schemas/CrossRefResult/v1"
xmlns:rns="http://mips.gsf.de/xml/schemas/CrossRefRequest/v1">
<wsdl:types>
<xsd:schema
targetNamespace="http://mips.gsf.de/xml/schemas/CrossRefRequest/v1">
<xsd:element name="getReferences">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="id" type="xsd:string"
minOccurs="1" maxOccurs="1" />
<xsd:element name="db" type="xsd:string"
minOccurs="1" maxOccurs="1" />
<xsd:element name="organism" type="xsd:string"
minOccurs="1" maxOccurs="1">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema
targetNamespace="http://mips.gsf.de/xml/schemas/CrossRefResult/v1">
<xsd:element name="XRefs">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="title" type="xsd:string"
minOccurs="1" maxOccurs="1" />
<xsd:element name="result" minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:choice>
<xsd:element name="refseq"
type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="swiss"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="trembl"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="mgi"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="genname"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="proteinname"
type="xsd:string" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="mfungd-pmid"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="cdd"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="genesynonyms"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="embl"
type="sns:entry" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="cdds"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="unists"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="hprd"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="hgnc"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="geneid"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="gi"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="dbsnp"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="mim"
type="sns:entry" minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="trembl-pmid"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="go" minOccurs="0"
maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="interpro"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="proteinsynonyms"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="pfam"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="prints"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="ipi"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="upi"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="swiss-pmid"
minOccurs="0" maxOccurs="unbounded" type="sns:entry">
</xsd:element>
<xsd:element name="ensembl"
minOccurs="0" maxOccurs="unbounded" type="sns:EnsemblGene">
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="entry">
<xsd:choice>
<xsd:element name="entry" type="xsd:string"
minOccurs="1" maxOccurs="unbounded" />
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="EnsemblGene">
<xsd:sequence>
<xsd:element name="entry" type="xsd:string"
minOccurs="0" maxOccurs="unbounded">
</xsd:element>
<xsd:element name="transcription" type="sns:EnsemblTrascription" minOccurs="0" maxOccurs="1"></xsd:element>
</xsd:sequence></xsd:complexType>
<xsd:complexType name="EnsemblTrascription">
<xsd:sequence>
<xsd:element name="entry" type="xsd:string" minOccurs="0" maxOccurs="unbounded"></xsd:element>
<xsd:element name="translation" type="sns:EnsemblTranslation" minOccurs="0" maxOccurs="1"></xsd:element>
</xsd:sequence></xsd:complexType>
<xsd:complexType name="EnsemblTranslation"></xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getReferencesRequest">
<wsdl:part name="parameters" element="rns:getReferences" />
</wsdl:message>
<wsdl:message name="getReferencesResponse">
<wsdl:part name="parameters" element="sns:XRefs" />
</wsdl:message>
<wsdl:portType name="CrossRefPortType">
<wsdl:operation name="getReferences">
<wsdl:input message="tns:getReferencesRequest" />
<wsdl:output message="tns:getReferencesResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CrossRefSoapBinding"
type="tns:CrossRefPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getReferences">
<soap:operation soapAction="getReferences" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CrossRefService">
<wsdl:documentation>CrossRef Service</wsdl:documentation>
<wsdl:port name="CrossRefPort"
binding="tns:CrossRefSoapBinding">
<soap:address
location="http://mips.gsf.de/webservices/services/CrossRefService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>/**
* CrossRefSoapBindingStub.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package de.gsf.mips.xml.services.CrossRefService;
public class CrossRefSoapBindingStub extends org.apache.axis.client.Stub implements de.gsf.mips.xml.services.CrossRefService.CrossRefPortType {
private java.util.Vector cachedSerClasses = new java.util.Vector();
private java.util.Vector cachedSerQNames = new java.util.Vector();
private java.util.Vector cachedSerFactories = new java.util.Vector();
private java.util.Vector cachedDeserFactories = new java.util.Vector();
static org.apache.axis.description.OperationDesc [] _operations;
static {
_operations = new org.apache.axis.description.OperationDesc[1];
_initOperationDesc1();
}
private static void _initOperationDesc1(){
org.apache.axis.description.OperationDesc oper;
org.apache.axis.description.ParameterDesc param;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("getReferences");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "id"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "db"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "organism"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "title"), org.apache.axis.description.ParameterDesc.OUT, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "result"), org.apache.axis.description.ParameterDesc.OUT, new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefResult/v1", ">>XRefs>result"), de.gsf.mips.xml.schemas.CrossRefResult.v1.XRefsResult[].class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
_operations[0] = oper;
}
public CrossRefSoapBindingStub() throws org.apache.axis.AxisFault {
this(null);
}
public CrossRefSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public CrossRefSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
java.lang.Class cls;
javax.xml.namespace.QName qName;
javax.xml.namespace.QName qName2;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
qName = new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefResult/v1", ">>XRefs>result");
cachedSerQNames.add(qName);
cls = de.gsf.mips.xml.schemas.CrossRefResult.v1.XRefsResult.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefResult/v1", "EnsemblGene");
cachedSerQNames.add(qName);
cls = de.gsf.mips.xml.schemas.CrossRefResult.v1.EnsemblGene.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefResult/v1", "EnsemblTranslation");
cachedSerQNames.add(qName);
cls = de.gsf.mips.xml.schemas.CrossRefResult.v1.EnsemblTranslation.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefResult/v1", "EnsemblTrascription");
cachedSerQNames.add(qName);
cls = de.gsf.mips.xml.schemas.CrossRefResult.v1.EnsemblTrascription.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefResult/v1", "entry");
cachedSerQNames.add(qName);
cls = de.gsf.mips.xml.schemas.CrossRefResult.v1.Entry.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
}
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
try {
org.apache.axis.client.Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
java.lang.String key = (java.lang.String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
// All the type mapping information is registered
// when the first call is made.
// The type mapping information is actually registered in
// the TypeMappingRegistry of the service, which
// is the reason why registration is only needed for the first call.
synchronized (this) {
if (firstCall()) {
// must set encoding style before registering serializers
_call.setEncodingStyle(null);
for (int i = 0; i < cachedSerFactories.size(); ++i) {
java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
javax.xml.namespace.QName qName =
(javax.xml.namespace.QName) cachedSerQNames.get(i);
java.lang.Object x = cachedSerFactories.get(i);
if (x instanceof Class) {
java.lang.Class sf = (java.lang.Class)
cachedSerFactories.get(i);
java.lang.Class df = (java.lang.Class)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
cachedSerFactories.get(i);
org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
}
catch (java.lang.Throwable _t) {
throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
}
}
public void getReferences(java.lang.String id, java.lang.String db, java.lang.String organism, javax.xml.rpc.holders.StringHolder title, de.gsf.mips.xml.schemas.CrossRefResult.v1.holders.XRefsResultArrayHolder result) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("getReferences");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://mips.gsf.de/xml/schemas/CrossRefRequest/v1", "getReferences"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {id, db, organism});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
java.util.Map _output;
_output = _call.getOutputParams();
try {
title.value = (java.lang.String) _output.get(new javax.xml.namespace.QName("", "title"));
} catch (java.lang.Exception _exception) {
title.value = (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("", "title")), java.lang.String.class);
}
try {
result.value = (de.gsf.mips.xml.schemas.CrossRefResult.v1.XRefsResult[]) _output.get(new javax.xml.namespace.QName("", "result"));
} catch (java.lang.Exception _exception) {
result.value = (de.gsf.mips.xml.schemas.CrossRefResult.v1.XRefsResult[]) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("", "result")), de.gsf.mips.xml.schemas.CrossRefResult.v1.XRefsResult[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]