Hello everybody,

I've got a problem with client, testing my Axis-running Web service (Java).

The log says:

2006-05-15 20:53:25,429 WARN [org.apache.axis.utils.JavaUtils ] - <Unable to find required classes ( javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.>
2006-05-15 20:53:25,624 DEBUG [com.xxx.autojob.tests.WebServiceTest] - <service.createCall() done>
2006-05-15 20:53:25,626 DEBUG [ com.xxx.autojob.tests.WebServiceTest] - <call.setTargetEndpointAddress(...) done>
2006-05-15 20:53:25,628 DEBUG [com.xxx.autojob.tests.WebServiceTest] - <call.setOperationName(...) done>
2006-05-15 20:53:25,645 DEBUG [ com.xxx.autojob.tests.WebServiceTest] - <call.addParameter(...) done>
2006-05-15 20:53:25,646 DEBUG [com.xxx.autojob.tests.WebServiceTest] - <call.setReturnType(...) done>
2006-05-15 20:53:25,802 ERROR [ com.xxx.autojob.tests.WebServiceTest] - <java.lang.ClassCastException: $Proxy7>
AxisFault
 faultCode: { http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.ClassCastException: $Proxy7
 faultActor:
 faultNode:
 faultDetail:
    { http://xml.apache.org/axis/}hostname:applejuice.xxx.com

java.lang.ClassCastException: $Proxy7
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java :129)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch (XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java :148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    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:435)
    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:2784)
    at org.apache.axis.client.Call.invoke(Call.java :2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.xxx.autojob.tests.WebServiceTest.testWebService (WebServiceTest.java:75)
    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 junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at junit.textui.TestRunner.doRun (TestRunner.java:116)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:58)
    at junit.textui.TestRunner.start(TestRunner.java:172)
    at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs (TextTestRunner2.java:23)
    at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:98)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)

junit.framework.ComparisonFailure :
Expected :TheNameOfJob
Actual  :
    at com.xxx.autojob.tests.WebServiceTest.testWebService(WebServiceTest.java:86)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect (TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)


Process finished with exit code 255

Can please somebody advise what's that and what should I read to fix it?

The testing code looks very simple:

        String endpoint = "http://localhost:8081/autojob/soap/webservice ";

        String method = "submitJob";
        String in0 = "TheNameOfJob";

        String expected = in0;
        String result = "";

        try {
            Service service = new Service();
            Call call = (Call)service.createCall();

            log.debug("service.createCall() done");

            call.setTargetEndpointAddress(new java.net.URL(endpoint));

            log.debug("call.setTargetEndpointAddress(...) done");

            call.setOperationName(new QName("urn:soap.autojob.xxx.com", method));

            log.debug("call.setOperationName(...) done");

            call.addParameter("in0", XMLType.XSD_STRING, ParameterMode.IN);

            log.debug("call.addParameter(...) done");

            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING );

            log.debug("call.setReturnType(...) done");

            result = (String)call.invoke( new Object[] { in0 } );

            log.debug("call.invoke(...) done");

        } catch (Exception e) {

            log.error(e.getMessage());
            e.printStackTrace();

        }

        assertEquals(expected, result);
    }

I can access http://localhost:8081/autojob/soap/webservice from the browser and it shows:

webservice

Hi there, this is an AXIS service!

Perhaps there will be a form for invoking the service here...

Also, I can perfectly well see http://localhost:8081/autojob/soap/webservice?wsdl and it shows:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:soap.autojob.xxx.com" xmlns:apachesoap=" http://xml.apache.org/xml-soap" xmlns:impl="urn: soap.autojob.xxx.com" xmlns:intf="urn: soap.autojob.xxx.com" xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap=" http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->

   <wsdl:message name="submitJobResponse">

      <wsdl:part name="submitJobReturn" type="xsd:string"/>

   </wsdl:message>

   <wsdl:message name="submitJobRequest">

      <wsdl:part name="in0" type="xsd:string"/>

   </wsdl:message>

   <wsdl:portType name="WebServiceImpl">

      <wsdl:operation name="submitJob" parameterOrder="in0">

         <wsdl:input message="impl:submitJobRequest" name="submitJobRequest"/>

         <wsdl:output message="impl:submitJobResponse" name="submitJobResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="webserviceSoapBinding" type="impl:WebServiceImpl">

      <wsdlsoap:binding style="rpc" transport=" http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="submitJob">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="submitJobRequest">

            <wsdlsoap:body encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/ " namespace="http://soap.autojob.xxx.com" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="submitJobResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ " namespace="urn:soap.autojob.xxx.com " use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="WebServiceImplService">

      <wsdl:port binding="impl:webserviceSoapBinding" name="webservice">

         <wsdlsoap:address location=" http://localhost:8081/autojob/soap/webservice "/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>


I would be very thankful for any suggestions.

--
Alexander Prohorenko.


--
Alexander Prohorenko.

Reply via email to