OK, here it all is:
Thing.java
package org.rnd;

public class Thing {
        private String Name;

        public String getName() {
                return Name;
        }

        public void setName(String name) {
                Name = name;
        }
        

}
WS.java
package org.rnd;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

@WebService(name="WSPortType",
        targetNamespace = "http://rnd.org";)
public interface WS  {
    @WebResult(name="echo")
    public String Echo(@WebParam(name="stringToEcho")String stringToEcho);
        
        
    @WebResult(name="thingArray")
    public Thing[] GetThings();
    
    @WebResult(name="thingArray2")
    public java.util.ArrayList<Thing> GetMoreThings();   
}

WSService.java

package org.rnd;

import java.util.ArrayList;

import javax.jws.WebService;

@WebService(serviceName="WS", 
                portName="WSPort",
                endpointInterface="org.rnd.WS", 
        targetNamespace = "http://rnd.org";)        
public class WSService implements WS {
        
        public String Echo(String stringToEcho) {
                return stringToEcho;            
        }

        public Thing[] GetThings() {
                
                Thing[] arrThings = new Thing[2];
                arrThings[0] = new Thing();
                arrThings[1] = new Thing();
                return arrThings;
        }
    public java.util.ArrayList<Thing> GetMoreThings(){
        java.util.ArrayList<Thing> arr = new java.util.ArrayList<Thing>();
        arr.add(new Thing());
        arr.add(new Thing());
        return arr;
        
    }

}

http://localhost:28080/rnd/WS?wsdl
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:tns="http://rnd.org"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";
name="WS" targetNamespace="http://rnd.org";>
  <types>
    <xsd:schema>
      <xsd:import namespace="http://rnd.org";
schemaLocation="http://localhost:28080/rnd/WS?xsd=WS_schema1.xsd"/>
    </xsd:schema>
  </types>
  <message name="GetMoreThings">
    <part element="tns:GetMoreThings" name="parameters">
    </part>
  </message>
  <message name="Echo">
    <part element="tns:Echo" name="parameters">
    </part>
  </message>
  <message name="GetThings">
    <part element="tns:GetThings" name="parameters">
    </part>
  </message>
  <message name="GetMoreThingsResponse">
    <part element="tns:GetMoreThingsResponse" name="parameters">
    </part>
  </message>
  <message name="EchoResponse">
    <part element="tns:EchoResponse" name="parameters">
    </part>
  </message>
  <message name="GetThingsResponse">
    <part element="tns:GetThingsResponse" name="parameters">
    </part>
  </message>
  <portType name="WSPortType">
    <operation name="Echo">
      <input message="tns:Echo">
    </input>
      <output message="tns:EchoResponse">
    </output>
    </operation>
    <operation name="GetThings">
      <input message="tns:GetThings">
    </input>
      <output message="tns:GetThingsResponse">
    </output>
    </operation>
    <operation name="GetMoreThings">
      <input message="tns:GetMoreThings">
    </input>
      <output message="tns:GetMoreThingsResponse">
    </output>
    </operation>
  </portType>
  <binding name="WSPortBinding" type="tns:WSPortType">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="Echo">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="GetThings">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="GetMoreThings">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="WS">
    <port binding="tns:WSPortBinding" name="WSPort">
      <soap:address location="http://localhost:28080/rnd/WS"/>
    </port>
  </service>
</definitions>

http://localhost:28080/rnd/WS?xsd=WS_schema1.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://rnd.org";
xmlns:xs="http://www.w3.org/2001/XMLSchema"; targetNamespace="http://rnd.org";
version="1.0">

  <xs:element name="Echo" type="tns:Echo"/>

  <xs:element name="EchoResponse" type="tns:EchoResponse"/>

  <xs:element name="GetMoreThings" type="tns:GetMoreThings"/>

  <xs:element name="GetMoreThingsResponse"
type="tns:GetMoreThingsResponse"/>

  <xs:element name="GetThings" type="tns:GetThings"/>

  <xs:element name="GetThingsResponse" type="tns:GetThingsResponse"/>

  <xs:complexType name="Echo">
    <xs:sequence>
      <xs:element minOccurs="0" name="stringToEcho" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="EchoResponse">
    <xs:sequence>
      <xs:element minOccurs="0" name="echo" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="GetThings"/>

  <xs:complexType name="GetThingsResponse">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="thingArray"
type="tns:thing"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="thing">
    <xs:sequence>
      <xs:element minOccurs="0" name="name" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="GetMoreThings"/>

  <xs:complexType name="GetMoreThingsResponse">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="thingArray2"
type="tns:thing"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

-- 
View this message in context: 
http://www.nabble.com/Simple-JAX-WS-tp18759351s134p18760817.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.

Reply via email to