axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <atma...@gmail.com>
Subject Re: (newbie) WSDL review request
Date Tue, 13 Mar 2007 07:36:31 GMT
Just a few points:

First, in your schema, this element declaration is wrong:

 <xsd:element name="operator" type="operatorType"/>

It should be:

  <xsd:element name="operator" type="ns1:operatorType"/>

Second, the soapAction value should be a URI rather than just a string.

Third, you must not include a namespace attribute in your <soap:body>
declarations when using style="document". (It must be used only when
using style="rpc".)

Therefore this:

       <soap:body use="literal"
        namespace="http://www.mycompany.com/mathQandA" />

Should be:

       <soap:body use="literal" />

Anne

On 3/13/07, Glen Mazza <grm7793@verizon.net> wrote:
> Hello all,
>
> To learn about web services I created my first WSDL below.  It's a
> rather simple web service that takes two numbers and an operator (plus,
> minus, times, dividedBy) and returns the result.  WSDL2Java runs fine
> with this and I was able to get the web service working on Axis2 without
> much problem.
>
> Still, since this is the first WSDL file I've created I thought it would
> be good to run it by the list in case I'm doing anything suboptimal or
> unusual below (naming strategies?  uri's used?).  Any comments welcome.
>
> Thanks,
> Glen
>
>
> <?xml version="1.0" encoding="utf-8" ?>
> <wsdl:definitions
>       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>       targetNamespace="http://www.mycompany.com/wsdl/mathQandA"
>       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>       xmlns:tns="http://www.mycompany.com/wsdl/mathQandA"
>       xmlns:ns1="http://www.mycompany.com/schema/mathQandA">
>
> <wsdl:types>
>    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
> targetNamespace="http://www.mycompany.com/schema/mathQandA">
>
>    <xsd:element name="solveMathProblemRequest">
>       <xsd:complexType>
>          <xsd:sequence>
>             <xsd:element name="operand1" type="xsd:integer"/>
>             <xsd:element name="operand2" type="xsd:integer"/>
>             <xsd:element name="operator" type="operatorType"/>
>          </xsd:sequence>
>       </xsd:complexType>
>    </xsd:element>
>
>    <xsd:element name="solveMathProblemResponse">
>       <xsd:complexType>
>         <xsd:sequence>
>           <xsd:element name="answer" type="xsd:integer"/>
>         </xsd:sequence>
>       </xsd:complexType>
>     </xsd:element>
>
>    <xsd:simpleType name="operatorType">
>       <xsd:restriction base="xsd:string">
>          <xsd:enumeration value="plus"/>
>          <xsd:enumeration value="minus"/>
>          <xsd:enumeration value="times"/>
>          <xsd:enumeration value="divided by"/>
>      </xsd:restriction>
>    </xsd:simpleType>
>
>    </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="solveMathProblemRequestMessage">
>   <wsdl:part name="part1" element="ns1:solveMathProblemRequest"/>
> </wsdl:message>
>
> <wsdl:message name="solveMathProblemResponseMessage">
>   <wsdl:part name="part1" element="ns1:solveMathProblemResponse" />
> </wsdl:message>
>
> <wsdl:portType name="MathQandAPortType">
>      <wsdl:operation name="askMathQuestion">
>          <wsdl:input message="tns:solveMathProblemRequestMessage" />
>          <wsdl:output message="tns:solveMathProblemResponseMessage" />
>      </wsdl:operation>
> </wsdl:portType>
>
> <wsdl:binding name="MathQandABinding" type="tns:MathQandAPortType">
>
>   <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
>    style="document"/>
>
>   <wsdl:operation name="askMathQuestion">
>     <soap:operation soapAction="askMathQuestion" style="document"/>
>     <wsdl:input>
>       <soap:body use="literal"
>          namespace="http://www.mycompany.com/mathQandA"/>
>     </wsdl:input>
>     <wsdl:output>
>       <soap:body use="literal"
>          namespace="http://www.mycompany.com/mathQandA" />
>     </wsdl:output>
>   </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:service name="MathQandAService">
>   <wsdl:port name="MathQandAServicePort"
>       binding="tns:MathQandABinding">
>     <soap:address location=
>        "http://127.0.0.1:8080/axis2/services/MathQandAService"/>
>   </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message