我正在尝试更改SOAP Web服务返回的响应的格式。我想要的是这样的:
<?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,并且无法升级其版本。