0

I've used the Wash out gem to create some web services in ruby. So far so good. With savon gem it's no problem to get a response. But I create a BPEL process and want to invoke the web service (it's just BPEL)! The request is no problem, so know I'm in the ruby soap_service and don't know how to response back to the BPEL process!?

    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

The BPEL process is still waiting for a response and didn't get it! I hope anyone can help me :-) ...

and here is my WSDL file:

    <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>

Here is the ERROR I get when the BPEL Process invokes the web service:

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

This is my invoke action in my BPEL process:

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

concatRequest => Message "concat" concatResponse => Message "concat_response"

UPDATE: Here is the BPEL file:

<!-- 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>

This is the response I get back from rails wash out:

<?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>
Fezi32
  • 1
  • 6
  • Hey. Is it an asynchronous web service? – Wanderley Jul 17 '15 at 16:18
  • No, just a synchronous. – Fezi32 Jul 17 '15 at 16:24
  • Hello. First, please try invoking your web sevice using soapUI. Success? – Wanderley Jul 17 '15 at 19:39
  • hey :) I can't use soapUI. It doesn't work on my macbook. Everytime I want to start the programm it does not react (I installed it more then five times). So I can't test the web service with it. Maybe anyone can give me a hint how to solve the problem. But I tested the web service with the savon gem and everthing is fine. I think the problem is that the web service on the ruby server does not send a response to the BPEL server... – Fezi32 Jul 17 '15 at 22:26
  • But I tested the web service with Eclipse Web Service Explorer. And it works, too. The response is okay and works, so I can't understand why it doesn't work by invoke the process. – Fezi32 Jul 22 '15 at 07:43
  • Hello. Did you look Bpel logs? – Wanderley Jul 23 '15 at 13:52
  • Where can I see BPEL logs? – Fezi32 Oct 26 '15 at 07:20

1 Answers1

0

As far as I know, tools like BPEL Engines don't work with RPC encoded SOAP messages. They work only with Document/Literal Wrapped style ones.

Try to use Document Wrapped style of WSDL instead of RPC, which is used by default in wash_out. Document Wrapped style means that you are to use only one complex object parameter for request and for response. I will be a wrapper for all your parameters. To configure "document" WSDL style use this code in soap_service declaration:

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

You can also configure it for the whole application with initializer. Details of wash_out configuration options are here:

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

Update: There is a bug in support of "document" WSDL style and I made a Pull Request which fixes it: https://github.com/inossidabile/wash_out/pull/186 You can use my fork, until it will have merged.

Update: unfortunately, my PR is not enough to make document style to work. We decided to stick with RPC Encoded (not literal) style for our project and not invest into fixing this problem now. The problem is that document style is not the main interest for the author of this gem. So document style was contributed, but have many problems with compatibility with standards.

  • thank you for your answer, but i still get the 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 – Fezi32 Aug 13 '15 at 09:19
  • The problem is that the web service will processed as HTML instead of SOAP!? – Fezi32 Sep 03 '15 at 11:29
  • I updated my answer with bad news. Document style is not supported as a main goal of the author. So it has many problems with compatibility with standards. HTML is not relevant here. It is incompatible SOAP. – Alexander Petrov Sep 04 '15 at 13:06
  • I think Apache ODE supports rpc/literal. So i used it, but it's the same error like above "...SOAP body does not contain expected part wrapper..." – Fezi32 Oct 22 '15 at 12:48
  • But wash_out supports RPC/Encoded best. Authors use only this kind of style. So any other styles may not work without custom hacks. – Alexander Petrov Oct 23 '15 at 15:55
  • I tried to use rpc/encoded for now. But I stil get the same error... :-( – Fezi32 Oct 25 '15 at 22:08
  • I update my post for rpc/encoded style. Maybe you can help me to fix my problem with rpc/encoded – Fezi32 Oct 25 '15 at 22:16