A Bug When Using BPM Studio 10g to Invoke Web Service Deployed by Oracle Integrated Repository
Preface
I found this bug about one year ago when I’m engaged in a BPM project, when Oracle just bought BEA and released the BPM Studio 10g. But as Oracle has developed a BPM plugin in its own IDE, a.k.a JDeveloper, I’m not sure my article is still helpful or not. But I prefer to keep it here as a piece of my work log.
Body
When using BPM Studio 10g to automatically generate a service, which is an abstract of a web service, the studio will put the tag <soaHeader> along with tag <soaBody> in the body of the SOAP message, instead of putting it into the header of the message. As a result, the remote server who hosts the web service can not get the credentials, for example the responsibility and so on. Thus the invoke of the web service won’t succeed.
To fix this issue, we need to manually put the soaHeader into the field requestHeaders[] of the service generated by the studio.
The CORRECT SOAP message should be like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:SOAHeader xmlns:ns1="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/fnd_program/">
<ns1:ResponsibilityName>System Administrator</ns1:ResponsibilityName>
<ns1:ResponsibilityApplName>SYSADMIN</ns1:ResponsibilityApplName>
<ns1:SecurityGroupName>STANDARD</ns1:SecurityGroupName>
<ns1:NLSLanguage>AMERICAN</ns1:NLSLanguage>
</ns1:SOAHeader>
</soapenv:Header>
<soapenv:Body>
<ns1:InputParameters xmlns:ns1="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/fnd_program/executable_exists/">
<ns1:EXECUTABLE_SHORT_NAME>GLPRJE</ns1:EXECUTABLE_SHORT_NAME>
<ns1:APPLICATION>SQLGL</ns1:APPLICATION>
</ns1:InputParameters>
</soapenv:Body>
</soapenv:Envelope>
The WRONG SOAP message looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<ns1:SOAHeader xmlns:ns1="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/fnd_program/">
<ns1:ResponsibilityName>System Administrator</ns1:ResponsibilityName>
<ns1:ResponsibilityApplName>SYSADMIN</ns1:ResponsibilityApplName>
<ns1:SecurityGroupName>STANDARD</ns1:SecurityGroupName>
<ns1:NLSLanguage>AMERICAN</ns1:NLSLanguage>
</ns1:SOAHeader>
<ns1:InputParameters xmlns:ns1="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/fnd_program/executable_exists/">
<ns1:EXECUTABLE_SHORT_NAME>GLPRJE</ns1:EXECUTABLE_SHORT_NAME>
<ns1:APPLICATION>SQLGL</ns1:APPLICATION>
</ns1:InputParameters>
</soapenv:Body>
</soapenv:Envelope>
You can refer to this example to change your code:
fnd as FND_PROGRAM_Service = FND_PROGRAM_Service()
soaHeader as ExpenseComponents.FND.SoaHeader
soaHeader.responsibilityName = "System Administrator"
soaHeader.responsibilityApplName = "SYSADMIN"
soaHeader.securityGroupName = "STANDARD"
soaHeader.nlsLanguage = "AMERICAN"
// Important! Set soaHeader to header section of SOAP request
fnd.requestHeaders[] = soaHeader
soaBody as InputParameters9
soaBody.executableshortname = "GLPRJE"
soaBody.application = "SQLGL"
bodyOutput as OutputParameters
executableexists fnd
using header = null, // DON'T pass soaHeader to webservice thru this parameter!
body = soaBody
returning bodyOutput = bodyOutput
Sounds interesting…