Here how to set substitution to any address so that I can use it in AWS Application Load Balancer.
<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true" />
<virtual-server name="default-host" enable-welcome-root="true">
<rewrite pattern="^/(.*)$" substitution="https://localhost:443/$1" flags="RL">
<condition test="%{HTTPS}" pattern="off" />
</rewrite>
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
I want like
<rewrite pattern="^/(.*)$" substitution="https://%HOST_NAME%" flags="RL">
<condition test="%{HTTPS}" pattern="off" />
</rewrite>
Here are the steps to redirect from http to https in EAP 6,
Add redirect-port="443" to http connector as follows :
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="443"/>
Change the socket-binding of https to 443 as follows :
<socket-binding name="https" port="443"/>
Configure https connector in EAP 6,
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
<ssl name="ssl" key-alias="mykey" password="password" certificate-key-file="/path/to/keystore.jks"/>
</connector>
Edit the web.xml of application as follows:-
<web-app>
<security-constraint>
<web-resource-collection>
<web-resource-name>Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>
This is what worked for me (change in configruation/standalone-full.xml):
<filters>
<rewrite name="http-to-https" target="https://${jboss.qualified.host.name}:8443%U" redirect="true"/>
</filters>
I must make my WCF Client consume a web service and sign/encrypt the request using Web Services Axis 1.4 a Apache CXF 2.6.
So far I have created a custom binding and I've added ProtectionLevel=Net.Security.ProtectionLevel.Sign in my contract atributte and "think" I am working along the right lines.
This is my .config:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="ComportamientoCertificadosREA">
<clientCredentials>
<clientCertificate findValue="XXXXXXXX"
x509FindType="FindByThumbprint" />
<serviceCertificate>
<defaultCertificate findValue="XXXXXX"
storeLocation="LocalMachine" x509FindType="FindByThumbprint" />
<authentication certificateValidationMode="ChainTrust" trustedStoreLocation="LocalMachine" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="reaCXFWSSoapBinding">
<security authenticationMode="MutualCertificate" requireDerivedKeys="false"
includeTimestamp="false" messageProtectionOrder="EncryptBeforeSign"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="false">
<secureConversationBootstrap authenticationMode="MutualCertificate"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
</security>
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" requireClientCertificate="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://..."
behaviorConfiguration="ComportamientoCertificadosREA" binding="customBinding"
bindingConfiguration="reaCXFWSSoapBinding" contract="ServiceReference1.WSREACXFService"
name="REAEndpoint">
<identity>
<dns value="..." />
<certificateReference storeLocation="CurrentUser" findValue=""
isChainIncluded="false" />
</identity>
</endpoint>
</client>
</system.serviceModel>
That produces the following request (capture and decrypted with fiddler)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:BinarySecurityToken u:Id="uuid-5a68af48-0f16-46b4-b45f-e83851841104-2" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">...</o:BinarySecurityToken>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#_1">
<Transforms>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>...</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue></SignatureValue>
<KeyInfo>
<o:SecurityTokenReference>
<o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#uuid-5a68af48-0f16-46b4-b45f-e83851841104-2"/>
</o:SecurityTokenReference>
</KeyInfo>
</Signature>
</o:Security>
</s:Header>
<s:Body u:Id="_1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
</s:Body>
</s:Envelope>
And this is a valid example of the service:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="CertId-E554529BAA924FFE9C14373971009923"></wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<ds:Reference URI="#id-3">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>...</ds:SignatureValue>
<ds:KeyInfo Id="KeyId-E554529BAA924FFE9C14373971009924">
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="STRId-E554529BAA924FFE9C14373971009925">
<wsse:Reference URI="#CertId-E554529BAA924FFE9C14373971009923"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" />
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="E554529BAA924FFE9C14373971009141">...</wsse:BinarySecurityToken>
<xenc:EncryptedKey Id="EncKeyId-E554529BAA924FFE9C14373971009302">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:Reference URI="#E554529BAA924FFE9C14373971009141"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" />
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>...</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#EncDataId-1" />
</xenc:ReferenceList>
</xenc:EncryptedKey>
</wsse:Security>
</soap:Header>
<soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-3">
...
</soap:Body>
</soap:Envelope>
So, how can I set my .config (and my code) in order to generate a request like the valid example?
I am using Munit to test my Mule Flow and I am using mocks to set the variables so that the flow doesn't throw an exception. When I run the test on it's own it passes but when I run my full suite just that test fails and running the debug shows that the mocks don't set the variables when running as a suite.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:mock="http://www.mulesoft.org/schema/mule/mock" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:munit="http://www.mulesoft.org/schema/mule/munit" xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/munit http://www.mulesoft.org/schema/mule/munit/current/mule-munit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/mock http://www.mulesoft.org/schema/mule/mock/current/mule-mock.xsd">
<munit:config name="munit" doc:name="MUnit configuration" />
<spring:beans>
<spring:import resource="classpath:endpointproject.xml" />
</spring:beans>
<munit:test
name="test_FilePickUpFlow_CallsFileToStringTransformer_ExactlyOnce"
description="Test">
<flow-ref name="filePickUpFlow" doc:name="filePickUpFlow" />
<mock:verify-call messageProcessor="file:file-to-string-transformer"
times="1" doc:name="Verify Call" />
</munit:test>
<munit:test
name="test_FilePickUpFlow_CallsJsonToObjectTransformer_ExactlyOnce"
description="MUnit Test">
<flow-ref name="filePickUpFlow" doc:name="filePickUpFlow" />
<mock:verify-call messageProcessor="json:json-to-object-transformer"
times="1" doc:name="Verify Call" />
</munit:test>
<munit:test name="test_FilePickUpFlow_CallsJsonParseSubFlow_ExactlyOnce"
description="Validate calls to sub flows are being done properly ">
<set-payload
value="[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]"
doc:name="Set Payload" />
<flow-ref name="filePickUpFlow" doc:name="filePickUpFlow" />
<mock:verify-call messageProcessor="mule:sub-flow"
doc:name="Verify Call" times="1">
<mock:with-attributes>
<mock:with-attribute name="name"
whereValue="#[matchContains('jsonParseSubFlow')]" />
</mock:with-attributes>
</mock:verify-call>
</munit:test>
<munit:test name="test_httpInboundFlow_CallsSetPayload_ExactlyOnce"
description="MUnit Test">
<flow-ref name="httpInboundFlow" doc:name="httpInboundFlow" />
<mock:verify-call messageProcessor="set-payload"
doc:name="Verify Call" />
</munit:test>
<munit:test
name="test_HttpInboundFlow_CallsJsonToObjectTransformer_ExactlyOnce"
description="MUnit Test">
<munit:set payload="#[]" doc:name="Set Message">
<munit:inbound-properties>
<munit:inbound-property key="http.query.params"
value="ParameterMap{[json=[[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]]]}" />
</munit:inbound-properties>
</munit:set>
<flow-ref name="httpInboundFlow" doc:name="httpInboundFlow" />
<mock:verify-call messageProcessor="json:json-to-object-transformer"
doc:name="Verify Call" times="1" />
</munit:test>
<munit:test name="test_HttpInboundFlow_CallsJsonParseSubFlow_ExactlyOnce"
description="Validate calls to sub flows are being done properly ">
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name"
whereValue="#['Set Payload To Query Params']" />
</mock:with-attributes>
<mock:then-return
payload="#['[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]']" />
</mock:when>
<mock:when messageProcessor="json:json-to-object-transformer"
doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['JSON to Object']" />
</mock:with-attributes>
<mock:then-return
payload="#['[{protocol=http, host=0.0.0.0, port=8085, path=, operation=GET}]']" />
</mock:when>
<flow-ref name="httpInboundFlow" doc:name="httpInboundFlow" />
<mock:verify-call messageProcessor="mule:sub-flow"
times="1" doc:name="Verify Call">
<mock:with-attributes>
<mock:with-attribute name="name"
whereValue="#[matchContains('jsonParseSubFlow')]" />
</mock:with-attributes>
</mock:verify-call>
</munit:test>
<munit:test
name="test_HttpInboundFlow_CallsSetEndpointVariablesSubFlow"
description="MUnit Test">
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name"
whereValue="#['Set Payload To Query Params']" />
</mock:with-attributes>
<mock:then-return
payload="#['[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]']" />
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set port variable" />
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="port" value="8085" />
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set path variable" />
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="path" value="#[]" />
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set host variable" />
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="host" value="0.0.0.0" />
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name"
whereValue="set protocol variable" />
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="protocol" value="http" />
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name"
whereValue="set operation variable" />
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="operation" value="GET" />
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<munit:set payload="#[]" doc:name="Set Message">
<munit:inbound-properties>
<munit:inbound-property key="http.query.params"
value="ParameterMap{[json=[[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]]]}" />
</munit:inbound-properties>
</munit:set>
<flow-ref name="httpInboundFlow" doc:name="httpInboundFlow" />
<mock:verify-call messageProcessor="mule:sub-flow"
doc:name="Verify Call">
<mock:with-attributes>
<mock:with-attribute name="name" whereValue="#[matchContains('setEndpointVariablesSubFlow')]"/>
</mock:with-attributes>
</mock:verify-call>
</munit:test>
<munit:test name="test_HttpInboundFlow_CallsHttpEndpointSubFlow"
description="MUnit Test">
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['Set Payload To Query Params']"/>
</mock:with-attributes>
<mock:then-return payload="#['[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]']"/>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set port variable"/>
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="port" value="8085"/>
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set path variable"/>
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="path" value="#[]"/>
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set host variable"/>
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="host" value="0.0.0.0"/>
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set protocol variable"/>
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="protocol" value="http"/>
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="set operation variable"/>
</mock:with-attributes>
<mock:then-return payload="#[]">
<mock:inbound-properties>
<mock:inbound-property key="operation" value="GET"/>
</mock:inbound-properties>
</mock:then-return>
</mock:when>
<munit:set payload="#[]" doc:name="Set Message">
<munit:inbound-properties>
<munit:inbound-property key="http.query.params"
value="ParameterMap{[json=[[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]]]}" />
</munit:inbound-properties>
</munit:set>
<flow-ref name="httpInboundFlow" doc:name="httpInboundFlow" />
<mock:verify-call messageProcessor="mule:sub-flow"
doc:name="Verify Call">
<mock:with-attributes>
<mock:with-attribute name="name" whereValue="#[matchContains('httpEndpointSubFlow')]"/>
</mock:with-attributes>
</mock:verify-call>
</munit:test>
I can't see why the test would be different when a suite as I have no communication between each, do you know how I can avoid this happening?
The test that fails is test_HttpInboundFlow_CallsHttpEndpointSubFlow.
I have managed to resolve the issue by changing "test_HttpInboundFlow_CallsJson{arseSubFlow_ExactlyOnce" test to
<munit:test name="test_HttpInboundFlow_CallsJsonParseSubFlow_ExactlyOnce"
description="Validate calls to sub flows are being done properly ">
<mock:when messageProcessor="mule:set-payload" doc:name="Mock">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['Set Payload To Query Params']"/>
</mock:with-attributes>
<mock:then-return payload="#['[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]']"/>
</mock:when>
<munit:set payload="#[]" doc:name="Set Message">
<munit:inbound-properties>
<munit:inbound-property key="http.query.params" value="ParameterMap{[json=[[{"protocol":"http","host":"0.0.0.0","port":"8085","path":"","operation":"GET"}]]]}"/>
</munit:inbound-properties>
</munit:set>
<flow-ref name="httpInboundFlow" doc:name="httpInboundFlow" />
<mock:verify-call messageProcessor="mule:sub-flow"
times="1" doc:name="Verify Call">
<mock:with-attributes>
<mock:with-attribute name="name"
whereValue="#[matchContains('jsonParseSubFlow')]" />
</mock:with-attributes>
</mock:verify-call>
</munit:test>
What I don't understand is why this test has affected a different one, does anyone have any suggestions?
Please look into below bpel code(WSO2).
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
bpel:doXslTransform("RequestAdd.xsl", $input.payload)
</bpel:from>
<bpel:to variable="Request" part="payload"></bpel:to>
</bpel:copy>
</bpel:assign>
I tried to Pass inputs to a external addition service using xslt in BPEL. $input and $request are message types. But seems like request is not passed to Addition service correctly. Please Help me in solving this. Below is the BPEL Code
<!-- InvokeUsingXSLT BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Mon Mar 05 12:13:11 IST 2012 -->
<bpel:process name="InvokeUsingXSLT"
targetNamespace="http://wso2.org/bps/sample"
suppressJoinFailure="yes"
xmlns:tns="http://wso2.org/bps/sample"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
>
<!-- Import the client WSDL -->
<bpel:import namespace="http://wso2.org/bps/sample" location="AddService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import location="InvokeUsingXSLTArtifacts.wsdl" namespace="http://wso2.org/bps/sample"
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:InvokeUsingXSLT"
myRole="InvokeUsingXSLTProvider"
/>
<bpel:partnerLink name="Add_service" partnerLinkType="tns:Add_service" partnerRole="Add_serviceProvider"></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:InvokeUsingXSLTRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:InvokeUsingXSLTResponseMessage"/>
<bpel:variable name="Request" messageType="tns:Add_serviceRequestMessage"></bpel:variable>
<bpel:variable name="Response" messageType="tns:Add_serviceResponseMessage"></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 InvokeUsingXSLT.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:InvokeUsingXSLT"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
bpel:doXslTransform("RequestAdd.xsl", $input.payload)
</bpel:from>
<bpel:to variable="Request" part="payload"></bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:log></bpel:log>
<bpel:invoke name="Invoke" partnerLink="Add_service" operation="process" portType="tns:Add_service" inputVariable="Request" outputVariable="Response"></bpel:invoke>
<bpel:assign validate="no" name="Assign1">
<bpel:copy>
<bpel:from><bpel:literal><tns:InvokeUsingXSLTResponse xmlns:tns="http://wso2.org/bps/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns:result>0</tns:result>
</tns:InvokeUsingXSLTResponse>
</bpel:literal></bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
bpel:doXslTransform("ResponseAdd.xsl", $Response.payload)
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="replyOutput"
partnerLink="client"
portType="tns:InvokeUsingXSLT"
operation="process"
variable="output"
/>
</bpel:sequence>
</bpel:process>
suggestion: try to debug your process adding variable where you could print the some "breakpoint", then:
-send request
-wait until the process has done
-open the consolle
-select your process
-click on "complete" link
-click on process instance
-check your variables
Also: put the log in debug/trace mode so you can see your process's behaviour.
Regards
Claudio
how to debug bps log
Hi (Sorry for may bad English).
I’m using Wso2 Developer Studio to build a Bpel workflow, in my workflow I need to invoke a several number of Webservices, and depending of the output of these take different paths, to do that I need to use variables, but I’m getting compilation errors when I deploy the workflow process in wso2 bps : File upload failed :BPEL Compilation Failure!
i searched and some people say that is a namespace problem but i don't know how to fix that plese help. below the error and the bpel source.
TID: [0] [BPS] [2014-03-11 10:23:30,889] ERROR {org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor} - File upload failed :BPEL Compilation Failure! {org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor}
java.lang.Exception: BPEL Compilation Failure!
at org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor.validateBPELPackage(BPELUploadExecutor.java:295)
at org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor.execute(BPELUploadExecutor.java:103)
at org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor.executeGeneric(AbstractFileUploadExecutor.java:104)
at org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager$CarbonXmlFileUploadExecHandler.execute(FileUploadExecutorManager.java:392)
at org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager$FileUploadExecutionHandlerManager.startExec(FileUploadExecutorManager.java:276)
at org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager.execute(FileUploadExecutorManager.java:125)
at org.wso2.carbon.ui.transports.FileUploadServlet.doPost(FileUploadServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.ode.bpel.compiler.api.CompilationException: error: [CompilationErrors] Compilation completed with 2 error(s):
file:/C:/WSO2BP~1.0/bin/../tmp/work/bpelTemp/1.394551410832569E12/TestVars_1.0.0/TestVars.bpel:42: error: [UndeclaredXsdType] Attempt to reference undeclared XSD type "{http://www.w3.org/2001/XMLSchema}string".
file:/C:/WSO2BP~1.0/bin/../tmp/work/bpelTemp/1.394551410832569E12/TestVars_1.0.0/TestVars.bpel:68: error: [UndeclaredVariable] Attempt to reference undeclared variable "VarTest".
at org.apache.ode.bpel.compiler.BpelCompiler.compile(BpelCompiler.java:815)
at org.apache.ode.bpel.compiler.BpelC.compile(BpelC.java:278)
at org.apache.ode.bpel.compiler.BpelC.compile(BpelC.java:364)
at org.apache.ode.store.DeploymentUnitDir$5.run(DeploymentUnitDir.java:221)
at org.apache.ode.utils.InternPool.runBlock(InternPool.java:57)
at org.apache.ode.store.DeploymentUnitDir.compile(DeploymentUnitDir.java:218)
at org.apache.ode.store.DeploymentUnitDir.compile(DeploymentUnitDir.java:177)
at org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor.validateBPELPackage(BPELUploadExecutor.java:292)
... 38 more
the bpel code:
<!-- TestVars BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Mon Mar 05 12:13:11 IST 2012 -->
<bpel:process name="TestVars"
targetNamespace="http://wso2.org/bps/sample"
suppressJoinFailure="yes"
xmlns:tns="http://wso2.org/bps/sample"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://facade.uaecd.gov.co/" xmlns:xsd="http://facade.uaecd.gov.co/types/">
<!-- Import the client WSDL -->
<bpel:import namespace="http://facade.uaecd.gov.co/" location="WSVerificarRegistroPredio.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import location="TestVarsArtifacts.wsdl" namespace="http://wso2.org/bps/sample"
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:TestVars"
myRole="TestVarsProvider"
/>
<bpel:partnerLink name="GPLWSCatastro" partnerLinkType="tns:PLTypeWSCatastro1" partnerRole="RoleWSCatastro1"></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:TestVarsRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:TestVarsResponseMessage"/>
<bpel:variable name="VarTest" type="ns1:string"></bpel:variable>
<bpel:variable name="GPLWSCatastroResponse" messageType="ns:WSVerificarRegistroPredio_getRegistroCatastroResponse"></bpel:variable>
<bpel:variable name="GPLWSCatastroRequest" messageType="ns:WSVerificarRegistroPredio_getRegistroCatastro"></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 TestVars.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:TestVars"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">0</bpel:literal>
</bpel:from>
<bpel:to variable="VarTest"></bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:assign validate="no" name="Assign1">
<bpel:copy><bpel:from>
<bpel:literal xml:space="preserve"><ns:getRegistroCatastroElement xmlns:ns="http://facade.uaecd.gov.co/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns:identificacion>ns:identificacion</ns:identificacion>
<ns:chip>ns:chip</ns:chip>
<ns:address>ns:address</ns:address>
<ns:correousuario>ns:correousuario</ns:correousuario>
<ns:pwd>ns:pwd</ns:pwd>
<ns:ipRemoto>ns:ipRemoto</ns:ipRemoto>
</ns:getRegistroCatastroElement></bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="GPLWSCatastroRequest"></bpel:to>
</bpel:copy>
<bpel:copy><bpel:from part="payload" variable="input">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:input]]></bpel:query>
</bpel:from>
<bpel:to part="parameters" variable="GPLWSCatastroRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[ns:chip]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:sequence name="Sequence">
<bpel:invoke name="Invoke" partnerLink="GPLWSCatastro" operation="getRegistroCatastro" portType="ns:WSVerificarRegistroPredio" inputVariable="GPLWSCatastroRequest" outputVariable="GPLWSCatastroResponse"></bpel:invoke>
</bpel:sequence>
<bpel:assign validate="no" name="Assign2">
<bpel:copy>
<bpel:from><bpel:literal><tns:TestVarsResponse xmlns:tns="http://wso2.org/bps/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns:result>tns:result</tns:result>
</tns:TestVarsResponse>
</bpel:literal></bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from part="parameters" variable="GPLWSCatastroResponse">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[ns:result/xsd:respuesta]]></bpel:query>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="replyOutput"
partnerLink="client"
portType="tns:TestVars"
operation="process"
variable="output"
/>
</bpel:sequence>
</bpel:process>