1 Reply Latest reply on Aug 29, 2009 11:51 AM by Peter Johnson

    regarding message types in bottom-up service generation

    yanbo wu Newbie

      Hi,
      I am learning web service using jboss 5 and jbossws as runtime. I have created a POJO which is quoted below:

      @WebService
      public class HelloWorld {
      
       @WebMethod
       public String sayHello(@WebParam(name="name") String name) {
       return "Hello, " + name;
       }
      }
      


      The problem is when i deployed the service into jboss, at runtime, the wsdl file generated contains complex type definitions for the parameter and return value. I expected xsd:string as message type, but it wasn't so. Can anybody be kind to tell me why this happens and how to avoid it? Thanks

      Here is the wsdl file generated:
      - <definitions name="HelloWorldService" targetNamespace="http://ws.wuyb.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.wuyb.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      - <types>
      - <xs:schema targetNamespace="http://ws.wuyb.com/" version="1.0" xmlns:tns="http://ws.wuyb.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="sayHello" type="tns:sayHello" />
       <xs:element name="sayHelloResponse" type="tns:sayHelloResponse" />
      - <xs:complexType name="sayHello">
      - <xs:sequence>
       <xs:element minOccurs="0" name="name" type="xs:string" />
       </xs:sequence>
       </xs:complexType>
      - <xs:complexType name="sayHelloResponse">
      - <xs:sequence>
       <xs:element minOccurs="0" name="return" type="xs:string" />
       </xs:sequence>
       </xs:complexType>
       </xs:schema>
       </types>
      - <message name="HelloWorld_sayHelloResponse">
       <part element="tns:sayHelloResponse" name="sayHelloResponse" />
       </message>
      - <message name="HelloWorld_sayHello">
       <part element="tns:sayHello" name="sayHello" />
       </message>
      - <portType name="HelloWorld">
      - <operation name="sayHello" parameterOrder="sayHello">
       <input message="tns:HelloWorld_sayHello" />
       <output message="tns:HelloWorld_sayHelloResponse" />
       </operation>
       </portType>
      - <binding name="HelloWorldBinding" type="tns:HelloWorld">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      - <operation name="sayHello">
       <soap:operation soapAction="" />
      - <input>
       <soap:body use="literal" />
       </input>
      - <output>
       <soap:body use="literal" />
       </output>
       </operation>
       </binding>
      - <service name="HelloWorldService">
      - <port binding="tns:HelloWorldBinding" name="HelloWorldPort">
       <soap:address location="http://127.0.0.1:8080/HelloWorld/HelloWorld" />
       </port>
       </service>
       </definitions>