[jboss-user] [JBoss jBPM] - Re: Request didn't include a SOAP Message

bertrand.njiipwo do-not-reply at jboss.com
Fri Dec 15 07:46:26 EST 2006


Hello Alex, 

first thanks for your reply and i'll like to give some background informations hier to let you understand what i'm trying to do.

I wan jbpm invoke an already running service under: http://localhost:8080/axis/services/schufaServiceB?wsdl. But this service is not to access directly because its one service under the cathegory schufa and the cathegory has the URL http://localhost:8081/creditprocess/schufa. Hier i have an inderection over an monitoring component which receive the HTTP-Request (with the SOAPMessage) and invoke the "best" service at the request time. This means the name of the specific service is unknow but the general name of the service cathegory is know as the category name. At the oder side all services under that cathegory have the same interface-description (porttype, operation, parameter and parameter oder)

The cathegory is like an UDDI-registry. I have the specification of the services belowing to that cathegory unter the URL: http://localhost:8080/portal/demo/schufa.wsdl. 

In the application descriptor bpel-application.xml i need to specify the contextURL and the wsdl location to point at the interface description of the partner service to let the jbpm module retrieves the interface informations before creating and sending the message to the service:   (like defined in partner/schufa/web.xml and partner/schufa/webservices.xml).  

So hier is my problem; The deployed service partner have his endpoint under: http://localhost:8080/schufa/schufaWS. I don't really need this URL as service endpoint. The client requests (bpel-process, service client) have to be redirected to a running service via the monitoring component at the adress: http://localhost.8081/creditprocess/schufa. This will be my service endpoint.  The monitoring component will pick up one running service at: http://localhost:8080/axis/services/schufaWSB and send the receive Request (SOAP Request) to that service.

I'll like to achieve that the SOAPMessage send by the process before the Schufa WS is called is included in this HTTP-Request before it is send. I'll need to specify this address: http://localhost.8081/creditprocess/schufa as soap addresse in jbpm-bpel so that  the running process sends the soap request to this address. How can i achieve this goal using jbpm?

My files:

loanapproval.wsdl
<?xml version="1.0" encoding="UTF-8"?>
  | <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:samples:loanapproval" xmlns:loanapproval="urn:samples:loanapproval" 
  | xmlns:schufa="urn:samples:schufa" xmlns:types="urn:samples:loanapprovalTypes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  | xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" 
  | targetNamespace="urn:samples:loanapproval">
  | 	<import namespace="urn:samples:schufa" location="interface/schufa.wsdl"/>
  | 	<types/
  | 		<schema targetNamespace="urn:samples:loanapprovalTypes" xmlns="http://www.w3.org/2001/XMLSchema">
  | 			<element name="loanProcessFault" type="types:loanProcessFaultType"/>
  | 			<complexType name="loanApplicationType">
  | 				<sequence>
  | 					<element name="firstName" type="string"/>
  | 					<element name="lastName" type="string"/>
  | 					<element name="amount" type="float"/>
  | 				</sequence>
  | 			</complexType>
  | 			<complexType name="approvalDecisionType">
  | 				<sequence>
  | 					<!--element name="approved" type="boolean"/-->
  | 					<element name="approved" type="string"/>
  | 				</sequence>
  | 			</complexType>
  | 			<complexType name="loanProcessFaultType">
  | 				<sequence>
  | 					<element name="ErrorCode" type="int"/>
  | 					<element name="ErrorMessage" type="string"/>
  | 				</sequence>
  | 			</complexType>
  | 		</schema>
  | 	</types>
  | 	<message name="applyRequest">
  | 		<part name="loanRequestParameters" type="types:loanApplicationType"/>
  | 	</message>
  | 	<message name="applyResponse">
  | 		<part name="loanResponse" type="types:approvalDecisionType"/>
  | 	</message>
  | 	<message name="applyLoanProcessFault">
  | 		<part name="loanFault" element="types:loanProcessFault"/>
  | 	</message>
  | 	<portType name="LoanProcessPortType">
  | 		<operation name="apply">
  | 			<input message="tns:applyRequest"/>
  | 			<output message="tns:applyResponse"/>
  | 			<fault name="LoanProcessFault" message="tns:applyLoanProcessFault"/>
  | 		</operation>
  | 	</portType>
  | 	<plt:partnerLinkType name="LoanProcessingPLT">
  | 		<plt:role name="lender">
  | 			<plt:portType name="tns:LoanProcessPortType"/>
  | 		</plt:role>
  | 	</plt:partnerLinkType>
  | 	<plt:partnerLinkType name="SchufaPLT">
  | 		<plt:role name="schufa">
  | 			<plt:portType name="schufa:SchufaWS"/>
  | 		</plt:role>
  | 	</plt:partnerLinkType>
  | </definitions>
  | 

