Hi there, friendly helpers!
I just started building web services with Apache Axis (configuration Tomcat
5, Axis 1.1, JSDK 1.4.1 on WinXP).
What I did:
- I put together a wsdl-file (relevant portions attached) with a complex
type "tps" consisting of a number of complex types ("tp")
- Using WSDL2Java I generated a client stub and server skeleton
(otsbindingimpl)
- I deployed my web service with the generated wsdd file
- yeap, Axis shows my web service in its list of deployed web services.
(http://127.0.0.1:8080/axis/servlet/AxisServlet: And now.. Some Services
*ots (wsdl))
- when I click on the wsdl link I get
Fault - makeTypeElement() was told to create a type "{urn:ots}>tps>tp", with
no containing element
- when I use my client to access the web service (service ots/method
gettps), I always get NULL as return value... (I'm not sure, if this is
connected to the makeTypeElement-Fault.
What I then did, following the good old trial&error-strategy:
- I added a <wsdlfile>ots.wsdl</wsdlfile> element to my wsdd file. I put the
wsdl file into the lib-directory containing my web service classes
(undeploy/ deploy with restart tomcat) Result: No change.
- I tried to access a standard web service (service Version, method
getVersion). Worked out fine. It returned the Axis Version Info.
- I googled around and read the mailing list... Only to find other people
with same problems, but no solutions.
Any ideas?
- Rick.
--- Attach ---
--- wsdl-file (relevant portion) ---
from the <types>-section:
I have a separate tp element and a tp element encapsulated in the tps
element. (- Axis didn't take a reference to external xsd-files. :( -) With
this specific problem only the encapsulated tp-type is relevant. the
separate one is for another method I have defined in the wsdl.
<xs:element name="tp">
<xs:complexType>
<xs:sequence>
<xs:element name="id" type="xs:string"/>
<xs:element name="predecessor_id" type="xs:string"/>
<xs:element name="hops" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tps">
<xs:complexType>
<xs:sequence>
<xs:element name="tp" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="id"
type="xs:string"/>
<xs:element name="predecessor_id"
type="xs:string"/>
<xs:element name="hops"
type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
the rest (standard):
<message name="gettps_IN">
<part name="maxhops" element="ots:maxhops"/>
</message>
<message name="gettps_OUT">
<part name="tps" element="ots:tps"/>
</message>
<portType...
<binding...
<service...
--- client-code ---
>From OTSBindingStub:
public class OTSBindingStub extends org.apache.axis.client.Stub implements
OTSInterface {
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[6];
org.apache.axis.description.OperationDesc oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("gettps");
... as generated by WSDL2Java
OTSClient:
public class OTSClient {
public static void main(String[] args) throws Exception{
OTSBindingStub ots = new OTSBindingStub(new
java.net.URL("http://127.0.0.1:8080/axis/services/OTS"), null);
_tps tps = ots.gettps(java.math.BigInteger.valueOf(5));
if (tps != null) {
System.out.println(tps.gettp(0).getId());
} else {
System.err.println("No tp available!");
}
}
}
>>> Returns always "No tp available!".
That's it!
--- server code ---
>From OTSBindingImpl:
public class OTSBindingImpl implements OTSInterface {
public tps gettps(java.math.BigInteger maxhops) throws
java.rmi.RemoteException {
System.out.println("ots/gettps invoked. Maxhops = " +
maxhops.toString());
_tps tps = new tps();
tps.settp(0, new _tps_tp());
tps.gettp(0).setId("Rick");
return tps;
}
... rest as generated by WSDL2Java
>>> No output on tomcat console.
---
any information you are missing for some successful trouble shooting? I
would be happy to supply more.
------------
Richard Alan Herz, Dipl. Wirtsch. Inf.
Ce-bIS, Otto-Friedrich-Universit�t Bamberg
Centre of business information systems
Kronacher Stra�e 41
D-96052 Bamberg
Phone +49 (0)951 4 07 63-14
Fax +49 (0)951 4 07 63-29
Mail [EMAIL PROTECTED]
*** Ce-bIS @ CeBIT 2004 (Hannover, 18. - 24.3): Halle 11, Stand D05
**** Ce-bIS @ CeBIT Asia 2004 (Shanghai, 26. - 29.4): Future Parc