Testing your service with the BPEL console

Using default XML input

Have you ever tested a BPEL process through the BPEL console and had to replace the given XML input data with your actual data over and over again? After a while you can really become a copy&paste maniac. It was quite a relief when I found out that you can easily define a default input for your process test.

Open the bpel.xml file of your project. It contains something like:

<?xml version = '1.0' encoding = 'UTF-8'?>
   <BPELProcess id="searchShipyard" src="searchShipyard.bpel">
         <partnerLinkBinding name="searchShipyard">
            <property name="wsdlLocation">searchShipyard.wsdl</property>

In front of the closing </BPELProcess> tag insert the following code snipplet:

   <property name="defaultInput"><!&#91;CDATA&#91;
     --> Here goes your actual process input data and yes, this has to be XML <--

After re-deplyoing your process go to your BPEL console, open the Dashboard, click on the link to your process and you should find your XML data as proposed process input.

Trust is a good thing, but verification sometimes is better…

If you’re using complex schemas with different namespaces in combination with imports/includes in your WSDL it is likely possible that the suggested XML input for testing your web service is a fraud. Somehow the BPEL process manager seems to get confused by nested namespaces.

Let me give you an an example to show what might happen. The following XML input was suggested in the BPEL console:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://firefly.de/fly">
        <fly:FlightHeader xmlns:ns2="http://nostromo.de/nst">

… but should have been something like:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:nst="http://nostromo.de/nst" xmlns:voy="http://voyager.de/voy" xmlns:fly="http://firefly.de/fly">

Therefore my advice would be to always make sure that you are sending XML according to the respective WSDL and not to trust the BPEL console to much…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: