Нет ответа при вызове веб-службы в рубине через процесс BPEL

Я использовал стимулятор Wash out для создания некоторых веб-сервисов на ruby. Все идет нормально. С savon gem получить ответ не проблема. Но я создаю процесс BPEL и хочу вызвать веб-службу (это просто BPEL)! Запрос не проблема, так что знайте, что я нахожусь в ruby ​​soap_service и не знаю, как ответить на процесс BPEL!?

    soap_action "concat",
    :args   => { :concatRequest => { :a => :string, :b => :string } },
    :return => { :concatResponse => { :result => :string } }

  def concat
    # something I want to do in ruby
    puts "*******************************************************************"
    puts "************************   CONCAT   *******************************"
    puts "*******************************************************************"
    result = params[:concatRequest][:a] + params[:concatRequest][:b]
    puts "RESULT: " + result
    puts "*******************************************************************"
    # and then send response to BPEL process
    puts render :soap => ( { :concatResponse => {:result => result} } )
  end

Процесс BPEL все еще ожидает ответа и не получил его! Я надеюсь, что кто-нибудь может мне помочь :-) ...

и вот мой файл WSDL:

    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:WashOut" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="contextserver" targetNamespace="urn:WashOut">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:WashOut">
<xsd:complexType name="concatRequest">
<xsd:sequence>
<xsd:element name="a" type="xsd:string"/>
<xsd:element name="b" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="concatResponse">
<xsd:sequence>
<xsd:element name="result" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</schema>
</types>
<portType name="contextserver_port">
<operation name="concat">
<input message="tns:concat"/>
<output message="tns:concat_response"/>
</operation>
<operation name="special">
<input message="tns:special"/>
<output message="tns:special_response"/>
</operation>
</portType>
<binding name="contextserver_binding" type="tns:contextserver_port">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="concat">
<soap:operation soapAction="concat"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</output>
</operation>
<operation name="special">
<soap:operation soapAction="special"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
</output>
</operation>
</binding>
<service name="service">
<port name="contextserver_port" binding="tns:contextserver_binding">
<soap:address location="http://localhost:3000/contextserver/action"/>
</port>
</service>
<message name="concat">
<part name="concatRequest" type="tns:concatRequest"/>
</message>
<message name="concat_response">
<part name="concatResponse" type="tns:concatResponse"/>
</message>
<message name="special">
<part name="b" type="xsd:string"/>
</message>
<message name="special_response">
<part name="value" type="xsd:string"/>
</message>
</definitions>

Вот ОШИБКА, которую я получаю, когда процесс BPEL вызывает веб-службу:

ERROR [INVOKE] Failure during invoke: Unable to process response: SOAP body does not contain expected part wrapper: service {urn:WashOut}service port contextserver_port wrapper {urn:WashOut}concatResponse
INFO  [BpelRuntimeContextImpl] ActivityRecovery: Registering activity 13, failure reason: Unable to process response: SOAP body does not contain expected part wrapper: service {urn:WashOut}service port contextserver_port wrapper {urn:WashOut}concatResponse on channel 24

Это мое действие вызова в моем процессе BPEL:

<bpel:invoke name="Invoke" partnerLink="contextserver" operation="concat" portType="ns1:contextserver_port" inputVariable="concatRequest" outputVariable="concatResponse"></bpel:invoke>

concatRequest => Сообщение "concat" concatResponse => Сообщение "concat_response"

ОБНОВЛЕНИЕ: Вот файл BPEL:

