Я пытаюсь изменить формат ответа, который возвращает мой веб-сервис SOAP. Я хочу что-то вроде этого:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:NotificaAccettazionePraticaEcommerceResponse xmlns:ns="http://www.findomestic.it/FindomesticEcommerceNotification" xmlns:ax21="http://response.webservice.internal.payment_findomestic.adapter.smcc.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:NotificaAccettazionePraticaEcommerceResponse">
<ax21:confermaEsercente>false</ax21:confermaEsercente>
</ns:NotificaAccettazionePraticaEcommerceResponse>
</soapenv:Body>
</soapenv:Envelope>
В настоящее время я получаю ответное сообщение:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:NotificaAccettazionePraticaEcommerceResult xmlns:ns="http://www.findomestic.it/FindomesticEcommerceNotification" xmlns:ax21="http://response.webservice.internal.payment_findomestic.adapter.smcc.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:NotificaAccettazionePraticaEcommerceResponse">
<ax21:confermaEsercente>false</ax21:confermaEsercente>
</ns:NotificaAccettazionePraticaEcommerceResult>
</soapenv:Body>
</soapenv:Envelope>
Проблема здесь в том, что имя элемента NotificaAccettazionePraticaEcommerceResult
должно быть NotificaAccettazionePraticaEcommerceResponse
.
Я попытался удалить параметр doclitBare
из моего services.xml
, и у меня есть этот ответ:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:NotificaAccettazionePraticaEcommerceResponse xmlns:ns="http://www.findomestic.it/FindomesticEcommerceNotification">
<ns:return xmlns:ax21="http://response.webservice.internal.payment_findomestic.adapter.smcc.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:NotificaAccettazionePraticaEcommerceResponse">
<ax21:confermaEsercente>false</ax21:confermaEsercente>
</ns:return>
</ns:NotificaAccettazionePraticaEcommerceResponse>
</soapenv:Body>
</soapenv:Envelope>
проблема в том, что мне не нужен элемент return
.
Я не могу изменить код Java, который создает это тело ответа, но я могу изменить только services.xml
.
Это мой services.xml
:
<serviceGroup>
<service name="FindomesticEcommerceNotification" scope="request">
<schema schemaNamespace="http://www.findomestic.it/FindomesticEcommerceNotification"/>
<Description>Web service called by Findomestic for notifications about payment authorization.</Description>
<parameter name="ServiceClass" locked="false">com.smcc.adapter.payment_findomestic.webservice.FindomesticEcommerceNotificationImpl</parameter>
<parameter name="ServiceObjectSupplier" locked="false">com.intershop.beehive.core.internal.axis2.PipelineServiceObjectSupplier</parameter>
<parameter name="doclitBare">true</parameter>
<operation name="NotificaAccettazionePraticaEcommerce">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
<operation name="ConfermaLiquidazionePraticaEcommerce">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>
</serviceGroup>
Можно ли получить такой ответ, просто изменив файл services.xml
?
Я использую Axis 1.6.2 и не могу обновить его версию.