CDM File: Choreography file of Buyer,Seller,Shipper,Credit downloaded from the pi4soa choreography example.
Changes to the CDM: added identity information and reference tokens to the original CDM file so it would be able to function on a axis server deployment.
Problem: One of the steps of the choreography involves passing 2BuyerChannelType to the Seller.
Meanwhile, during the choreography interation a NullPointerException is raised from the following file:
org.pi4soa.service.behavior.impl.SendImpl
(...)
if (chan == null) {
chan = session.getChannel(cdecl.getName(),
cdecl.getFullyQualifiedChannelType(),
cdecl.getInformationType().getFullyQualifiedType(),
cdecl.getServiceType().getFullyQualifiedName());
}
(...)
The cdel.getServiceType() returns null and hence the NullPointerException stated before.
Possible explanation:
pi4soa has the capability to deploy a choreography to a Axis server. This is the deployment I've used. Looking inside the jar, there is a Seller.sdm file, one of the relevant content is the following:
<variableDeclarations xsi:type="org.pi4soa.service.behavior:ChannelDeclaration" name="DeliveryDetailsC" informationType="//@informationTypes.12" channelType="sens:2BuyerChannelType">
<identities>
<tokens>ID</tokens>
</identities>
</variableDeclarations>
<variableDeclarations xsi:type="org.pi4soa.service.behavior:ChannelDeclaration" name="Seller2CreditChkC" informationType="//@informationTypes.12" channelType="sens:Seller2CreditCheckChannelType" serviceType="//@serviceTypes.1">
<identities>
<tokens>ID</tokens>
</identities>
</variableDeclarations>
<variableDeclarations xsi:type="org.pi4soa.service.behavior:ChannelDeclaration" name="Seller2ShipperC" informationType="//@informationTypes.12" channelType="sens:Seller2ShipperChannelType" serviceType="//@serviceTypes.2">
<identities>
Has one can see, the channel DeliveryDetailsC concerning the buyer channel, doesn't have any serviceType value defined like the remaining channels.
pi4soa versions used:
org.pi4soa.service_2.0.0.200805161739
org.pi4soa.axis_2.0.0.200805161739
org.pi4soa.common_2.0.0.200805161739
org.pi4soa.cdl_2.0.0.200805161739
Test client used: the one included on the pi4soa plugin.
I attach the CDM file used.
Choreograhy related to the bug
Logged In: YES
user_id=1091755
Originator: NO
The problem is caused by the fact that the 'service type' for the Buyer, which should be referenced by this channel declaration, has been filtered out as part of the endpoint projection for the Seller participant, due to the fact that the Seller does not actually communicate with the buyer. A suitable fix will be applied to prevent this from resulting in a npe.
However, one thing to point out, is that unless you implement the Buyer as a service in its own right, then using a channel that communicates back to the Buyer (in a web service deployment context) will not have any effect, as there is no actual service endpoint listening for requests. There is another issue related to identity which I will append to your forum posting.