The generated code won't get Endpoint address right. Yours is  
http://localhost/WSTest/services/SayHello2. 
See if the following code or something simailar  can help:

call.setTargetEndpointAddress( new 
java.net.URL("http://localhost/WSTest/services/SayHello2";) 

-----Original Message-----
From: Jinyuan Zhou [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 05, 2006 10:57 AM
To: [email protected]; Martin Wunderlich
Subject: RE: Problem using deployed Axis web services

I think wsdl2java has an option to create Junit test case. Try  start from 
there to write a client code. However 
http://localhost/WSTest/services/SayHello2?in=bla does not send an http request 
in the way web service expected.
It expect an soap message as content and content type like text/xml or 
applicaton/xml. 


-----Original Message-----
From: Martin Wunderlich [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 05, 2006 10:42 AM
To: Jay Glanville
Subject: Problem using deployed Axis web services

Dear all,

my first posting here, so please bear with me, in case I should break any 
unwritten rules.

I am currently trying to get my first web services up and running on Tomcat 5. 
I created a simple Java class to return a String:


public class SayHello2
{
    public String hello(String in)
    {
        return ("Hello, " + in);
    }
}



>From this class I created the WSDL with Java2Wsdl. I created the deployment 
>descriptor using Wsdl2Java and deployed the whole thing using the Axis 
>AdminClient. Finally, I compiled the resulting classes from step 2 and copied 
>them to the directory that corresponds to the package name. 

The web service is listed together with the method in the list provided by 
Axis. However, I can not access the method, neither entering the direct URL 
(http://localhost/WSTest/services/SayHello2?in=bla), nor using the stub classes 
generated by Axis, nor using a org.apache.axis.client.Call. I am quite lost. 
Does anyone have any ideas what I could check? I've pasted the WSDL below, just 
in case there's any hint in there. (I can access this wsdl alright with 
http://localhost/WSTest/services/SayHello2?wsdl). 

Cheers, 

N. 


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:testPackage" 
xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="urn:testPackage" 
xmlns:intf="urn:testPackage" 
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.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->
 
   <wsdl:message name="helloResponse">
 
      <wsdl:part name="helloReturn" type="soapenc:string"/>
 
   </wsdl:message>
 
   <wsdl:message name="helloRequest">
 
      <wsdl:part name="in" type="soapenc:string"/>
 
   </wsdl:message>
 
   <wsdl:portType name="SayHello2">
 
      <wsdl:operation name="hello" parameterOrder="in">
 
         <wsdl:input message="impl:helloRequest" name="helloRequest"/>
 
         <wsdl:output message="impl:helloResponse" name="helloResponse"/>
 
      </wsdl:operation>
 
   </wsdl:portType>
 
   <wsdl:binding name="SayHello2SoapBinding" type="impl:SayHello2">
 
      <wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
 
      <wsdl:operation name="hello">
 
         <wsdlsoap:operation soapAction=""/>
 
         <wsdl:input name="helloRequest">
 
            <wsdlsoap:body 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
namespace="urn:testPackage" use="encoded"/>
 
         </wsdl:input>
 
         <wsdl:output name="helloResponse">
 
            <wsdlsoap:body 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
namespace="urn:testPackage" use="encoded"/>
 
         </wsdl:output>
 
      </wsdl:operation>
 
   </wsdl:binding>
 
   <wsdl:service name="SayHello2Service">
 
      <wsdl:port binding="impl:SayHello2SoapBinding" name="SayHello2">
 
         <wsdlsoap:address 
location="http://localhost/WSTest/services/SayHello2"/>
 
      </wsdl:port>
 
   </wsdl:service>
 
</wsdl:definitions>



-- 
----------------------------------------------------------
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: 
 "Es ist ein Wunder, dass Neugier die Schulbildung überlebt."
"It is a miracle that curiosity survives formal education."
 - Albert Einstein
----------------------------------------------------------

Reply via email to