i've used wash out gem create web services in ruby. far good. savon gem it's no problem response. create bpel process , want invoke web service (it's bpel)! request no problem, know i'm in ruby soap_service , don't know how response bpel process!?
soap_action "concat", :args => { :concatrequest => { :a => :string, :b => :string } }, :return => { :concatresponse => { :result => :string } } def concat # want in ruby puts "*******************************************************************" puts "************************ concat *******************************" puts "*******************************************************************" result = params[:concatrequest][:a] + params[:concatrequest][:b] puts "result: " + result puts "*******************************************************************" # , send response bpel process puts render :soap => ( { :concatresponse => {:result => result} } ) end the bpel process still waiting response , didn't it! hope can me :-) ...
and here 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 error when bpel process invokes web service:
error [invoke] failure during invoke: unable process response: soap body 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 process response: soap body not contain expected part wrapper: service {urn:washout}service port contextserver_port wrapper {urn:washout}concatresponse on channel 24 this invoke action in 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 bpel file:
<!-- testprocess bpel process [generated 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 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 bpel process --> <!-- ================================================================= --> <bpel:partnerlinks> <!-- 'client' role represents requester of 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 , xml documents used within bpel process --> <!-- ================================================================= --> <bpel:variables> <!-- reference message passed input during initiation --> <bpel:variable name="input" messagetype="tns:testprocessrequestmessage"/> <!-- reference message returned 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 flow of messages across --> <!-- services integrated within business process --> <!-- ================================================================= --> <bpel:sequence name="main"> <!-- receive input requester. note: maps operation defined in testprocess.wsdl --> <bpel:receive name="receiveinput" partnerlink="client" porttype="tns:testprocess" operation="process" variable="input" createinstance="yes"/> <!-- generate reply 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 response 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>
as far know, tools bpel engines don't work rpc encoded soap messages. work document/literal wrapped style ones.
try use document wrapped style of wsdl instead of rpc, used default in wash_out. document wrapped style means use 1 complex object parameter request , response. wrapper parameters. configure "document" wsdl style use code in soap_service declaration:
soap_service namespace: 'urn:washout', wsdl_style: "document" you can configure whole application initializer. details of wash_out configuration options here:
https://github.com/inossidabile/wash_out#configuration
update: there bug in support of "document" wsdl style , made pull request fixes it: https://github.com/inossidabile/wash_out/pull/186 can use fork, until have merged.
update: unfortunately, pr not enough make document style work. decided stick rpc encoded (not literal) style our project , not invest fixing problem now. problem document style not main interest author of gem. document style contributed, have many problems compatibility standards.
Comments
Post a Comment