loanapproval.bpel
<?xml version="1.0" encoding="UTF-8"?>
  | <process name="loanapproval" suppressJoinFailure="yes" targetNamespace="urn:samples:loanapproval" 
  | xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:tns="urn:samples:loanapproval" 
  | xmlns:loanapproval="urn:samples:loanapproval" xmlns:schufa="urn:samples:schufa"
  |  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2003/03/business-process/
  |                     http://schemas.xmlsoap.org/ws/2003/03/business-process/">
  | 	<partnerLinks>
  | 		<partnerLink name="LoanProcessing" partnerLinkType="loanapproval:LoanProcessingPLT" myRole="lender"/>
  | 		<partnerLink name="SchufaLink" partnerLinkType="tns:SchufaPLT" partnerRole="schufa"/>
  | 	</partnerLinks>
  | 	<variables>
  | 		<variable name="applyProcessRequest" messageType="loanapproval:applyRequest"/>
  | 		<variable name="applyProcessResponse" messageType="loanapproval:applyResponse"/>
  | 		<variable name="schufaRequest" messageType="schufa:validCustomerRequest"/>
  | 		<variable name="schufaResponse" messageType="schufa:validCustomerResponse"/>
  | 	</variables>
  | 	<sequence>
  | 		<receive createInstance="yes" name="LoanApplication" operation="apply" partnerLink="LoanProcessing" 
  | 						portType="loanapproval:LoanProcessPortType" variable="applyProcessRequest"/>
  | 		<assign name="AssignLoanInfo_forApproval">
  | 			<copy>
  | 				<from variable="applyProcessRequest"  query="/loanRequestParameters/lastName" part="loanRequestParameters"/>
  | 				<to variable="schufaRequest" part="_surname"/>
  | 			</copy>
  | 			<copy>
  | 				<from variable="applyProcessRequest"  query="/loanRequestParameters/firstName" part="loanRequestParameters"/>
  | 				<to variable="schufaRequest" part="_firstname"/>
  | 			</copy>
  | 		</assign>
  | 		<invoke inputVariable="schufaRequest" name="SchufaCheck" operation="validCustomer" outputVariable="schufaResponse"
  | 					 partnerLink="SchufaLink" portType="schufa:SchufaWS"/>
  | 		<assign name="AssignSchufaDecision">
  | 			<copy>
  | 				<from variable="schufaResponse" part="validCustomerReturn"/>
  | 				<to variable="applyProcessResponse"  query="/loanResponse/approved" part="loanResponse"/>
  | 			</copy>
  | 		</assign>
  | 		<reply name="ApprovalDecision" operation="apply" partnerLink="LoanProcessing" portType="loanapproval:LoanProcessPortType" 
  | 		variable="applyProcessResponse"/>
  | 	</sequence>
  | </process>
  | 

schufa.wsdl
<?xml version="1.0" encoding="UTF-8"?>
  | <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:samples:schufa" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="urn:samples:schufa" 
  | xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/">
  | 	<message name="validCustomerRequest">
  | 		<part name="_surname" type="xsd:string"/>
  | 		<part name="_firstname" type="xsd:string"/>
  | 	</message>
  | 	<message name="validCustomerResponse">
  | 		<part name="validCustomerReturn" type="xsd:string"/>
  | 	</message>
  | 	<portType name="SchufaWS">
  | 		<operation name="validCustomer" parameterOrder="_surname _firstname">
  | 			<input name="validCustomerRequest" message="tns:validCustomerRequest"/>
  | 			<output name="validCustomerResponse" message="tns:validCustomerResponse"/>
  | 		</operation>
  | 	</portType>
  | </definitions>
  | 

web.xml
<?xml version="1.0" encoding="UTF-8"?>
  | <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
  |                       http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  |   <servlet>
  | 	<servlet-name>LoanProcessingServlet</servlet-name>
  |     <servlet-class>org.jbpm.bpel.tutorial.loanapproval.LoanProcessPortType_Impl</servlet-class>
  |   </servlet>
  |  <servlet>
  |     <servlet-name>relationServlet</servlet-name>
  |     <servlet-class>org.jbpm.bpel.relation.jms.RelationServlet</servlet-class>
  |     <load-on-startup>1</load-on-startup>
  |   </servlet>
  |   <servlet-mapping>
  |     <servlet-name>LoanProcessingServlet</servlet-name>
  |     <url-pattern>/LoanProcessing</url-pattern>
  |   </servlet-mapping>
  |     <servlet-mapping>
  |     <servlet-name>relationServlet</servlet-name>
  |     <url-pattern>/relation</url-pattern>
  |   </servlet-mapping>
  |   <resource-ref>
  |     <res-ref-name>jms/ConnectionFactory</res-ref-name>
  |     <res-type>javax.jms.ConnectionFactory</res-type>
  |     <res-auth>Container</res-auth>
  |     <res-sharing-scope>Shareable</res-sharing-scope>
  |   </resource-ref>
  |   <message-destination-ref>
  |     <message-destination-ref-name>jms/LoanProcessing</message-destination-ref-name>
  |     <message-destination-type>javax.jms.Queue</message-destination-type>
  |     <message-destination-usage>ConsumesProduces</message-destination-usage>
  |   </message-destination-ref>
  | </web-app>

webservices.xml
<?xml version="1.0" encoding="UTF-8"?>
  | <webservices version="1.1" xmlns="http://java.sun.com/xml/ns/j2ee"
  |  xmlns:impl="urn:samples:loanapproval" 
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
  |                       http://java.sun.com/xml/ns/j2ee/j2ee_web_services_1_1.xsd">
  |   <webservice-description>
  |     <webservice-description-name>Loan Approval Service</webservice-description-name>
  |     <wsdl-file>WEB-INF/wsdl/service.wsdl</wsdl-file>
  |     <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
  |     <port-component>
  |       <port-component-name>LoanProcessingPort</port-component-name>
  |        <wsdl-port>impl:LoanProcessingPort</wsdl-port>
  |       <service-endpoint-interface>org.jbpm.bpel.tutorial.loanapproval.LoanProcessPortType</service-endpoint-interface>
  |       <service-impl-bean>
  |         <servlet-link>LoanProcessingServlet</servlet-link>
  |       </service-impl-bean>
  |       <handler>
  |         <handler-name>LoanProcessingHandler</handler-name>
  | 		<handler-class>org.jbpm.bpel.service.provider.PortProvider</handler-class>
  |         <init-param>
  |           <description>
  |             name of the port; should match the partner link name
  |           </description>
  |           <param-name>portName</param-name>
  |           <param-value>LoanProcessing</param-value>
  |         </init-param>
  |         <init-param>
  |           <description>time to wait for response messages, in milliseconds</description>
  |           <param-name>responseTimeout</param-name>
  |           <param-value>60000</param-value>
  |         </init-param>
  |       </handler>
  |     </port-component>
  |   </webservice-description>
  | </webservices>
  | 

