Friday 9 December 2016

OSB-382032: The message must be an instance of: {http://www.w3.org/2003/05/soap-envelope}Envelope

The error could be as seen below :

<soap:Text  xml:lang="en">
OSB-382032: The message must be an instance of: {http://www.w3.org/2003/05/soap-envelope}Envelope
</soap:Text>
</soap:Reason>
<soap:Detail>
<con:stack-trace  xmlns:con="http://www.bea.com/wli/sb/context">
com.bea.wli.sb.service.handlerchain.HandlerException: The message must be an instance of: {http://www.w3.org/2003/05/soap-envelope}Envelope
 at com.bea.wli.sb.service.handlerchain.handlers.ComputeOperation$1.getPayload(ComputeOperation.java:204)
 at com.bea.wli.sb.services.bindinglayer.BindingOperationMapper$QNameMapper.computeOperationName(BindingOperationMapper.java:564)
 at com.bea.wli.sb.service.handlerchain.handlers.ComputeOperation.dispatch(ComputeOperation.java:93)


Analysis:
This issue comes when you are invoking a SOAP 1.2 web service.
The request you sent, to service must have namespace declaration with
http://www.w3.org/2003/05/soap-envelope

I see 3 differences in SOAP 1.1 & SOAP 1.2 :
  • SOAP 1.2 uses "application/soap+xml" as Content-Type and SOAP 1.1 uses "text/xml".
  • SOAP 1.2 does not use SOAPAction header line.
  • SOAP 1.2 uses "http://www.w3.org/2003/05/soap-envelope" as the envolope namespace and SOAP 1.1 uses "http://schemas.xmlsoap.org/soap/envelope/".

Solution :
Make sure the payload you are sending to Target SOAP 1.2 service is having correct namespace declaration.
Your payload should be something like below :

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">

<soapenv:Header  xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
</soapenv:Header>
<soapenv:Body  xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<get:string  xmlns:get="http://xmlns.oracle.com/OSB_App_Jaguar/Santa/GetSantaDetails"></get:string>
</soapenv:Body>
</soapenv:Envelope>

Tuesday 8 November 2016

Error Cluster BEA-000140 Failed to deserialize statedump from server

The Error could look something similar to below on managed server log file:


<Error> <Cluster> <BEA-000140> <Failed to deserialize statedump from server 2880051432324383502S:158.151.155.53:[8503,8503,-1,-1,-1,-1,-1]:soa_domain:soa_server1 with java.lang.ClassNotFoundException: oracle.bpm.bpmn.engine.instancemanagement.ejb.IInternalInstanceManagementServiceRemote.
java.lang.ClassNotFoundException: oracle.bpm.bpmn.engine.instancemanagement.ejb.IInternalInstanceManagementServiceRemote
        at weblogic.application.internal.AppClassLoaderManagerImpl.loadApplicationClass(AppClassLoaderManagerImpl.java:154)
        at weblogic.common.internal.ProxyClassResolver.resolveProxyClass(ProxyClassResolver.java:68)
        at weblogic.common.internal.WLObjectInputStream.resolveProxyClass(WLObjectInputStream.java:76)
        at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
        Truncated. see log file for complete stacktrace


Reason:
Corrupted files due to temporary communication failure between WebLogic admin and managed server instances. This also happens if one of the server node was down for longer time.


Solution:
1. Shut Down Weblogic Managed/Admin Server
2.Delete the directory under $DOMAIN_HOME/servers/<SOA_SERVER1>/tmp/ and $DOMAIN_HOME/servers/<SOA_SERVER1>/cache/ 
3.Restart Admin/Managed servers. The file will create automatically.


Wednesday 22 June 2016

File based MDS configuration SOA Jdevloper

Hi Guys, Today we are going with Steps for File Based MDS configurations.

STEP 1 :
Login to EM console.Expand SOA and right click on soa-infra and selcet Adminstration -->MDS configuration.



STEP 2:

Click on Export button on MDS configuration screen and save it your local disk

unzip the folder soa_infra_metadata, 
you will see the 
apps folder. 
All your project related WSDlS,XSD,fault-policy.xml,fault-binding.xml etc will be inside the apps folder.

STEP 3:


Now go to your C:\Oracle\Middleware\jdeveloper\integration\seed folder in your system, or it could be any other location as well, based on your Installation directory.
The above path created automatically while you installed JDeveloper studio.


STEP 4:

Copy and Paste apps folder, which you have got in from STEP 2.
Now its look like C:\Oracle\Middleware\jdeveloper\integration\seed\

STEP 5:
To use these schemas/wsdl etc in Jdeveloper we need to add some parameters in adf-config.xml under Application Resources.




Click on the adf-config.xml
Note:For each and every application it has his own adf-config.xml file persist.

Once opened the file need to add metadata-storage-usage_2 

 <metadata-namespaces>
          <namespace metadata-store-usage="mstore-usage_1" path="/soa/shared"/>
          <namespace metadata-store-usage="mstore-usage_2" path="/apps"/>
 </metadata-namespaces>
    <metadata-store-usages>
        <metadata-store-usage id="mstore-usage_1">
              <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
              <property  name="metadata-path" value="${oracle.home}/integration"/>
              <property name="partition-name" value="seed"/>
              </metadata-store>
        </metadata-store-usage>
        <metadata-store-usage id="mstore-usage_2">
             <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
             <property name="metadata-path" value="C:\Oracle\Middleware\jdeveloper\integration"/>
             <property name="partition-name" value="seed"/>
             </metadata-store>
        </metadata-store-usage>
    </metadata-store-usages>
    



    Note:
1. I have specify mstore_usage_2 path="/apps"-------because my all schemas   under that folder only.Incase ur schemas under apps folder only u can specify path like path="/apps"
     :Oher case if your schemas folder name is SOASchemas then u can specify path like
       path="/apps/SOASchema" 

2.Metadata-Path value  must be C:\Oracle\Middleware\jdeveloper\integration in real time scenarios
3.Patition-name valuse must be seed in real time scenarios.


    


STEP 6: 
To use a wsdl or any resource in your project use below reference. 

<wsdl:types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
         <import namespace="http://xmlns.example.com/unique/default/namespace/1103228635369" schemaLocation="oramds:/apps/ApplicationComponents/BAM/LoggingBAM.xsd"/>
      </schema>

   </wsdl:types>





    Thats it guys. 

Wednesday 15 June 2016

Download directly to Unix/Linux from Internet/Oracle using WGET command


Hi Guys,

In this post, I will describe the process to directly download installers from Oracle.com to Unix Machines.
You may wonder, why a post on this topic. Its fairly easy, but sometimes we dont have Browsers in Linux machines. We only have the Terminal or Putty screens to work.
Here's the process, to download using putty.

1. Log in to Unix Machine using Putty.
2. Navigate to location, where you want download installers.
3. Now using any windows PC Chrome browser, Login to Oracle.com, Select your installer & Download it to PC. In Chrome Download tab, Right Click on Downloading file. Select 'Copy Link Address'.

The address will look something like below

http://download.oracle.com/otn/nt/middleware/12c/1221/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip?AuthParam=1454049262_286c6d7c2bf0ba6eb3c31dcfb3d309a0

This address is valid for few minutes only. Hence do all steps faster.

4. Prepare a command as below using this adrress, your username  password,


wget --http-user=dhexxxxxxha@xxxxx.com --http-password=xxxxx234a --no-check-certificate "http://download.oracle.com/otn/nt/middleware/12c/1221/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip?AuthParam=1454049262_286c6d7c2bf0ba6eb3c31dcfb3d309a0" -O NameOfDownloadedFile.zip

5. Copy the above Command and Paste it to Putty screen. Hit enter, your download will start.
6. Repeat the same steps if there are multiple installers.


Thats it folks!

SOA - Using ora:getPreference() in BPEL process to get Environment specific Values

Hi Folks,

There are scenarios, when we have SOA Services (Composites), which uses Environment specific data in the transaction.
For Example - You have created Logging or BAM Service, which can be deployed across various Environments like Staging(Testing), Production. Now to identify the Transaction between various environment, you may need some sort of Identifiers. Like :

Environment Identifier
Development DEV
Test         TST
Production PRD

To achieve this, there could be multiple solutions. Here I am going to discuss one solution which uses function
ora:getPreference()

The syntax of function is  :
ora:getPreference('environmentName')

Here 'environmentName' is variable name.



Steps of implementation:

STEP 1 : Use Assign Action in BPEL flow & add function ora:getPreference('environmentName') in required field.





STEP 2 :  Once your code is compiled & Deployed to Server, you need to set the value of this variable in EM console.

STEP 3 : Login to EM console. On the left go to : Farm_soa_domain > Weblogic Domain > soa_domain > right mouseclick and select ‘System MBean Browser’.



STEP 4 : Then Navigate to : Defined MBeans > oracle.soa.config > Server : soa_server1 > SCAComposite > your_project > SCAComposite.SCAComponent > your bpel_process.





STEP 5 : Change the Value, and Apply.


Thats all !







Saturday 5 March 2016

OSB 12c - For Each action

Hey guys !

In this Post I am going through the For Each functionality in OSB 12c.


Use Case 

Simple Integration  Scenarios, Where Source system payload has Repeated Nodes, Target System expects one node at a time.



Design


Step 1 : 

Create a OSB Project, Add a Pipeline. Inside Pipeline Add a For Each Action.





Step 2:

Provide the required data in For Each Properties. Shown below



This is all we need to Implement For Each. 
However we will have to further process the Data, This could depend on your Requirement.
For the Demo Purpose, I am Sending this data to a Business Service using Publish Action.


Step 3:

Add a Publish Action inside For Each. Add a Assign action to see the Payload of the For Each iteration in Testing. Screens Below





Step 4:

Export and Deploy your code to Server.



Testing







Request Payload

<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
  <Message>
        <MessageID>1</MessageID>
        <OrderReport>
            <OrderID>102-4552-913811</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-2066</SKU>                
             </Item>
        </OrderReport>
  </Message>
  <Message>
        <MessageID>2</MessageID>
        <OrderReport>
            <OrderID>102-4556812-97811</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-20166</SKU>                
             </Item>
        </OrderReport>
  </Message>
  <Message>
        <MessageID>3</MessageID>
        <OrderReport>
            <OrderID>102-4556812-91371</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-266</SKU>                
             </Item>
        </OrderReport>
  </Message>
</Envelope>


For Each output for Last Iteration

<Message>
<MessageID>3</MessageID>
<OrderReport>
<OrderID>102-4556812-91371</OrderID>
<Item>
<OrderItemCode>09588730573218</OrderItemCode>
<SKU>05988-266</SKU>
</Item>
</OrderReport>
</Message>



Thats All Folks !






Here are some other posts, which may interests you

1. Fusion Middleware 12c – SAP Adapter Configuration

http://osb-dheeraj.blogspot.in/2016/02/fusion-middleware-12c-sap-adapter.html

2. Oracle Integration Cloud Service (ICS)

http://osb-dheeraj.blogspot.in/2016/02/oracle-integration-cloud-service-ics.html


3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1

http://osb-dheeraj.blogspot.in/2016/02/soa-interview-questions-service.html



http://osb-dheeraj.blogspot.in/2016/02/osb-12c-domain-value-map-dvm.html

Saturday 27 February 2016

OSB 12c - Domain Value map (DVM)


Hey guys !

Here I am going through the Domain Value map (DVM) functionality in OSB 12c.
In the 12c versions of OSB, Support for the DVM is included, Hence lets discuss the use case and Steps to implement DVM.

Use Case 

Simple Integration  Scenarios, Where Source system, Which sends data to Target System needs domain conversion of values.

A very typical example is Country name to Country Code conversion using DVM, i.e. Source system sends Country name and Target system expects Country code.

Design


Step 1 :

Open Jdevloper 12c (Service Bus console can also be used), Create a Service Bus Project.
I have given name to project as 'SBProject_DVM'

Step 2:

Create Source and target Schemas or WSDL (This is not a essential Step). For better demonstration, I Have used WSDL.



Step 3:

Create a Domain value map (CountryName_Code.dvm) and Add the Domain Name and Values. Atleast 2 rows needs be added.




Step 4:

Create a XSLT mapper (CountryNameToCode.xsl), Choose Source and Target to this mapper from your WSDL.



Step 5 :

User mapper to drag and Drop mapping element, Shown below




Step 6:

Go to XSLT source view and Edit the code as below 




Add this snippet 

<CountryCode>          
            <xsl:value-of select="DVMFunctions:lookupValue (&quot;SBProject_DVM/CountryName_Code&quot;, &quot;Name&quot;, string(/ns0:process/ns0:CountryName), &quot;Code&quot;, &quot;Unknown&quot; )"/>
 </CountryCode>



Now if you go to Design view, the below design will be visible





Step 7:

Create a new Pipeline Based on your WSDL and go to design view.
Add Pipeline pair to it, 
Inside Request Pipeline add a Stage. Inside stage add a 'Replace' action.
Inside Response Pipeline add a Reply action with Success.




Step 8:

Lets go to Replace action and use the Earlier created XSLT mapper to do the DVM  task.




In the input Field add the Variable which contains input element, as below





Step 9:

Save your changes and Export is to deploy to Test Server or Deploy directly from Jdeveloper.





Testing 

Step 1:

Open the Pipeline, click on test button, this will open in new window







Step 2:

Edit the request payload and click on Execute button to test it.








Voila !
You have successfully created DVM using OSB 12c


You can download the sbconfig jar of this project from
https://drive.google.com/file/d/0BxHj0h0tnxxOWWVYVXVvTGtWUGs/view?usp=sharing





Here are some other posts, which may interests you

1. Fusion Middleware 12c – SAP Adapter Configuration

http://osb-dheeraj.blogspot.in/2016/02/fusion-middleware-12c-sap-adapter.html

2. Oracle Integration Cloud Service (ICS)

http://osb-dheeraj.blogspot.in/2016/02/oracle-integration-cloud-service-ics.html


3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1

http://osb-dheeraj.blogspot.in/2016/02/soa-interview-questions-service.html

Sunday 21 February 2016

SOA Interview Questions : Service Oriented Architecture Interview Questions Part 5



What is a Complex XML Element?

A complex element is an XML element that contains other elements and/or attributes.
There are four kinds of complex elements:
empty elements
elements that contain only other elements
elements that contain only text
elements that contain both other elements and text


What is a Simple XML Element?

A simple element is an XML element that can contain only text.
A simple element cannot have attributes
A simple element cannot contain other elements
A simple element cannot be empty
However, the text can be of many different types, and may have various restrictions applied to it.


What is XPATH ?

XPath, the XML Path Language, is a query language for selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document.
The XPath language is based on a tree representation of the XML document, and provides the ability to navigate around the tree, selecting nodes by a variety of criteria.

XPATH  Syntax & Operators ?
Expression
Description
nodename
Selects all nodes with the name "nodename"
/
Selects from the root node
//
Selects nodes in the document from the current node that match the selection no matter where they are
.
Selects the current node
..
Selects the parent of the current node
@
Selects attributes
*
Matches any element node
@*
Matches any attribute node
node()
Matches any node of any kind



Example of some XPath Expressions ?

Example XML document
<?xml version="1.0" encoding="UTF-8"?>
<books>
                <book>
                                <title lang="en">Harry Potter</title>
                                <price>29.99</price>
                </book>
                <book>
                                <title lang="en">Learning XML</title>
                                <price>39.95</price>
                </book>
</books>


Example XPATH expressions and Result

Path Expression
Result
/books/book[1]
Selects the first book element that is the child of the books element.
/books/book[last()]
Selects the last book element that is the child of the books element
//title[@lang]
Selects all the title elements that have an attribute named lang
//title[@lang='en']
Selects all the title elements that have a "lang" attribute with a value of "en"
/books/book[price>35.00]
Selects all the book elements of the books element that have a price element with a value greater than 35.00



What is XSLT ?

XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or into XSL Formatting Objects.
The original document is not changed; rather, a new document is created based on the content of an existing one. Typically, input documents are XML files.


Example XSLT code ?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="/persons">
    <root>
      <xsl:apply-templates select="person"/>
    </root>
  </xsl:template>
</xsl:stylesheet>



XSLT vs XPATH ?

XSLT uses XPath to identify subsets of the source document tree and perform calculations.
XPath also provides a range of functions, which XSLT itself further augments.



How to refer another XSL from main XSL file ?

The <xsl:import> element is a top-level element that is used to import the contents of one style sheet into another.

Note: This element must appear as the first child node of <xsl:stylesheet> or <xsl:transform>.
Syntax: <xsl:import href="URI"/>


Why we use Call-template inside XSL ?

Call-template works similar to the apply-template element in XSLT. Both attach a template to specific XML data. This provides formatting instructions for the XML. The main difference between the two processes is the call function only works with a named template. You must establish a 'name' attribute for the template in order to call it up to format a document.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
< xsl:call-template name="myTemplate">
< !-- Content: xsl -->
< /xsl:call-template>

< stylesheet>




Refer Previous post on Interview questions at

1. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1

http://osb-dheeraj.blogspot.com/2016/02/soa-interview-questions-service.html

2. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 2


http://osb-dheeraj.blogspot.com/2016/02/soa-interview-questions-service_16.html

3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 3

http://osb-dheeraj.blogspot.com/2016/02/soa-interview-questions-service_21.html

4. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 4

http://osb-dheeraj.blogspot.com/2016/02/soa-interview-questions-service_77.html