Pessoal to fazendo um helloworld aqui com webservices e EJB3, o mais estupidamente possível, é só isso num jar, jogado num Jboss4.2.3
[code]@Stateless
@WebService
public class AcessoSAP {
@WebMethod
public int somar(@WebParam(name="a") int a,
@WebParam(name="b") int b){
System.out.println("somando...");
return a + b;
}
}
[/code]
Minha dúvida é que o WSDL gerado vem com um complexType, mas só estou usando tipos primitivos. Porque isso ocorre?
<definitions name='AcessoSAPService' targetNamespace='http://sap.techpeople.com.br/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://sap.techpeople.com.br/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<xs:schema targetNamespace='http://sap.techpeople.com.br/' version='1.0' xmlns:tns='http://sap.techpeople.com.br/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='somar' type='tns:somar'/>
<xs:element name='somarResponse' type='tns:somarResponse'/>
<xs:complexType name='somar'>
<xs:sequence>
<xs:element name='a' type='xs:int'/>
<xs:element name='b' type='xs:int'/>
</xs:sequence>
</xs:complexType>
<xs:complexType name='somarResponse'>
<xs:sequence>
<xs:element name='return' type='xs:int'/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name='AcessoSAP_somarResponse'>
<part element='tns:somarResponse' name='somarResponse'></part>
</message>
<message name='AcessoSAP_somar'>
<part element='tns:somar' name='somar'></part>
</message>
<portType name='AcessoSAP'>
<operation name='somar' parameterOrder='somar'>
<input message='tns:AcessoSAP_somar'></input>
<output message='tns:AcessoSAP_somarResponse'></output>
</operation>
</portType>
<binding name='AcessoSAPBinding' type='tns:AcessoSAP'>
<soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='somar'>
<soap:operation soapAction=''/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
</operation>
</binding>
<service name='AcessoSAPService'>
<port binding='tns:AcessoSAPBinding' name='AcessoSAPPort'>
<soap:address location='http://127.0.0.1:8080/acessosap/AcessoSAP'/>
</port>
</service>
</definitions>