<!-- TestProcess BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Tue Jul 14 17:53:39 CEST 2015 -->
<bpel:process name="TestProcess"
         targetNamespace="http://localhost:8080/test"
         suppressJoinFailure="yes"
         xmlns:tns="http://localhost:8080/test"
         xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
         xmlns:ns1="urn:WashOut">

    <!-- Import the client WSDL -->
    <bpel:import namespace="urn:WashOut" location="concat.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
    <bpel:import namespace="urn:WashOut" location="file:/Users/jordan/development/workflow/app/services/concat.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
    <bpel:import location="TestProcessArtifacts.wsdl" namespace="http://localhost:8080/test" importType="http://schemas.xmlsoap.org/wsdl/" />

    <!-- ================================================================= -->         
    <!-- PARTNERLINKS                                                      -->
    <!-- List of services participating in this BPEL process               -->
    <!-- ================================================================= -->         
    <bpel:partnerLinks>
        <!-- The 'client' role represents the requester of this service. -->
        <bpel:partnerLink name="client"
                     partnerLinkType="tns:TestProcess"
                     myRole="TestProcessProvider"
                     />


        <bpel:partnerLink name="contextserver" partnerLinkType="tns:ContextserverPLT" partnerRole="Concat"></bpel:partnerLink>
    </bpel:partnerLinks>

    <!-- ================================================================= -->         
    <!-- VARIABLES                                                         -->
    <!-- List of messages and XML documents used within this BPEL process  -->
    <!-- ================================================================= -->         
    <bpel:variables>
        <!-- Reference to the message passed as input during initiation -->
        <bpel:variable name="input"
                  messageType="tns:TestProcessRequestMessage"/>

        <!-- 
          Reference to the message that will be returned to the requester
          -->
        <bpel:variable name="output"
                  messageType="tns:TestProcessResponseMessage"/>
        <bpel:variable name="concatRequest" messageType="ns1:concat">
        </bpel:variable>
        <bpel:variable name="concatResponse" messageType="ns1:concat_response">
        </bpel:variable>
    </bpel:variables>

    <!-- ================================================================= -->         
    <!-- ORCHESTRATION LOGIC                                               -->
    <!-- Set of activities coordinating the flow of messages across the    -->
    <!-- services integrated within this business process                  -->
    <!-- ================================================================= -->         
    <bpel:sequence name="main">

        <!-- Receive input from requester. 
             Note: This maps to operation defined in TestProcess.wsdl 
             -->
        <bpel:receive name="receiveInput" partnerLink="client"
                 portType="tns:TestProcess"
                 operation="process" variable="input"
                 createInstance="yes"/>

        <!-- Generate reply to synchronous request -->
        <bpel:assign validate="no" name="Assign">
            <bpel:copy ignoreMissingFromData="no" keepSrcElementName="no">
            <bpel:from>
                <bpel:literal xml:space="preserve"><tns:concatRequest xmlns:tns="urn:WashOut" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <tns:a>go</tns:a>
                    <tns:b>go</tns:b>
                    </tns:concatRequest>
                </bpel:literal>
            </bpel:from>
            <bpel:to part="concatRequest" variable="concatRequest"></bpel:to>
            </bpel:copy>
        </bpel:assign>
        <bpel:invoke name="Invoke" partnerLink="contextserver" operation="concat" portType="ns1:contextserver_port" inputVariable="concatRequest" outputVariable="concatResponse"></bpel:invoke>
        <bpel:assign validate="no" name="Assign1">
            <bpel:copy>
                <bpel:from>
                    <bpel:literal xml:space="preserve"><tns:concatResponse xmlns:tns="urn:WashOut" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <tns:result>WORKS</tns:result>
                        </tns:concatResponse>
                    </bpel:literal>
                </bpel:from>
                <bpel:to part="payload" variable="output"></bpel:to>
            </bpel:copy>
        </bpel:assign>
        <bpel:reply name="replyOutput" partnerLink="client" portType="tns:TestProcess" operation="process" variable="output" />
    </bpel:sequence>
</bpel:process>

Это ответ, который я получаю от вымывания рельсов:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:WashOut">
  <soap:Body>
    <tns:concat_response>
      <concatResponse xsi:type="tns:concatResponse">
        <result xsi:type="xsd:string">gogo</result>
      </concatResponse>
    </tns:concat_response>
  </soap:Body>
</soap:Envelope>