jboss-web.xml
<?xml version="1.0" encoding="UTF-8" ?>
  | <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
  |     "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
  | <jboss-web>
  |   <resource-ref>
  |     <res-ref-name>jms/ConnectionFactory</res-ref-name>
  |     <jndi-name>java:ConnectionFactory</jndi-name>
  |   </resource-ref>
  | <message-destination-ref>
  |     <message-destination-ref-name>jms/LoanProcessing</message-destination-ref-name>
  |         <jndi-name>queue/loanApprovalQueue</jndi-name>
  |   </message-destination-ref>  
  | </jboss-web>

bpel-application.xml
<?xml version="1.0" encoding="UTF-8"?>
  |  <bpelApplication name="loanapproval" xmlns="http://jbpm.org/bpel"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |   xsi:schemaLocation="http://jbpm.org/bpel
  |                       http://jbpm.org/bpel/bpel_application_1_0.xsd">
  |   <partnerLinks>
  |     <partnerLink name="SchufaLink">
  |       <partnerRole>
  |           <!--wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"-->
  |           <wsa:Address>USE_ACTUAL_URI_FROM_CATALOG</wsa:Address>
  |           <wsa:Address>http://localhost:8081/creditprocess/schufa</wsa:Address>
  | 	    <wsa:ServiceName xmlns:serviceNS="urn:samples:schufa">serviceNS:SchufaWSService</wsa:ServiceName>
  |         </wsa:EndpointReference>
  |       </partnerRole>
  |     </partnerLink>
  |   </partnerLinks>
  |   <serviceCatalogs>
  | 	<!--urlCatalog contextUrl="http://localhost:8081/"-->
  | 	<urlCatalog contextUrl="http://127.0.0.1:8080/">
  |       <!-- published WSDL document of the approver Service  -->
  |       <!--wsdl location="loanapprover/loanApproverPortType?wsdl"/-->
  |       <!--wsdl location="wsportal/demo/schufa.wsdl"/-->
  |       <!--wsdl location="creditprocess/schufa"/-->
  |       <wsdl location="schufa/schufaWS?wsdl"/>
  |      </urlCatalog>
  |   </serviceCatalogs>  
  | </bpelApplication>


jboss-client.xml
<?xml version='1.0' encoding='UTF-8' ?>
  | <!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN"
  |    "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
  | <jboss-client>
  |   <jndi-name>loanapproval-client</jndi-name>
  |   <service-ref>
  | 	  <service-ref-name>service/Loanapproval</service-ref-name>
  | 	   <wsdl-override>http://127.0.0.1:8080/loanapproval/loanProcessing?wsdl</wsdl-override>
  |   </service-ref>	
  | </jboss-client>

application-client.xml
<?xml version="1.0" encoding="UTF-8"?>
  | <application-client version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
  |                     http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd">
  |   <display-name>Loanapproval service client</display-name>
  |   <service-ref>
  |     <service-ref-name>service/Loanapproval</service-ref-name>
  |    <service-interface>org.jbpm.bpel.tutorial.loanapproval.LoanApprovalService</service-interface>
  |     <!-- placeholder for published WSDL file -->
  |     <wsdl-file>USE_JBOSS_CLIENT_XML_OVERRIDE</wsdl-file>
  |     <!-- Java<->XML mapping file -->
  |     <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>    
  |     <port-component-ref>
  |       <!-- service endpoint interface class -->
  |       <service-endpoint-interface>org.jbpm.bpel.tutorial.loanapproval.LoanProcessPortType</service-endpoint-interface>
  |     </port-component-ref>   
  |   </service-ref>
  | </application-client>


The Schufa partner service:


