1

第一:我的英文不好

我的设置:JBoss AS 7

我的网络服务

@WebService

@Stateless
@Local(PessoaFisicaInterfaceWS.class)
public class PessoaFisicaWS implements PessoaFisicaInterfaceWS {

    @PersistenceContext
    public EntityManager manager;

    @Override
    @WebMethod
    public List<PessoaFisica> getList() {
        return manager.createQuery("SELECT p FROM PessoaFisica p")
                .getResultList();
    }

}

我的wsdl:

<wsdl:definitions name="PessoaFisicaWSService"
    targetNamespace="http://pacote/">
    <wsdl:types>
        <xs:schema elementFormDefault="unqualified" targetNamespace="http://pacote/"
            version="1.0">
            <xs:element name="getList" type="tns:getList" />
            <xs:element name="getListResponse" type="tns:getListResponse" />
            <xs:element name="pessoaFisica" type="tns:pessoaFisica" />
            <xs:complexType name="getList">
                <xs:sequence />
            </xs:complexType>
            <xs:complexType name="getListResponse">
                <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="return"
                        type="tns:pessoaFisica" />
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="pessoaFisica">
                <xs:complexContent>
                    <xs:extension base="tns:pessoa">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="cpf" type="xs:string" />
                            <xs:element minOccurs="0" name="dataRegistroGeral"
                                type="xs:dateTime" />
                            <xs:element minOccurs="0" name="escolaridade" type="tns:escolaridade" />
                            <xs:element minOccurs="0" name="estadoCivil" type="tns:estadoCivil" />
                            <xs:element minOccurs="0" name="estadoRg" type="tns:estado" />
                            <xs:element minOccurs="0" name="generoSexual" type="tns:sexo" />
                            <xs:element minOccurs="0" name="nomeConjuge" type="xs:string" />
                            <xs:element minOccurs="0" name="nomeMae" type="xs:string" />
                            <xs:element minOccurs="0" name="nomePai" type="xs:string" />
                            <xs:element minOccurs="0" name="numeroRegistroGeral"
                                type="xs:string" />
                            <xs:element minOccurs="0" name="profissao" type="tns:profissao" />
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>
            <xs:complexType abstract="true" name="pessoa">
                <xs:sequence>
                    <xs:element minOccurs="0" name="bairro" type="xs:string" />
                    <xs:element minOccurs="0" name="celular1" type="xs:string" />
                    <xs:element minOccurs="0" name="celular2" type="xs:string" />
                    <xs:element minOccurs="0" name="cep" type="xs:string" />
                    <xs:element minOccurs="0" name="cidadeEndereco" type="tns:cidade" />
                    <xs:element minOccurs="0" name="cidadeNascimento" type="tns:cidade" />
                    <xs:element minOccurs="0" name="dataNascimento" type="xs:dateTime" />
                    <xs:element minOccurs="0" name="email" type="xs:string" />
                    <xs:element minOccurs="0" name="endereco" type="xs:string" />
                    <xs:element minOccurs="0" name="nome" type="xs:string" />
                    <xs:element minOccurs="0" name="observacao" type="xs:string" />
                    <xs:element minOccurs="0" name="telefone1" type="xs:string" />
                    <xs:element minOccurs="0" name="telefone2" type="xs:string" />
                    <xs:element minOccurs="0" name="tipoPessoa" type="tns:tipoPessoa" />
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="escolaridade">
                <xs:sequence />
            </xs:complexType>
            <xs:complexType name="estadoCivil">
                <xs:sequence />
            </xs:complexType>
            <xs:complexType name="estado">
                <xs:sequence>
                    <xs:element minOccurs="0" name="nomeEstado" type="xs:string" />
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="sexo">
                <xs:sequence />
            </xs:complexType>
            <xs:complexType name="profissao">
                <xs:sequence />
            </xs:complexType>
            <xs:complexType name="cidade">
                <xs:sequence>
                    <xs:element minOccurs="0" name="descricao" type="xs:string" />
                    <xs:element minOccurs="0" name="estado" type="tns:estado" />
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="tipoPessoa">
                <xs:sequence />
            </xs:complexType>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="getListResponse">
        <wsdl:part element="tns:getListResponse" name="parameters">
        </wsdl:part>
    </wsdl:message>
    <wsdl:message name="getList">
        <wsdl:part element="tns:getList" name="parameters">
        </wsdl:part>
    </wsdl:message>
    <wsdl:portType name="PessoaFisicaWS">
        <wsdl:operation name="getList">
            <wsdl:input message="tns:getList" name="getList">
            </wsdl:input>
            <wsdl:output message="tns:getListResponse" name="getListResponse">
            </wsdl:output>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PessoaFisicaWSServiceSoapBinding"
        type="tns:PessoaFisicaWS">
        <soap:binding style="document"
            transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="getList">
            <soap:operation soapAction="" style="document" />
            <wsdl:input name="getList">
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output name="getListResponse">
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="PessoaFisicaWSService">
        <wsdl:port binding="tns:PessoaFisicaWSServiceSoapBinding"
            name="PessoaFisicaWSPort">
            <soap:address location="http://localhost:8080/ProcessosModulos/PessoaFisicaWS" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

但在我的浏览器中:localhost:8080/ProcessosModulos/PessoaFisicaWS?getList

 <soap:Envelope>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>No such operation: null (HTTP GET PATH_INFO:
                /ProcessosModulos/PessoaFisicaWSnull)</faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

我的网络服务找不到我的方法 getList,知道为什么吗?谢谢你

4

0 回答 0