Friday, February 10, 2012

Abstract WSDL vs. Concrete WSDL

Abstract WSDL(definitions )

An Abstract WSDL contains only Messages, PortTypes, and Operations
Abstract WSDL consists of the structure of the message that is like what operation, what is the input, what is the ouput and what is the fault message used by each operation to communicate with the web service, and their format.
An abstract WSDL document describes what the web service does, but not how it does it or how to contact it. An abstract WSDL document defines: the operations provided by the web service.


Concrete WSDL(implementation)
Concrete WSDL has all the things that the abstract wsdl has in addition it has transport(http,jms) details to tell how the web service communicates and where you can reach it.  A concrete WSDL document contains the abstract WSDL definitions, and also defines: the communication protocols and data encodings used by the web service, the port address that must be used to contact the web service. SOAP clients must retrieve the concrete WSDL file before sending a SOAP request to the service.


Abstract WSDL:- Used on server side,contains request,response and type of operation performed.
Concrete WSDL:- Used on client side,contains abstract wsdl and transport used.

Thursday, February 09, 2012

BPEL - How to handle an embeded XML message in a fault

In the development, the third part service returns a fault with a XML as a fault detail.
In order to get the real error message, I have to parse this XML to get the error code and error message.

In SOA Suite, there is a function named as parseXML.

parseXML
This function parses a string to a DOM element.
Signature: 
oratext:parseXML(contentString)
Arguments: 
contentString - The string that this function parses to a DOM element.
Property IDs: 
namespace-uri: http://schemas.oracle.com/xpath/extension
namespace-prefix: oratext

First, I need to get the XML message in the element <WL_FAULT_DETAIL>. The code is the follow. By this, I will be able to get a XML element <WL_FAULT_DETAIL>, which contains a XML string.
oraext:parseXML($RuntimeFault.detail)

The follow code will parse the XML string held by element <WL_FAULT_DETAIL> to a XML.
oraext:parseXML(oraext:parseXML($RuntimeFault.detail))

The above expression means:
1. Parse the detail to a XML and this XML contains another XML string like the follow.
<ser:ServiceFault xmlns:ser="http://rci.rogers.com/schemas/ServiceFault"><ser:Error id="1" lang="en"><ser:ErrorCode>SYSTEM FAILURE</ser:ErrorCode><ser:Description>[com.bea.nonxml.common.MFLException.create(MFLException.java:221) at com.bea.nonxml.common.MFLException.create(MFLException.java:344) at com.bea.nonxml.readers.NonXMLReaderVisitor.nextToken(NonXMLReaderVisitor.java:155) at com.bea.nonxml.readers.TokenNonXMLReader.nextToken(TokenNonXMLReader.java:44) at com.bea.wli.variables.util.ProcessXMLTokenReader.next(ProcessXMLTokenReader.java:56) at com.bea.wli.variables.util.TokenSourceSerializer.process(TokenSourceSerializer.java:284) at com.bea.wli.variables.ProcessXML.storeXML(ProcessXML.java:338) at com.bea.wli.variables.ProcessXML.storeTokenSource(ProcessXML.java:349) at com.bea.wli.variables.ProcessXML.&lt;init>(ProcessXML.java:124) at com.bea.wli.variables.XmlObjectVariableFactory.createProxy(XmlObjectVariableFactory.java:332) at com.bea.wli.variables.XmlObjectVariableFactory.createProxy(XmlObjectVariableFactory.java:298) at com.bea.wli.variables.MflObject.convertToXmlObject(MflObject.java:299) 
...
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) a...]</ser:Description><ser:Value>RSSP</ser:Value></ser:Error></ser:ServiceFault>.

2. Pass the above text as a string to parseXML to get another XML and the root element will be <ser:ServiceFault>.

Then, it will be very esay to get the error code and error message by getChildElement function.
Error Code is
ora:getChildElement(ora:getChildElement(oraext:parseXML(oraext:parseXML($RuntimeFault.detail)),1),1)
Error Message is
ora:getChildElement(ora:getChildElement(oraext:parseXML(oraext:parseXML($RuntimeFault.detail)),1),2)

Tuesday, February 07, 2012

OSB - System Error Code - BEA-38000x

Server found but service not available, a BEA-380000 error code will be got with Not Found in description:

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>Not Found</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>response-pipeline</con:path>
</con:location>
</con:fault>

Server not running on same port, a BEA-380000 error code will be got with Socket Closed in description:

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>General runtime error: Socket Closed</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>

Timeout set on Business Service triggering (Target service still processing and Socket gets closed because of preconfigured timeout value on BS), a BEA-380000 error code will be got with SocketTimeOut exception stacktrace in Description.

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>
[WliSbTransports:381304]Exception in HttpOutboundMessageContext.RetrieveHttpResponseWork.run: java.net.SocketTimeoutException
java.net.SocketTimeoutException
 at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse$SocketTimeoutNotification.<clinit>(AsyncResponseHandler.java:551)
 at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.handleTimeout(AsyncResponseHandler.java:396)
 at weblogic.net.http.AsyncResponseHandler$MuxableSocketHTTPAsyncResponse.timeout(AsyncResponseHandler.java:502)
 at weblogic.socket.SocketMuxer$TimerListenerImpl.timerExpired(SocketMuxer.java:1052)
 at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
 at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>response-pipeline</con:path>
</con:location>
</con:fault>

Timeout while obtaining connection to remote server, a BEA-380000 error code will be got with Connect Timed Out in Description.

<con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-380000</con:errorCode>
<con:reason>General runtime error: connect timed out</con:reason>
<con:location>
<con:node>RouteNode1</con:node>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>

OSB got some exception from the routing, a fault with error code BEA-380001 and message Internal Server Error will be created and save in fault.
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380001</con:errorCode>
  <con:reason>Internal Server Error</con:reason>
  <con:location>
    <con:node>Route to RoutingFaultHandlingBusinessService</con:node>
    <con:path>response-pipeline</con:path>
  </con:location>

</con:fault>

OSB cannot connect to service provider
<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
  <con:errorCode>BEA-380002</con:errorCode>
  <con:reason>Tried all: '1' addresses, but could not connect over HTTP to server: '10.9.232.68', port: '8888'</con:reason>
  <con:location>
    <con:node>EntryPipelinePairNode4Entitlements</con:node>
    <con:pipeline>EntryPipelinePairNode4Entitlements_request</con:pipeline>
    <con:stage>RequestStage4Entitlements</con:stage>
    <con:path>request-pipeline</con:path>
  </con:location>

</con:fault>>


The follow message will be help on the problem investigation.
fn-bea:inlinedXML($body/soap-env:Fault/detail)

References
http://docs.tpu.ru/docs/oracle/en/fmw/11.1.1.6.0/apirefs.1111/e15034/TransportKernel.html
http://docs.tpu.ru/docs/oracle/en/fmw/11.1.1.6.0/apirefs.1111/e15034/toc.htm
http://docs.oracle.com/cd/E13171_01/alsb/docs25/consolehelp/errorcodes.html
http://docs.oracle.com/cd/E13171_01/alsb/docs25/consolehelp/errorcodes.html