Showing posts with label Web Service. Show all posts
Showing posts with label Web Service. Show all posts

Thursday, 7 May 2015

Handling CDATA in BPM Web Service call

The most common problem that we face while invoking a web service which expects some xml as a string in CDATA from oracle BPM/BPEL.
Like 

"<![CDATA[<UnderwriterAssignment><ApplicationID>XXXXXXXX</ApplicationID><Underwriter>XXXX</Underwriter></UnderwriterAssignment>]]>"

The above string has to be passed to the webservice as a string.

The problem here is the engine will convert the < and > to &lt; and &gt; while invoking. But the service may not be coded in such a ways that it accepts like that and the web service invokation will fail.

To resolve this, 

  • Prepared (assign) the string that needs to be sent as CDATA.
  • someString = "<UnderwriterAssignment><ApplicationID>ATL620007</ApplicationID><Underwriter>satishs</Underwriter></UnderwriterAssignment>"
  • On the service call use ora:toCDATA() to convert it into proper CDATA without encoding
  • like ora:toCDATA(someString).
This will not encode the string and it will pass as it is.

Thursday, 24 October 2013

Deploying ADF BC SDO Service in oracle java cloud

In this post i will try to explain the process of deploying the ADF BC SDO service in oracle java cloud (PAAS). There are couple of pre-requisties to follow this post, they are
1) Oracle java cloud account to deploy the web service.
2) HRModelSDOService application.

I had used the Jdeveloper version 11.1.1.7 in all screen shots except in step 13 and 14 (where i had used 11.1.2.4). All other steps almost similar in both the verions.
Let us see the steps required to achieve this,


  • Unzip the HRModleSDOService.zip to HRModelSDOService folder.
  •  Open the application in jdeveloper. 

  • If you get a warning for migration of project, Click Yes on “Do you want to migrate these files”.
  • Expand the HRModelSDOService and right click and select configurations on HRSdoAppModule.

  • We have to change the JDBCDataSource value of all the three app modules. Select each module and click on Edit. 


  • Change the Datasource name to “database” (as this the JNDI name of cloud database).


  • Repeat the above step for the remaining two app module configurations (HRSdoAppModuleShared, HRSdoService).
  • Click ok on Manage Configurations window.


  • Right click on the HRModelSDOService and click on project properties.



  • Select  the Deployments tab and delete the existing profile and create a new profile with   Archive Type = Business Components Service Interface. Name  = HRModelSDOService



  • Click on the application menu of the HRModelSDOService application and select Application Properties.



  • Go to Deployments and delete the existing deployments and create a new deployment profile with Archive Type = EAR File, Name = HRModelSDOService



  • Go to Application assembly of the new created deployment profile and select Middle Tier and EJB.




  • Select weblogic under Deployment, Click on ok and select only “Application Policies” check box on the deployment window (unselect all the others). Click ok.



  • Open Application Resourcesà Descriptors à META-INFà weblogic-application.xml



  • This file should have the following content, if it has any duplicate entiries delete them.



  • Save All. Now we are ready to generate the ear and deploy. Select the Application menu à Deploy à HRModelSDOService



  • Select Deploy to EAR option and click on Finish.



  • Get the ear path from the deployment log.



  • Log into java cloud service and click on Deploy New. Select the Ear file and click on Deploy.
  • Verify the Deployment job status in the status message; once it is completed we can access the deployed web service. Get the URL of the deployed application from Test application link.





Thursday, 14 February 2013

Error while creating web service proxy from wsdl in Jdeveloper


I am getting the below error while creating the web service proxy in JDeveloper,
oracle.jdeveloper.webservices.model.WebServiceException: Error creating model from wsdl 

I am using Jdeveloper 11.1.1.6.0


Problem:

The problem is in JDeveloper 11.1.1.6.0 (i am not sure about other versions) when you try to create web service proxy in a project which has "ADF Model Runtime" library as a dependency (it is dependent on some other project which has ADF Model Runtime) the proxy creating will fail.

Solution:
Solution 1. Remove the ADF Model Runtime depdency and create web service proxy and then add the dependency again.

Solution 2. Just create an other generic project and create a proxy there and call the proxy.

Solution 3. You can create the web service as a data control in the same project and use it.