Hello again,
Since there haven't been any replies, yet, to this questions, I
thought I could post the relevant bit of the web service's WSDL.
Please find it below. Sorry about the long post. As I said, the
sayHello service method is working perfectly fine. It's just the one
that's using the complex type User that's causing me problems. I'd be
most greatly for any hints into the right direction.
All the best,
Martin
<wsdl:definitions targetNamespace="urn:mypackage.com">
<!--
WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)
-->
<wsdl:types>
<schema targetNamespace="urn:mypackage.com">
<import namespace="http://dataObjects.database.mypackage.com"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOf_xsd_anyType">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:anyType[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
[...]
<schema targetNamespace="http://dataObjects.database.mypackage.com">
<import namespace="urn:mypackage.com"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType abstract="true" name="AbstractUser">
<sequence>
<element name="contactsForUser1"
nillable="true" type="impl:ArrayOf_xsd_anyType"/>
<element name="contactsForUser2"
nillable="true" type="impl:ArrayOf_xsd_anyType"/>
<element name="email" nillable="true"
type="xsd:string"/>
<element name="firstName"
nillable="true" type="xsd:string"/>
<element name="id" nillable="true"
type="xsd:int"/>
<element name="lastName"
nillable="true" type="xsd:string"/>
<element name="password"
nillable="true" type="xsd:string"/>
<element name="projects"
nillable="true" type="impl:ArrayOf_xsd_anyType"/>
<element name="targetteams"
nillable="true" type="impl:ArrayOf_xsd_anyType"/>
</sequence>
</complexType>
<complexType name="User">
<complexContent>
<extension base="tns1:AbstractUser">
<sequence/>
</extension>
</complexContent>
</complexType>
[...]
<wsdl:message name="registerRequest">
<wsdl:part name="in0" type="tns1:User"/>
</wsdl:message>
<wsdl:message name="sayHelloRequest">
<wsdl:part name="in0" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="registerResponse">
</wsdl:message>
<wsdl:message name="sayHelloResponse">
<wsdl:part name="sayHelloReturn" type="soapenc:string"/>
</wsdl:message>
<wsdl:portType name="Handler">
<wsdl:operation name="register" parameterOrder="in0">
<wsdl:input message="impl:registerRequest"
name="registerRequest"/>
<wsdl:output message="impl:registerResponse"
name="registerResponse"/>
<wsdl:fault message="impl:MyException"
name="MyException"/>
</wsdl:operation>
<wsdl:operation name="sayHello" parameterOrder="in0">
<wsdl:input message="impl:sayHelloRequest"
name="sayHelloRequest"/>
<wsdl:output message="impl:sayHelloResponse"
name="sayHelloResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HandlerSoapBinding" type="impl:Handler">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="register">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="registerRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mypackage.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="registerResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mypackage.com" use="encoded"/>
</wsdl:output>
<wsdl:fault name="MyException">
<wsdlsoap:fault
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MyException"
namespace="urn:mypackage.com" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sayHello">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="sayHelloRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mypackage.com" use="encoded"/>
</wsdl:input>
<wsdl:output name="sayHelloResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mypackage.com" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="IHandlerService">
<wsdl:port binding="impl:HandlerSoapBinding" name="Handler">
<wsdlsoap:address
location="http://localhost/MyProject/services/Handler"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
> Dear all,
> I have deployed a couple of web services and I keep getting an exception
> when calling one of them. I am calling two services. One takes as
> input a String and returns a String. This one works just fine. Another one
> takes as input a complex type (a Java bean) and has no return value.
> This is the one that fails with the somewhat cryptic
> exception give below (both are called using the auto-generated test
> case). The web service's method
> is called register() and basically meant to write a User object to a
> database. Calling "getCause()" returns a null value. The object I pass in
> looks fine. I can out.println() its values.
> Could anyone give me a hint as to what this means? Thanks a lot in
> advance.
> Cheers,
> Martin
> AxisFault
> faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> faultSubcode:
> faultString: java.lang.reflect.InvocationTargetException
> faultActor:
> faultNode:
> faultDetail:
> {http://xml.apache.org/axis/}hostname:Hermes
> java.lang.reflect.InvocationTargetException
> at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
> at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
> at
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:379)
> at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> at
> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> at
> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> at
> org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> at org.apache.axis.client.Call.invoke(Call.java:2748)
> at org.apache.axis.client.Call.invoke(Call.java:2424)
> at org.apache.axis.client.Call.invoke(Call.java:2347)
> at org.apache.axis.client.Call.invoke(Call.java:1804)
> at
>
> com.mypackage.ServiceHandlerSoapBindingStub.register(ServiceHandlerSoapBindingStub.java:270)
> at
>
> com.mypackage.IServiceHandlerServiceTestCase.test1ServiceHandlerRegister(IServiceServiceTestCase.java:45)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at
> junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
----------------------------------------------------------
Martin Wunderlich, M.A.
Translation/Localisation EN <-> DE
www.martinwunderlich.com
----------------------------------------------------------
Free / open-source software for translation/localisation:
www.martinwunderlich.com/foss-links.html
----------------------------------------------------------
Random aphorism:
"Aquela reinspiração, sem a qual traduzir é apenas parafrasear noutra língua."
"That new inspiration - without which to translate merely means to paraphrase
into another language."
- Fernando Pessoa
----------------------------------------------------------