3 Replies Latest reply on Apr 19, 2012 1:01 PM by user12608377

    BPEL Fault

    836551
      I have invoked java web service from my BPEL process. I am getting an error.Below is the payload. I want to assign the faultcode,faultstring and detail from the payload to my BPEL output variables. How to do that? Please Help!!!

      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <S:Body>
      <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
      <faultcode>S:Server</faultcode>
      <faultstring>C:\JDeveloper\mywork\abc.txt (The system cannot find the file specified)</faultstring>
      <detail>
      <ns2:exception xmlns:ns2="http://jax-ws.dev.java.net/" class="jci.gsdm.email.exception.WebServiceExceptionClass" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false">
      <message>C:\JDeveloper\mywork\stringnull.txt (The system cannot find the file specified)</message>
      <ns2:stackTrace>
      <ns2:frame class="email.emailClass.EmailClass" file="EmailClass.java" line="83" method="readEmailTemplate" />
      <ns2:frame class="email.emailClass.EmailClass" file="EmailClass.java" line="47" method="composeEmail" />
      <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0" />
      <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke" />
      <ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke" />
      <ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke" />
      <ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="WLSInstanceResolver.java" line="92" method="invoke" />
      <ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="WLSInstanceResolver.java" line="74" method="invoke" />
      <ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="151" method="invoke" />
      <ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl" file="EndpointMethodHandlerImpl.java" line="268" method="invoke" />
      <ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="100" method="processRequest" />
      <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="866" method="__doRun" />
      <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="815" method="_doRun" />
      <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="778" method="doRun" />
      <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="680" method="runSync" />
      <ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="403" method="process" />
      <ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="532" method="handle" />
      <ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="253" method="handle" />
      <ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="141" method="handle" />
      <ns2:frame class="weblogic.wsee.jaxws.WLSServletAdapter" file="WLSServletAdapter.java" line="172" method="handle" />
      <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="708" method="run" />
      <ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="146" method="runAs" />
      <ns2:frame class="weblogic.wsee.util.ServerSecurityHelper" file="ServerSecurityHelper.java" line="103" method="authenticatedInvoke" />
      <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$3" file="HttpServletAdapter.java" line="311" method="run" />
      <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="336" method="post" />
      <ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="95" method="doRequest" />
      <ns2:frame class="weblogic.servlet.http.AbstractAsyncServlet" file="AbstractAsyncServlet.java" line="99" method="service" />
      <ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="821" method="service" />
      <ns2:frame class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction" file="StubSecurityHelper.java" line="227" method="run" />
      <ns2:frame class="weblogic.servlet.internal.StubSecurityHelper" file="StubSecurityHelper.java" line="125" method="invokeServlet" />
      <ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="300" method="execute" />
      <ns2:frame class="weblogic.servlet.internal.TailFilter" file="TailFilter.java" line="27" method="doFilter" />
      <ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="57" method="doFilter" />
      <ns2:frame class="oracle.security.jps.ee.http.JpsAbsFilter$1" file="JpsAbsFilter.java" line="111" method="run" />
      <ns2:frame class="oracle.security.jps.util.JpsSubject" file="JpsSubject.java" line="313" method="doAsPrivileged" />
      <ns2:frame class="oracle.security.jps.ee.util.JpsPlatformUtil" file="JpsPlatformUtil.java" line="413" method="runJaasMode" />
      <ns2:frame class="oracle.security.jps.ee.http.JpsAbsFilter" file="JpsAbsFilter.java" line="94" method="runJaasMode" />
      <ns2:frame class="oracle.security.jps.ee.http.JpsAbsFilter" file="JpsAbsFilter.java" line="161" method="doFilter" />
      <ns2:frame class="oracle.security.jps.ee.http.JpsFilter" file="JpsFilter.java" line="71" method="doFilter" />
      <ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="57" method="doFilter" />
      <ns2:frame class="oracle.dms.servlet.DMSServletFilter" file="DMSServletFilter.java" line="136" method="doFilter" />
      <ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="57" method="doFilter" />
      <ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3715" method="wrapRun" />
      <ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3681" method="run" />
      <ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="120" method="runAs" />
      <ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2277" method="securedExecute" />
      <ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2183" method="execute" />
      <ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1454" method="run" />
      <ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="178" method="run" />
      </ns2:stackTrace>
      </ns2:exception>
      </detail>
      </S:Fault>
      </S:Body>
      </S:Envelope>
        • 1. Re: BPEL Fault
          Yatan
          Hi',

          1.) Include these 3 elements in your output variable XSD, assign the faultcode,faultstring and detail
          2.) put a catch all on your BPEL process
          3.) inside the catch all put a assign activity
          4.) Inside the assign expression use ora:getFaultAsString() this will get you the error log
          5.) map this function to a variable "FaultVariable"
          6.) extract the various details using string functions
          7.) Pass the details from FaultVariable to the output variables "faultcode,faultstring and detail "

          -Yatan
          • 2. Re: BPEL Fault
            836551
            Thanks a lot Yatan.
            • 3. Re: BPEL Fault
              user12608377
              Hi Yatan,

              Do you have an example of doing step 6 (parsing the string returned by getFaultAsString())? The structure of the string returned from that function looks somewhat parse-able, but as it is not pure XML it is not clear to me how to do this without making some big assumptions about the structure.

              Is there a way of getting the fault as a pure XML string? That would be easier to work with, and maybe even more readable when included directly as an error message.

              Thanks