1

I'm trying to develop with wso2 bps a bpel sequence which calls a jax-ws web asynchronous web service. wso2 seems to receive the callback from the service, but it is unable to link it with the original request, which at the end receives a fault (timeout) response from the framework. For my understanding the corelation had to be established through ws-addressing headers; I find some examples about how to do it with a correlation set, but all of them link an Id in the request with another in the response, but this is not my case as I have no 'Id' like fields in the request and response message.

It would be helpful for me if someone who dealt with a problem like this could send me some sample code

The jax-ws web service is generated with wsimport from the wsdl, but the wsdl got while querying the ?wsdl url from the runtime environment is different. Here is the wsdl processed with wsimport:

<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
     name="processing"
     targetNamespace="http://processing.biosos.eu/"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:tns="http://processing.biosos.eu/"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
     xmlns:wsaw="http://www.w3.org/2006/03/addressing/ws-addr.xsd" 
     xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
     <plnk:partnerLinkType name="ProcessorLinkType">
        <plnk:role name="ProcessingRequestor">
            <plnk:portType name="tns:ProcessorPortType"/>
        </plnk:role>
        <plnk:role name="ProcessingReponse">
            <plnk:portType name="tns:ProcessorResponsePortType"/>
        </plnk:role>
    </plnk:partnerLinkType>
    <wsdl:types>
<!--    <xsd:schema>
            <xsd:import namespace="http://processing.biosos.eu" schemaLocation="processor.xsd"/>
    </xsd:schema> -->
         <xs:schema version="1.0" targetNamespace="http://processing.biosos.eu/" xmlns:tns="http://processing.biosos.eu/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:element name="ProcessingException" nillable="true" type="xs:string"/>
            <xs:element name="describeMetaDataIn" nillable="true" type="tns:metaDataSet"/>
            <xs:element name="describeMetaDataOut" nillable="true" type="tns:metaDataSet"/> 
            <xs:element name="executeMetaDataIn" nillable="true" type="tns:metaDataSet"/>
            <xs:element name="executeMetaDataOut" nillable="true" type="tns:metaDataSet"/>
            <xs:element name="executeAsyncMetaDataIn" nillable="true" type="tns:metaDataSet"/>
            <xs:element name="executeAsyncMetaDataInCallback" nillable="true" type="tns:metaDataSet"/>
            <xs:element name="describeasyncMetaDataIn" nillable="true" type="tns:metaDataSet"/> 
            <xs:element name="metaDataSet" type="tns:metaDataSet"/>
            <xs:complexType name="metaDataSet">
                <xs:sequence>
                    <xs:element name="metaData" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>     
    </wsdl:types>
    <wsdl:message name="WSAReplyToHeader">
        <wsdl:part name="ReplyTo" element="wsaw:ReplyTo"/>
    </wsdl:message>
    <wsdl:message name="WSARelatesToHeader">
        <wsdl:part name="RelatesTo" element="wsaw:RelatesTo"/>
    </wsdl:message>
    <wsdl:message name="executeProcessingAsyncCallbackInput">
        <wsdl:part name="executeAsyncMetaDataInCallback" element="tns:executeMetaDataIn"/>
    </wsdl:message>
    <wsdl:message name="executeProcessingAsyncInput">
        <wsdl:part name="executeAsyncMetaDataIn" element="tns:metaDataSet"/>
    </wsdl:message>
    <wsdl:portType name="executeProcessingRequest">
        <wsdl:operation name="executeProcessingAsync">
            <wsdl:input message="tns:executeProcessingAsyncInput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
                 ns1:Action=""/>
        </wsdl:operation>
    </wsdl:portType>
     <wsdl:portType name="executeProcessingResponse">
        <wsdl:operation name="executeProcessingAsyncCallback">
            <wsdl:input message="tns:executeProcessingAsyncCallbackInput" xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl"
                 ns1:Action=""/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="executeProcessingSoapHttp" type="tns:executeProcessingRequest">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
         <wsdl:operation name="executeProcessingAsync">
            <soap:operation soapAction="http://processing.biosos.eu/executeProcessing/executeProcessingRequest"/>
            <wsdl:input>
                <soap:header message="tns:WSAReplyToHeader"
                part="ReplyTo" use="literal" encodingStyle=""/>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>    
    <wsdl:binding name="executeProcessingResponseSoapHttp" type="tns:executeProcessingResponse">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="executeProcessingAsyncCallback">
            <soap:operation soapAction="http://processing.biosos.eu/executeProcessing/executeProcessingResponse"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="executeProcessingAsyncService">
        <wsdl:port name="executeProcessingPort" binding="tns:executeProcessingSoapHttp">
            <soap:address location="http://localhost:8088/processor/processor"/>
        </wsdl:port>
        <wsdl:port name="executeProcessingCallbackPort" binding="tns:executeProcessingResponseSoapHttp">
            <soap:address location="http://localhost:8088/processor/processorcallback"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

