2016-05-13 119 views
0

我想實現一個Spring Web服務,它接受我們的端點 http://xxx.xx.xx.x:8088/axis2/services/SmsNotificationService上的呼叫notifySmsDeliveryReceipt。通話的內容會像THW如下:將Spring-WS映射到端點,請求xml並輸出xml

<soapenv:Envelope xmlns:soapenv=‘http://schemas.xmlsoap.org/soap/envelope/’ xmlns:v3=‘http://www.csapi.org/schema/parlayx/common/v3_1’ xmlns:loc=‘http://www.csapi.org/schema/parlayx/sms/notification/v3_1/local’> 
    <soapenv:Header> 
    <v3:NotifySOAPHeader> 
     <spId>600002</spId> 
    </v3:NotifySOAPHeader> 
    </soapenv:Header> 
    <soapenv:Body> 
    <loc:notifySmsDeliveryReceipt> 
     <loc:correlator>123</loc:correlator> 
     <loc:deliveryStatus> 
     <address>tel:+86123</address> 
     <deliveryStatus>DeliveredToTerminal</deliveryStatus> 
     </loc:deliveryStatus> 
    </loc:notifySmsDeliveryReceipt> 
    </soapenv:Body> 
</soapenv:Envelope> 

操作notifySmsDeliveryReceipt應返回如下:

我已成立了一個Spring WS項目,並開始與終點。

@Endpoint 
public class SmsNotificationService { 

    public void handleNotifyReceipt() { 

    } 
} 

雖然我並不需要有人誰可以寫代碼對我來說,我會很感激,如果有人能告訴我如何handleNotifyReceipt()應註解,它應該接受什麼樣的參數。我還需要幫助配置該服務以偵聽給定的URL並將操作重定向到handleNotifyReceipt()。如果有人能告訴我如何返回調用者期望的XML,我也會很感激。

在此先感謝。

回答