java веб-сервис apache ошибка 2 оси: org. apache .axis2.AxisFault: RawInOnlyXMLMessageReceiver - PullRequest
0 голосов
/ 16 апреля 2020

Я пытаюсь создать простой веб-сервис с java и apache axis2.

К сожалению, я получаю следующее сообщение об ошибке и не совсем понимаю, что оно означает. [ОШИБКА] org. apache .axis2.AxisFault: RawInOnlyXMLMessageReceiver не может обработать этот сценарий, поскольку ServiceClass реализован для принятия Non OMElement в качестве аргументов метода.

Может кто-нибудь объяснить, что эта ошибка означает, что я делаю неправильно? Клиент выполняет следующий метод:

public void mitarbeiterSpeichern()
    {
        MyServiceStub.MitarbeiterSpeichern info = new MitarbeiterSpeichern();
        Mitarbeiter mdata  =new Mitarbeiter();
        mdata.set_vorname(_erfassung.getVnfield().getText());
        mdata.set_nachname(_erfassung.getNnfield().getText());
        mdata.set_geschlecht(_erfassung.getGeschlecht());
        mdata.set_id(_erfassung.getIdfield().getText());
        if(_erfassung.get_bild()!=null)
        {
            try {
                mdata.set_image(new DataHandler(_erfassung.get_bild().toURI().toURL()));
            } catch (MalformedURLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        info.setMa(mdata);
        try {
            _stub.mitarbeiterSpeichern(info);
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

Сервер должен открыть соединение с базой данных гибернации и сохранить сотрудника.

    public void mitarbeiterSpeichern(Mitarbeiter ma)

    {
        Session session = DbHelper.getSession();
    session.beginTransaction();
    Mitarbeiter mitarbeiter = new Mitarbeiter(ma.get_vorname(), ma.get_nachname(), ma.get_geschlecht(), ma.get_id());
    if (ma.get_image() !=null)
    {
        mitarbeiter.set_image(ma.get_image());
    }

    session.saveOrUpdate(mitarbeiter);
    session.flush();
}

Автоматически сгенерированный wsdl находится здесь:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ax21="http://dao.database/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://ws.apache.org/axis2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><wsdl:documentation> Please Type your service description here </wsdl:documentation><wsdl:types><xs:schema targetNamespace="http://ws.apache.org/axis2" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:ax22="http://dao.database/xsd"><xs:import namespace="http://dao.database/xsd"/><xs:element name="mitarbeiterSpeichern"><xs:complexType><xs:sequence><xs:element name="ma" type="ax22:Mitarbeiter" nillable="true" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="getMitarbeiter"><xs:complexType><xs:sequence><xs:element name="id" type="xs:string" nillable="true" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="getMitarbeiterResponse"><xs:complexType><xs:sequence><xs:element name="return" type="ax22:Mitarbeiter" nillable="true" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="checkKommen"><xs:complexType><xs:sequence><xs:element name="id" type="xs:string" nillable="true" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="checkKommenResponse"><xs:complexType><xs:sequence><xs:element name="return" type="xs:boolean"/></xs:sequence></xs:complexType></xs:element><xs:element name="buchen"><xs:complexType><xs:sequence><xs:element name="id" type="xs:string" nillable="true" minOccurs="0"/></xs:sequence></xs:complexType></xs:element></xs:schema><xs:schema targetNamespace="http://dao.database/xsd" elementFormDefault="qualified" attributeFormDefault="qualified"><xs:complexType name="Mitarbeiter"><xs:sequence><xs:element name="_buchungen" type="ax21:Vorgang" nillable="true" minOccurs="0" maxOccurs="unbounded"/><xs:element name="_geschlecht" type="xs:string" nillable="true" minOccurs="0"/><xs:element name="_id" type="xs:string" nillable="true" minOccurs="0"/><xs:element name="_image" type="xs:base64Binary" nillable="true" minOccurs="0"/><xs:element name="_nachname" type="xs:string" nillable="true" minOccurs="0"/><xs:element name="_vorname" type="xs:string" nillable="true" minOccurs="0"/></xs:sequence></xs:complexType><xs:complexType name="Vorgang"><xs:sequence><xs:element name="_datum" type="xs:date" nillable="true" minOccurs="0"/><xs:element name="_id" type="xs:int" minOccurs="0"/></xs:sequence></xs:complexType></xs:schema></wsdl:types><wsdl:message name="getMitarbeiterRequest"><wsdl:part name="parameters" element="ns:getMitarbeiter"/></wsdl:message><wsdl:message name="getMitarbeiterResponse"><wsdl:part name="parameters" element="ns:getMitarbeiterResponse"/></wsdl:message><wsdl:message name="checkKommenRequest"><wsdl:part name="parameters" element="ns:checkKommen"/></wsdl:message><wsdl:message name="checkKommenResponse"><wsdl:part name="parameters" element="ns:checkKommenResponse"/></wsdl:message><wsdl:message name="buchenRequest"><wsdl:part name="parameters" element="ns:buchen"/></wsdl:message><wsdl:message name="mitarbeiterSpeichernRequest"><wsdl:part name="parameters" element="ns:mitarbeiterSpeichern"/></wsdl:message><wsdl:portType name="MyServicePortType"><wsdl:operation name="getMitarbeiter"><wsdl:input wsaw:Action="urn:getMitarbeiter" message="ns:getMitarbeiterRequest"/><wsdl:output wsaw:Action="urn:getMitarbeiterResponse" message="ns:getMitarbeiterResponse"/></wsdl:operation><wsdl:operation name="checkKommen"><wsdl:input wsaw:Action="urn:checkKommen" message="ns:checkKommenRequest"/><wsdl:output wsaw:Action="urn:checkKommenResponse" message="ns:checkKommenResponse"/></wsdl:operation><wsdl:operation name="buchen"><wsdl:input wsaw:Action="urn:buchen" message="ns:buchenRequest"/></wsdl:operation><wsdl:operation name="mitarbeiterSpeichern"><wsdl:input wsaw:Action="urn:mitarbeiterSpeichern" message="ns:mitarbeiterSpeichernRequest"/></wsdl:operation></wsdl:portType><wsdl:binding name="MyServiceSoap11Binding" type="ns:MyServicePortType"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="getMitarbeiter"><soap:operation style="document" soapAction="urn:getMitarbeiter"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="checkKommen"><soap:operation style="document" soapAction="urn:checkKommen"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="buchen"><soap:operation style="document" soapAction="urn:buchen"/><wsdl:input><soap:body use="literal"/></wsdl:input></wsdl:operation><wsdl:operation name="mitarbeiterSpeichern"><soap:operation style="document" soapAction="urn:mitarbeiterSpeichern"/><wsdl:input><soap:body use="literal"/></wsdl:input></wsdl:operation></wsdl:binding><wsdl:binding name="MyServiceSoap12Binding" type="ns:MyServicePortType"><soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="getMitarbeiter"><soap12:operation style="document" soapAction="urn:getMitarbeiter"/><wsdl:input><soap12:body use="literal"/></wsdl:input><wsdl:output><soap12:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="checkKommen"><soap12:operation style="document" soapAction="urn:checkKommen"/><wsdl:input><soap12:body use="literal"/></wsdl:input><wsdl:output><soap12:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="buchen"><soap12:operation style="document" soapAction="urn:buchen"/><wsdl:input><soap12:body use="literal"/></wsdl:input></wsdl:operation><wsdl:operation name="mitarbeiterSpeichern"><soap12:operation style="document" soapAction="urn:mitarbeiterSpeichern"/><wsdl:input><soap12:body use="literal"/></wsdl:input></wsdl:operation></wsdl:binding><wsdl:binding name="MyServiceHttpBinding" type="ns:MyServicePortType"><http:binding verb="POST"/> <wsdl:operation name="getMitarbeiter"><http:operation location="getMitarbeiter"/><wsdl:input><mime:content type="application/xml" part="parameters"/></wsdl:input><wsdl:output><mime:content type="application/xml" part="parameters"/></wsdl:output></wsdl:operation> <wsdl:operation name="checkKommen"><http:operation location="checkKommen"/><wsdl:input><mime:content type="application/xml" part="parameters"/></wsdl:input><wsdl:output><mime:content type="application/xml" part="parameters"/></wsdl:output></wsdl:operation> <wsdl:operation name="buchen"><http:operation location="buchen"/><wsdl:input><mime:content type="application/xml" part="parameters"/></wsdl:input></wsdl:operation> <wsdl:operation name="mitarbeiterSpeichern"><http:operation location="mitarbeiterSpeichern"/><wsdl:input><mime:content type="application/xml" part="parameters"/></wsdl:input></wsdl:operation> </wsdl:binding><wsdl:service name="MyService"><wsdl:port name="MyServiceHttpSoap11Endpoint" binding="ns:MyServiceSoap11Binding"><soap:address location="http://localhost:8080/MitarbeiterServer/services/MyService.MyServiceHttpSoap11Endpoint/"/></wsdl:port><wsdl:port name="MyServiceHttpSoap12Endpoint" binding="ns:MyServiceSoap12Binding"><soap12:address location="http://localhost:8080/MitarbeiterServer/services/MyService.MyServiceHttpSoap12Endpoint/"/></wsdl:port><wsdl:port name="MyServiceHttpEndpoint" binding="ns:MyServiceHttpBinding"><http:address location="http://localhost:8080/MitarbeiterServer/services/MyService.MyServiceHttpEndpoint/"/></wsdl:port></wsdl:service></wsdl:definitions>
...