In particular it modifyes the original xsd from

<xs:element name="executeMetaDataIn" nillable="true" type="tns:metaDataSet"/>
    <xs:complexType name="metaDataSet">
        <xs:sequence>
            <xs:element name="metaData" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

to:

<xs:element name="executeProcessingAsync" type="tns:executeProcessingAsync"/>
            <xs:complexType name="executeProcessingAsync">
                <xs:sequence>
                    <xs:element name="arg0" type="tns:metaDataSet" minOccurs="0"/>
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="metaDataSet">
                <xs:sequence>
                    <xs:element name="metaData" type="xs:string" nillable="true" minOccurs="0"
                        maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>

So a apparently useless arg0 is introduced; I imported then the revised xsd schema inside the bpel project, otherwise wso2 is unable to call the service. maybe that is the origin of the problem?

here is the network flow I snooped:

from my browser to wso2 bps:

POST http://xxx.xxx.xx.xxx:9763/services/BPS.BPShttpBPSPortBindingEndpoint/ HTTP/1.1
Host: xxx.xxx.xx.xxx:9763
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
SOAPAction: "http://bps.biosos.eu/executeProcessing"
Content-Type: text/xml; charset=UTF-8
Referer: http://xxx.xxx.xx.xxx:9763/services/BPS?tryit
Content-Length: 690
Cookie: menuPanel=visible; menuPanelType=main; JSESSIONID=A1D548B8FE2D9CCA6F773CC48BBBCC4D; Modernizr=; current-breadcrumb=manage_menu%2Cbpel_menu%2Cprocesses_menu%23bpel+package_dashboard.jsp*bpel+process_info.jsp*; MSG13706026625390.7186655491334077=true; requestedURI="../../carbon/tracer/index.jsp?region=region4&item=tracer_menu"; MSG13706055948330.5890288764438495=true; MSG13706058104120.31469188642996127=true
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<s:Header><wsa:To>http://xxx.xxx.xx.xxx:9763/services/BPS.BPShttpBPSPortBindingEndpoint/</wsa:To>
<wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo>
<wsa:MessageID>http://identifiers.wso2.com/messageid/1370605864890/8335139899</wsa:MessageID>
<wsa:Action>http://bps.biosos.eu/executeProcessing</wsa:Action>
</s:Header>
<s:Body><p:executeMetaDataIn xmlns:p="http://bps.biosos.eu"><!--0 or more occurrences--><metaDataList>fdsdfd</metaDataList></p:executeMetaDataIn></s:Body>
</s:Envelope>

from wso2 to external jax-ws service

POST /processor/processor?wsdl HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://processing.biosos.eu/executeProcessing/executeProcessingRequest"
User-Agent: WSO2 Business Process Server-3.0.0
Host: xxx.xxx.xx.yyy:8080
Transfer-Encoding: chunked

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:ReplyTo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Address>http://xxx.xxx.xx.xxx:9763/services/processorcallback</Address>
</wsa:ReplyTo><wsa:To>http://toyota.planetek.it:8080/processor/processor?wsdl</wsa:To><wsa:MessageID>urn:uuid:c3942e49-004a-4cd7-86fb-866742c2c4b1</wsa:MessageID><wsa:Action>http://processing.biosos.eu/executeProcessing/executeProcessingRequest</wsa:Action></soapenv:Header><soapenv:Body><executeProcessingAsync xmlns="http://processing.biosos.eu/">
                        <arg0 xmlns="">
                         <metaData>lhhlh</metaData>
                         </arg0>
                        </executeProcessingAsync></soapenv:Body></soapenv:Envelope>