schufa.imp.wsdl
<?xml version="1.0" encoding="UTF-8"?>
  | <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:samples:schufa" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  | xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  | targetNamespace="urn:samples:schufa" xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/">
  | 	<import namespace="urn:samples:schufa" location="schufa.wsdl"/>
  | 	<binding name="SchufaSOAPBinding" type="tns:SchufaWS">
  | 		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  | 		<operation name="validCustomer">
  | 			<soap:operation soapAction="urn:samples:schufa:validCustomer"/>
  | 			<!---soap:operation style="rpc"/-->
  | 			<input>
  | 				<soap:body use="literal" namespace="urn:samples:schufa"/>
  | 			</input>
  | 			<output>
  | 				<soap:body use="literal" namespace="urn:samples:schufa"/>
  | 			</output>
  | 		</operation>
  | 	</binding>
  | 	<service name="SchufaWSService">
  | 		<port name="SchufaPort" binding="tns:SchufaSOAPBinding">
  | 			<soap:address location="http:/127.0.0.1:8081/creditprocess/schufa"/>
  | 			<!--soap:address location="REPLACE_WITH_ACTUAL_URI"/-->
  | 		</port>
  | 	</service>
  | </definitions>
  | 


schufa.wsdl
<?xml version="1.0" encoding="UTF-8"?>
  | <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:samples:schufa" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="urn:samples:schufa" 
  | xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/">
  | 	<message name="validCustomerRequest">
  | 		<part name="_surname" type="xsd:string"/>
  | 		<part name="_firstname" type="xsd:string"/>
  | 	</message>
  | 	<message name="validCustomerResponse">
  | 		<part name="validCustomerReturn" type="xsd:string"/>
  | 	</message>
  | 	<portType name="SchufaWS">
  | 		<operation name="validCustomer" parameterOrder="_surname _firstname">
  | 			<input name="validCustomerRequest" message="tns:validCustomerRequest"/>
  | 			<output name="validCustomerResponse" message="tns:validCustomerResponse"/>
  | 		</operation>
  | 	</portType>
  | 	<!--service name="SchufaWSService">
  | 	<port name="SchufaService" binding="impl:SchufaServiceSoapBinding"-->
  | 	<!--wsdlsoap:address location="http://127.0.0.1:8081/creditprocess/schufa"/-->
  | 	<!--wsdlsoap:address location="http://127.0.0.1:8081/creditprocess/schufa"/>
  | 		</port>
  | 	</service-->
  | </definitions>
  | 

web.xml
<?xml version="1.0" encoding="UTF-8"?>
  | <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
  |                       http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  |   <servlet>
  |      <servlet-name>schufaServlet</servlet-name>
  |     <servlet-class>org.jbpm.bpel.tutorial.schufa.SchufaWS_Impl</servlet-class>
  |   </servlet>
  |   <servlet-mapping>
  |     <servlet-name>schufaServlet</servlet-name>
  |     <url-pattern>/schufaWS</url-pattern>    
  |   </servlet-mapping>
  | </web-app>

webservices.xml
<?xml version="1.0" encoding="UTF-8"?>
  | <webservices version="1.1" xmlns="http://java.sun.com/xml/ns/j2ee"
  |   xmlns:impl="urn:samples:schufa"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
  | 		http://java.sun.com/xml/ns/j2ee/j2ee_web_services_1_1.xsd">
  |   <webservice-description>
  |      <webservice-description-name>SchufaService</webservice-description-name>
  |     <!-- WSDL implementation file -->
  |     <wsdl-file>WEB-INF/wsdl/schufa.impl.wsdl</wsdl-file>
  |     <!-- Java<->XML mapping file -->
  |     <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
  |     <port-component>
  |      <port-component-name>SchufaPort</port-component-name>  
  |      <!-- WSDL port element (in WSDL implementation file) -->     
  |     <wsdl-port>impl:SchufaPort</wsdl-port>
  |       <service-endpoint-interface> <!-- org.jbpm.bpel.tutorial.serviceName.portTypeName -->
  |         org.jbpm.bpel.tutorial.schufa.SchufaWS
  |       </service-endpoint-interface>
  |       <service-impl-bean>
  |         <servlet-link>schufaServlet</servlet-link>
  |       </service-impl-bean>
  |     </port-component>
  |   </webservice-description>
  | </webservices>.


Thanks once Alex for all.


Bertrand


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994208#3994208

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994208



More information about the jboss-user mailing list