person Fezi32    schedule 17.07.2015    source источник
comment
Привет. Это асинхронный веб-сервис?   -  person Wanderley    schedule 17.07.2015
comment
Нет, только синхрон.   -  person Fezi32    schedule 17.07.2015
comment
Привет. Во-первых, попробуйте вызвать веб-сервис с помощью soapUI. Успех?   -  person Wanderley    schedule 17.07.2015
comment
эй :) Я не могу использовать soapUI. На моем макбуке не работает. Каждый раз, когда я хочу запустить программу, она не реагирует (я устанавливал ее более пяти раз). Поэтому я не могу протестировать веб-сервис с ним. Может кто подскажет как решить проблему. Но я протестировал веб-сервис с драгоценным камнем savon, и все в порядке. Я думаю, проблема в том, что веб-служба на рубиновом сервере не отправляет ответ на сервер BPEL...   -  person Fezi32    schedule 18.07.2015
comment
Но я протестировал веб-сервис с помощью Eclipse Web Service Explorer. И это тоже работает. Ответ в порядке и работает, поэтому я не могу понять, почему он не работает, вызывая процесс.   -  person Fezi32    schedule 22.07.2015
comment
Привет. Вы смотрели журналы Bpel?   -  person Wanderley    schedule 23.07.2015
comment
Где можно просмотреть журналы BPEL?   -  person Fezi32    schedule 26.10.2015


Ответы (1)


Насколько мне известно, такие инструменты, как BPEL Engines, не работают с сообщениями SOAP, закодированными RPC. Они работают только со стилями Document/Literal Wrapped.

Попробуйте использовать стиль Document Wrapped WSDL вместо RPC, который по умолчанию используется в Wash_out. Стиль Document Wrapped означает, что вы должны использовать только один параметр сложного объекта для запроса и для ответа. Я буду оберткой для всех ваших параметров. Чтобы настроить стиль WSDL «документ», используйте этот код в объявлении soap_service:

soap_service namespace: 'urn:WashOut', wsdl_style: "document"

Вы также можете настроить его для всего приложения с помощью инициализатора. Подробная информация о параметрах конфигурации Wash_out находится здесь:

https://github.com/inossidabile/wash_out#configuration

Обновление: есть ошибка в поддержке "документного" стиля WSDL, и я сделал запрос на извлечение, который исправляет ее: https://github.com/inossidabile/wash_out/pull/186 Вы можете использовать мой форк, пока он не слился.

Обновление: к сожалению, моего PR недостаточно, чтобы стиль документа работал. Мы решили придерживаться стиля RPC Encoded (не буквальный) для нашего проекта и не вкладывать средства в исправление этой проблемы сейчас. Проблема в том, что стиль документа не является основным интересом для автора этой жемчужины. Таким образом, стиль документа был внесен, но у него много проблем с совместимостью со стандартами.

person Alexander Petrov    schedule 04.08.2015
comment
спасибо за ваш ответ, но я все еще получаю ОШИБКУ: [INVOKE] Ошибка во время вызова: невозможно обработать ответ: тело SOAP не содержит ожидаемую оболочку части: сервис {urn:WashOut}service port contextserver_port wrapper {urn:WashOut}concatResponse - person Fezi32; 13.08.2015
comment
Проблема в том, что веб-сервис будет обрабатываться как HTML, а не как SOAP!? - person Fezi32; 03.09.2015
comment
Я обновил свой ответ плохими новостями. Стиль документа не поддерживается как основная цель автора. Так что у него много проблем с совместимостью со стандартами. HTML здесь не при чем. Это несовместимое SOAP. - person Alexander Petrov; 04.09.2015
comment
Я думаю, что Apache ODE поддерживает rpc/literal. Итак, я использовал его, но это та же ошибка, что и выше... Тело SOAP не содержит ожидаемой оболочки части... - person Fezi32; 22.10.2015
comment
Но Wash_out лучше всего поддерживает RPC/Encoded. Авторы используют только такой стиль. Поэтому любые другие стили могут не работать без специальных хаков. - person Alexander Petrov; 23.10.2015
comment
Я пытался использовать rpc/encoded на данный момент. Но я все равно получаю ту же ошибку... :-( - person Fezi32; 26.10.2015
comment
Я обновляю свой пост для стиля rpc/encoded. Может быть, вы можете помочь мне решить мою проблему с rpc/encoded - person Fezi32; 26.10.2015