簡體   English   中英

Symfony FOSRestBundle主體偵聽器與SOAP WebService沖突

[英]Symfony FOSRestBundle body listener conflict with SOAP WebService

我使用SOAP Web服務(帶有PHP SoapServer類)開發了一個Symfony2應用程序,用於接收第三個應用程序的數據,現在我正在使用FOSRestBundle開發用於用戶界面的API。 問題是,對於我為REST捆綁包設置的配置,我的SOAP WebService無法正常工作並引發以下錯誤:

第71行的“ FOS \\ RestBundle \\ EventListener \\ BodyListener”接收到“無效的xml消息(400 Bad Request)”。

這是我的FOSRestBundle配置:

fos_rest:
    param_fetcher_listener: true
    body_listener: true
    format_listener: true
    view:
        view_response_listener: 'force'
        formats:
            xml: true
            json : true
        templating_formats:
            html: true
        force_redirects:
            html: true
        failed_validation: HTTP_BAD_REQUEST
        default_engine: twig
    routing_loader:
        default_format: json
    serializer:
        serialize_null: true

如果將body_listener設置為false,則SOAP WebService可以正常工作,但是對於我的RESTful API PUT請求,我需要將其設置為true。 我嘗試了不同的配置組合,但無法解決問題。

在此先感謝您的幫助。

bodylistener中的以下行不返回數組,這就是它失敗的原因:

$data = $decoder->decode($content, $format);

您請求的標頭無效或您發送的內容格式不正確。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM