You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by tsukamoto <ts...@niscom.co.jp> on 2002/08/09 10:24:13 UTC

How to make WSDD correct?

Hello.

I'm new to AXIS and WebService.
I try to make my first WebService Application,and it dosn't work.

I can work WebService by using C:\axis-1_0\samples\userguide\example3.
If I make WSDL by this example it doesn't work.
I see defarance example3\deploy.wsdd and my deploy.wsdd made by
C:\axis-1_0\samples\userguide\example3.classes.

May be my command to make wsdd is something wrong.
How do you make wsdd?

BestRegard.



1 I made Simple Class

---------------------
package hello;

public class Hello {
  public String getHello(){
    return "hello" + word;
  }
  public void setHello(String word){
    this.word = word;
  }
  private String word = "";
}
----------------------

2 compile it

3 make WSDD like this
D:\javaDevelopment\src>java org.apache.axis.wsdl.Java2WSDL -o
hello\hello.wsdl -
l http://localhost:8080/axis/hello -n HelloService hello.Hello



<!-- Use this file to deploy some handlers/chains and services      -->
<!-- Two ways to do this:                                           -->
<!--   java org.apache.axis.client.AdminClient deploy.wsdd          -->
<!--      after the axis server is running                          -->
<!-- or                                                             -->
<!--   java org.apache.axis.utils.Admin client|server deploy.wsdd   -->
<!--      from the same directory that the Axis engine runs         -->

<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <!-- Services from HelloService WSDL service -->

  <service name="hello" provider="java:RPC">
      <parameter name="wsdlTargetNamespace" value="helloSv"/>
      <parameter name="wsdlServiceElement" value="HelloService"/>
      <parameter name="wsdlServicePort" value="hello"/>
      <parameter name="className" value="helloSv.HelloSoapBindingImpl"/>
      <parameter name="wsdlPortType" value="Hello"/>
      <operation name="getHello" qname="operNS:getHello"
xmlns:operNS="helloSv" returnQName="return" >
      </operation>
      <operation name="setHello" qname="operNS:setHello"
xmlns:operNS="helloSv" >
        <parameter name="in0" type="tns:string"
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"/>
      </operation>
      <parameter name="allowedMethods" value="getHello setHello"/>

  </service>
</deployment>


4 make stabs like this
D:\javaDevelopment\src>java org.apache.axis.wsdl.WSDL2Java -s
hello\hello.wsdl

5 start tomcat and confarm AXIS engine is work

6 complie stabs

7 deploy

8 execute by this class
package helloSv;

public class HelloClient {

 public static void main(String[] args) {
  try {
   Hello service = new HelloServiceLocator().getHello();
   service.setHello("taro");
   System.out.println(service.getHello());
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}

9 result

D:\javaDevelopment\src>java helloSv.HelloClient
- Mapping Exception to AxisFault
AxisFault
 faultCode: {http://xml.apache.org/axis/}HTTP
 faultString: (404)/hello
 faultActor: null
 faultDetail:
        null: return code:  404
&lt;html&gt;&lt;head&gt;&lt;title&gt;Apache Tomcat/4.0.4 - Error
report&lt;/titl
e&gt;&lt;STYLE&gt;&lt;!--H1{font-family : sans-serif,Arial,Tahoma;color :
white;
background-color : #0086b2;} BODY{font-family :
sans-serif,Arial,Tahoma;color :
black;background-color : white;} B{color : white;background-color :
#0086b2;} HR
{color : #0086b2;} --&gt;&lt;/STYLE&gt;
&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Apach
e Tomcat/4.0.4 - HTTP Status 404 - /hello&lt;/h1&gt;&lt;HR
size=&quot;1&quot; no
shade&gt;&lt;p&gt;&lt;b&gt;type&lt;/b&gt; Status
report&lt;/p&gt;&lt;p&gt;&lt;b&
gt;message&lt;/b&gt;
&lt;u&gt;/hello&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;descri
ption&lt;/b&gt; &lt;u&gt;The requested resource (/hello) is not
available.&lt;/u
&gt;&lt;/p&gt;&lt;HR size=&quot;1&quot;
noshade&gt;&lt;/body&gt;&lt;/html&gt;

(404)/hello
        at
org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j
ava:800)
        at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:164)

        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:71)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:183)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2027)
        at org.apache.axis.client.Call.invoke(Call.java:2016)
        at org.apache.axis.client.Call.invoke(Call.java:1786)
        at org.apache.axis.client.Call.invoke(Call.java:1711)
        at org.apache.axis.client.Call.invoke(Call.java:1251)
        at
helloSv.HelloSoapBindingStub.setHello(HelloSoapBindingStub.java:131)
        at helloSv.HelloClient.main(HelloClient.java:16)
AxisFault
 faultCode: {http://xml.apache.org/axis/}HTTP
 faultString: (404)/hello
 faultActor: null
 faultDetail:
        null: return code:  404
&lt;html&gt;&lt;head&gt;&lt;title&gt;Apache Tomcat/4.0.4 - Error
report&lt;/titl
e&gt;&lt;STYLE&gt;&lt;!--H1{font-family : sans-serif,Arial,Tahoma;color :
white;
background-color : #0086b2;} BODY{font-family :
sans-serif,Arial,Tahoma;color :
black;background-color : white;} B{color : white;background-color :
#0086b2;} HR
{color : #0086b2;} --&gt;&lt;/STYLE&gt;
&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Apach
e Tomcat/4.0.4 - HTTP Status 404 - /hello&lt;/h1&gt;&lt;HR
size=&quot;1&quot; no
shade&gt;&lt;p&gt;&lt;b&gt;type&lt;/b&gt; Status
report&lt;/p&gt;&lt;p&gt;&lt;b&
gt;message&lt;/b&gt;
&lt;u&gt;/hello&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;descri
ption&lt;/b&gt; &lt;u&gt;The requested resource (/hello) is not
available.&lt;/u
&gt;&lt;/p&gt;&lt;HR size=&quot;1&quot;
noshade&gt;&lt;/body&gt;&lt;/html&gt;

(404)/hello
        at
org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j
ava:800)
        at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:164)

        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:71)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:183)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2027)
        at org.apache.axis.client.Call.invoke(Call.java:2016)
        at org.apache.axis.client.Call.invoke(Call.java:1786)
        at org.apache.axis.client.Call.invoke(Call.java:1711)
        at org.apache.axis.client.Call.invoke(Call.java:1251)
        at
helloSv.HelloSoapBindingStub.setHello(HelloSoapBindingStub.java:131)
        at helloSv.HelloClient.main(HelloClient.java:16)