Exception: "caused by: com.tibco.spin.soap.processors.SoapProcessingException: Prefix not found:", when using "Security Policy Association" with SOAP Request Reply.

Exception: "caused by: com.tibco.spin.soap.processors.SoapProcessingException: Prefix not found:", when using "Security Policy Association" with SOAP Request Reply.

book

Article ID: KB0093293

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
Exception: "caused by: com.tibco.spin.soap.processors.SoapProcessingException: Prefix not found:" when using "Security Policy Association" with SOAP Request Reply.
Symptoms:
While running the SOAP Request Reply activity(with "Security Policy Association") following error is thrown:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SoapMessage::initRequestMessage
    at com.tibco.bw.service.binding.soap.impl.XDataSoapHelper.initRequestMessage(XDataSoapHelper.java:173)
    at com.tibco.bw.soap.share.reqrep.SoapRequestor.prepareMessage(SoapRequestor.java:321)
    at com.tibco.bw.soap.share.reqrep.SoapRequestor.execute(SoapRequestor.java:165)
    at com.tibco.plugin.soap.SOAPSendReceiveActivity.eval(SOAPSendReceiveActivity.java:284)
    at com.tibco.pe.plugin.Activity.eval(Activity.java:241)
    at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:574)
    at com.tibco.pe.core.Job.a(Job.java:712)
    at com.tibco.pe.core.Job.k(Job.java:501)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)
caused by: com.tibco.spin.soap.processors.SoapProcessingException: Prefix not found: 'ns10'
    at com.tibco.spin.soap.security.WSS4JSecurityPolicyProcessor.a(WSS4JSecurityPolicyProcessor.java:505)
    at com.tibco.spin.soap.security.WSS4JSecurityPolicyProcessor.processOutboundMessage(WSS4JSecurityPolicyProcessor.java:315)
    at com.tibco.spin.soap.security.WSS4JSecurityPolicyProcessor.process(WSS4JSecurityPolicyProcessor.java:178)
    at com.tibco.spin.soap.processors.SoapPipeline.process(SoapPipeline.java:574)
    at com.tibco.spin.soap.processors.SoapPipeline.prepare(SoapPipeline.java:424)
    at com.tibco.bw.service.binding.soap.impl.XDataSoapHelper.initRequestMessage(XDataSoapHelper.java:165)
    at com.tibco.bw.soap.share.reqrep.SoapRequestor.prepareMessage(SoapRequestor.java:321)
    at com.tibco.bw.soap.share.reqrep.SoapRequestor.execute(SoapRequestor.java:165)
    at com.tibco.plugin.soap.SOAPSendReceiveActivity.eval(SOAPSendReceiveActivity.java:284)
    at com.tibco.pe.plugin.Activity.eval(Activity.java:241)
    at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:574)
    at com.tibco.pe.core.Job.a(Job.java:712)
    at com.tibco.pe.core.Job.k(Job.java:501)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Cause:
When you choose the SOAP Request Reply activity for "Apply Policy to" in "Security Policy Association", the activity(Security Policy Association) associates the wsdl's(referred by SOAP Request Reply activity) namespace with prefix "inLine".

You can see line similar to following in the securityPolicyAssociation file(You can view this by opening the "Security Policy Association.securityPolicyAssociation" in a text editor):
>>>>>>>>>>>>>>>>>>>>>>
<BWSharedResource xmlns:inLine="http://www.WSDLNamespace.com/">
>>>>>>>>>>>>>>>>>>>>>>
Here "http://www.WSDLNamespace.com/" is the targetnamespace of the WSDL.

Now when you choose WSDL element in Outbound -> Message Elements Requiring Encryption/Message Elements Requiring Signature,you will see entry entry like "headers/Header.To/ns10:To".
If you look closely prefix in the entry (e.g."ns10") is the same prefix as used in the process containing SOAP Request Reply activity's Namespace Registry.

Now if the namespace referred by ns10 and the namespace of WSDL is different BW will add an extra entry in "Security Policy Association" e.g.
>>>>>>>>>>>>>>>
<BWSharedResource xmlns:inLine="http://www.WSDLNamespace.com/" xmlns:ns10="http://www.ElementNamespace.com/">
>>>>>>>>>>>>>>>>
Here "http://www.ElementNamespace.com/" is the namespace of the element "To" in example "headers/Header.To/ns10:To"

But if the namespace of the element(e.g. "To") is the same as the wsdl namespace, BW will not create another namespace/prefix association.
You will have "Security Policy Association" defined as following:
>>>>>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="UTF-8"?>
<BWSharedResource xmlns:inLine="http://www.WSDLNamespace.com/">
    <name>SecurityPolicyAssociationAPI1</name>
    <resourceType>ws.security.policy.association.resource</resourceType>
    <config>
        <applyTo>/Processes/SubProcesses/GetRSNURL.process/SOAPWMSIReqReply</applyTo>
        <systemSecuritySubject>/Processes/SubProcesses/GetRSNURL.process/Wmsi.Services.LoginService/RecordKeeperLogon</systemSecuritySubject>
        <inbound>
            <selectSignatureParts/>
            <selectEncryptionParts/>
        </inbound>
        <outbound>
            <selectSignatureParts>headers/Header.To/ns10:To</selectSignatureParts>
            <selectEncryptionParts/>
        </outbound>
        <outboundMessagePolicy>/SharedResources/Security/Policies/SecurityPolicyOutboundAPI1.securityPolicy</outboundMessagePolicy>
        <inboundMessagePolicy/>
    </config>
</BWSharedResource>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Since there is no namespace reference to prefix "ns10" you will get error "caused by: com.tibco.spin.soap.processors.SoapProcessingException: Prefix not found: ns10"

We already have a defect# BW-6616 logged for this issue.

Issue/Introduction

Exception: "caused by: com.tibco.spin.soap.processors.SoapProcessingException: Prefix not found:", when using "Security Policy Association" with SOAP Request Reply.

Resolution

Workaround:

1). Open the securityPolicyAssociation file in a text editor and manually add the missing namespace in BWSharedResource tag. For the example discussed earlier, you will have the following XML for Security Policy Association.


>>>>>>>>>>>>>>>>>>>>>>>>
<BWSharedResource xmlns:inLine="http://www.WSDLNamespace.com/" xmlns:ns10="http://www.WSDLNamespace.com/">
    <name>SecurityPolicyAssociationAPI1</name>
    <resourceType>ws.security.policy.association.resource</resourceType>
    <config>
        <applyTo>/Processes/SubProcesses/GetRSNURL.process/SOAPWMSIReqReply</applyTo>
        <systemSecuritySubject>/Processes/SubProcesses/GetRSNURL.process/Wmsi.Services.LoginService/RecordKeeperLogon</systemSecuritySubject>
        <inbound>
            <selectSignatureParts/>
            <selectEncryptionParts/>
        </inbound>
        <outbound>
            <selectSignatureParts>headers/Header.To/ns10:To</selectSignatureParts>
            <selectEncryptionParts/>
        </outbound>
        <outboundMessagePolicy>/SharedResources/Security/Policies/SecurityPolicyOutboundAPI1.securityPolicy</outboundMessagePolicy>
        <inboundMessagePolicy/>
    </config>
</BWSharedResource>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


2). Save the file and refresh the project. You can also close and open the Designer project.