with response HTTP/1.1 202 Accepted

callback from jax-ws service to wso2 server:

POST /services/processorcallback HTTP/1.1
Accept: text/xml, multipart/related
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://processing.biosos.eu/executeProcessing/executeProcessingRequest"
User-Agent: JAX-WS RI 2.2.5-b01
Cache-Control: no-cache
Pragma: no-cache
Host: xxx.xxx.xx.yyy:9763
Connection: keep-alive
Content-Length: 257

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header>
  <RelatesTo xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:c3942e49-004a-4cd7-86fb-866742c2c4b1</RelatesTo>
  <To xmlns="http://www.w3.org/2005/08/addressing">http://xxx.xxx.xx.yyy:9763/services/processorcallback</To>
  <Action xmlns="http://www.w3.org/2005/08/addressing">http://processing.biosos.eu/executeProcessing/executeProcessingResponse</Action>

metadata_out.xml

with response HTTP/1.1 202 Accepted

this is the bpel file:

<bpel:process name="BiososProcessing"
         targetNamespace="http://pk/bps/processing"
         suppressJoinFailure="yes"
         xmlns:tns="http://pk/bps/processing"
         xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
    <!-- Import the client WSDL -->
     <bpel:import namespace="http://enterprise.netbeans.org/bpel/BPSWrapper" location="BPSWrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <bpel:import namespace="http://bps.biosos.eu" location="BPS.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <bpel:import namespace="http://enterprise.netbeans.org/bpel/Asyn_ProcessorWrapper" location="Asyn_ProcessorWrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <bpel:import namespace="http://processing.biosos.eu/" location="Asyn_Processor.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <!-- ================================================================= -->         
    <!-- PARTNERLINKS                                                      -->
    <!-- List of services participating in this BPEL process               -->
    <!-- ================================================================= -->         
    <bpel:partnerLinks>
         <bpel:partnerLink name="ProcPartnerLink" xmlns:tns="http://enterprise.netbeans.org/bpel/Asyn_ProcessorWrapper" partnerLinkType="tns:ExecuteProcessingLinkType" myRole="ExecuteProcessingReplyRole" partnerRole="ExecuteProcessingReceiverRole"/>
        <bpel:partnerLink name="BPSPartnerLink" xmlns:tns="http://enterprise.netbeans.org/bpel/BPSWrapper" partnerLinkType="tns:IBPSServiceLinkType" myRole="IBPSServiceRole"/>   
    </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="BPSExecuteProcessingOut" xmlns:bps="http://bps.biosos.eu" messageType="bps:executeProcessingResponse"/>
         <bpel:variable name="ProcExecuteProcessingAsyncCallbackIn" xmlns:tns="http://processing.biosos.eu/" messageType="tns:executeProcessingAsyncCallback"/>
         <bpel:variable name="ProcExecuteProcessingAsyncIn" xmlns:tns="http://processing.biosos.eu/" messageType="tns:executeProcessingAsync"/>
         <bpel:variable name="ServiceInvokerIARequest" xmlns:tns="http://processing.biosos.eu/" messageType="tns:executeProcessingAsync"/>
         <bpel:variable name="BPSExecuteProcessingIn" xmlns:bps="http://bps.biosos.eu" messageType="bps:executeProcessing"/>   
    </bpel:variables>


    <!-- ================================================================= -->         
    <!-- ORCHESTRATION LOGIC                                               -->
    <!-- Set of activities coordinating the flow of messages across the    -->
    <!-- services integrated within this business process                  -->
    <!-- ================================================================= -->         

    <bpel:sequence name="main">
            <bpel:receive name="BPSReceive_executeProcessing" createInstance="yes" partnerLink="BPSPartnerLink" operation="executeProcessing" xmlns:bps="http://bps.biosos.eu" portType="bps:IBPSService" variable="BPSExecuteProcessingIn">
                <correlations>
                    <correlation set="correlator" initiate="yes"></correlation>
                </correlations>
            </bpel:receive>
        <bpel:assign name="Assign1">
            <bpel:copy>
                <bpel:from>
                    <bpel:literal>
                        <tns:executeProcessingAsync xmlns:tns="http://processing.biosos.eu/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><arg0>
    <metaData>metaData</metaData>
  </arg0>

                        </tns:executeProcessingAsync>
                    </bpel:literal>
                </bpel:from>
                <bpel:to variable="ProcExecuteProcessingAsyncIn" part="parameters"></bpel:to>
            </bpel:copy>
            <bpel:copy>
              <bpel:from>
               <bpel:literal xml:space="preserve"><wsa:ReplyTo xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                   <Address>http://avatar.planetek.it:9763/services/processorcallback</Address>

                 </wsa:ReplyTo></bpel:literal>
             </bpel:from>
             <bpel:to header="ReplyTo" variable="ProcExecuteProcessingAsyncIn">
             </bpel:to>
            </bpel:copy>
            <bpel:copy>
                <bpel:from part="executeMetaDataIn" variable="BPSExecuteProcessingIn">
                    <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
                        <![CDATA[metaDataList[1]]]>
                    </bpel:query>
                </bpel:from>
                <bpel:to part="parameters" variable="ProcExecuteProcessingAsyncIn">
                    <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
                        <![CDATA[arg0/metaData[1]]]>
                    </bpel:query>
                </bpel:to>
            </bpel:copy>
        </bpel:assign> 
                <bpel:invoke name="InvokeProcessor_executeProcessing" 
                partnerLink="ProcPartnerLink" 
                operation="executeProcessingAsync" 
                xmlns:tns="http://processing.biosos.eu/" 
                portType="tns:ExecuteProcessing" 
                inputVariable="ProcExecuteProcessingAsyncIn">       
                </bpel:invoke>
                <bpel:receive name="ProcReceive_executeprocessing" 
                  createInstance="no" 
                  partnerLink="ProcPartnerLink"
                  operation="executeProcessingAsyncCallback" 
                  xmlns:tns="http://processing.biosos.eu/"
                  portType="tns:ExecuteProcessingCallback" 
                  variable="ProcExecuteProcessingAsyncCallbackIn">
                  <correlations>
                    <correlation set="correlator" initiate="no"></correlation>
                  </correlations>           
                </bpel:receive>
        <bpel:assign name="Assign2">
            <bpel:copy>
                <bpel:from>
                    <bpel:literal>
                        <bps:executeMetaDataOut xmlns:bps="http://bps.biosos.eu" 
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <metaDataList>metaDataList</metaDataList>
                        </bps:executeMetaDataOut>
                    </bpel:literal>
                </bpel:from>
                <bpel:to variable="BPSExecuteProcessingOut" part="executeMetaDataOut"></bpel:to>
            </bpel:copy>
             <bpel:copy>
                <bpel:from part="parameters" variable="ProcExecuteProcessingAsyncCallbackIn">
                    <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[arg0/metaData[1]]]></bpel:query>
                </bpel:from>
                <bpel:to part="executeMetaDataOut" variable="BPSExecuteProcessingOut">
                    <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[metaDataList[1]]]></bpel:query>
                </bpel:to>
            </bpel:copy>       
        </bpel:assign>
        <bpel:reply name="BPSReply_executeProcessing" partnerLink="BPSPartnerLink" operation="executeProcessing" xmlns:bps="http://bps.biosos.eu" portType="bps:IBPSService" variable="BPSExecuteProcessingOut"/>
    </bpel:sequence>
</bpel:process>
mede
  • 81
  • 6

0 Answers0