cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Proxy to SOAP Synchronous

sebastin_alvarez
Participant
0 Kudos

Hi Experts, I was looking for a solution to this problem, but I could not find the solution, I hope you can help me.

I have the scenario PROXY ==> PI ==> SOAP (Synchronus).

When the Web Service is ok, I have no problems, my problem is with the Fault Exception, because I tested it in SoapUI, and I'm getting this message.

<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>Error al insertar Domicilio en servicio Empleado</faultstring>
         <detail>
            <FaultException:FaultException xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.interacciones.com.mx/ServicioEmpleado/" xmlns:FaultException="http://www.interacciones.com.mx/ServicioEmpleado/"/>
            <ns2:exception class="mx.com.interacciones.servicioEmpleado.FaultException_Exception" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
               <message>Error al insertar Domicilio en servicio Empleado</message>
               <ns2:stackTrace>
                  <ns2:frame class="mx.com.interacciones.servicioEmpleado.ServicioEmpleadoImpl" file="ServicioEmpleadoImpl.java" line="87" method="agregarEmpleado"/>
                  <ns2:frame class="sun.reflect.GeneratedMethodAccessor267" line="unknown" 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="101" method="invoke"/>
                  <ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="WLSInstanceResolver.java" line="83" method="invoke"/>
                  <ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="152" method="invoke"/>
                  <ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="264" method="invoke"/>
                  <ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/>
                  <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="604" method="__doRun"/>
                  <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="563" method="_doRun"/>
                  <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="548" method="doRun"/>
                  <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="445" method="runSync"/>
                  <ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="275" method="process"/>
                  <ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="454" method="handle"/>
                  <ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="250" method="handle"/>
                  <ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="140" method="handle"/>
                  <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="319" method="run"/>
                  <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="232" method="post"/>
                  <ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="310" method="doPost"/>
                  <ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="727" method="service"/>
                  <ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="87" method="service"/>
                  <ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" 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="292" method="execute"/>
                  <ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="175" method="execute"/>
                  <ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3594" method="run"/>
                  <ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="321" method="doAs"/>
                  <ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="121" method="runAs"/>
                  <ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2202" method="securedExecute"/>
                  <ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2108" method="execute"/>
                  <ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1432" method="run"/>
                  <ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="201" method="execute"/>
                  <ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="173" method="run"/>
               </ns2:stackTrace>
            </ns2:exception>
         </detail>
      </S:Fault>
   </S:Body>
</S:Envelope>

So, I was reading a lot of threads, those said to copy the structure, but it doest not work.

I tried to check the "Do Not Use SOAP Envolve", but when I did that I got this error.

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 415 Unsupported Media Type

When I unchecked I got this error.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
- <!--  Request Message Mapping 
  --> 
- <SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SAP:Category>Application</SAP:Category> 
  <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code> 
  <SAP:P1>com/sap/xi/tf/_MM_RecursosHumanos_ServicioEmplead~</SAP:P1> 
  <SAP:P2>com.sap.aii.mappingtool.tf7.IllegalInstanceExcepti</SAP:P2> 
  <SAP:P3>on: Cannot create target element /ns0:Fault. Value</SAP:P3> 
  <SAP:P4>s missing in queue context. Target XSD requires a~</SAP:P4> 
  <SAP:AdditionalText /> 
  <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_RecursosHumanos_ServicioEmplead~; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:Fault. Values missing in queue context. Target XSD requires a~</SAP:Stack> 
  <SAP:Retry>N</SAP:Retry> 
  </SAP:Error>

I could never see the Fault Structure in PI and neither in Web Service Navigator.

Please, I need some help.

Thank you very much.

Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

I believe you want to know how to use fault message. You can use fault message only if the web service provider supports it. That means in this scenario you are consuming webservice. Please check your WSDL given by target system and check for your webservice, the service provider provides request,response and fault messages. if the wsdl has fault mesg then you have to map the fault message response to your fault message structure. so that the application system (proxy ) will receive the fault message from the target. Hope that helps.

Mapping: Fault message (webservice) ---> Fault message ( Proxy)

refer these links.

http://help.sap.com/saphelp_nwpi711/helpdata/en/48/5946db5f693912e10000000a42189b/content.htm

sebastin_alvarez
Participant
0 Kudos

Baskal, thank you for your answer,

The thing is I'm not using the WSDL, because there appears only the structures but not the fields, so I'm using the XSD (I do not know if that's a problem) and the original Structure is like this in the file.

- <xs:element name="FaultException">

- <xs:complexType>

- <xs:sequence>

<xs:element name="faultMessage" type="xs:string" />

</xs:sequence>

</xs:complexType>

</xs:element>

So, I thought this structure is not correcto, so I generated this one.

<xs:element name="Fault">

<xs:complexType>

<xs:sequence>

<xs:element name="faultcode" type="xs:string" />

<xs:element name="faultstring" type="xs:string" />

<xs:element name="faultactor" type="xs:string" />

<xs:element name="detail">

<xs:complexType>

<xs:sequence>

<xs:element name="ServerExceptions" type="xs:string" />

<xs:element name="faultstring" type="xs:string" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

But it does not work too.

I was reading the links that you gave me, but I think I'm doing something wrong because it does not work too.

Thank you

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Only If you find fault message in the WSDL for the webservice in addition to request and response then you can use that . Otherwise you cannot retrieve fault message information from the target sytem. If you dont find then request them to modify WSDL to provide one. You are consuming the webservice so you dont have any control. If they dont support you cannot do it.

sebastin_alvarez
Participant
0 Kudos

If I test it in Soap UI I get the Fault, and in WsNavigator I can see the FaultCode and FaultString as a message on the top of the page.

I do not know what more to do.

<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>Error al insertar Domicilio en servicio Empleado</faultstring>

<detail>

<FaultException:FaultException xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.interacciones.com.mx/ServicioEmpleado/" xmlns:FaultException="http://www.interacciones.com.mx/ServicioEmpleado/"/>

<ns2:exception class="mx.com.interacciones.servicioEmpleado.FaultException_Exception" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">

<message>Error al insertar Domicilio en servicio Empleado</message>

<ns2:stackTrace>

<ns2:frame class="mx.com.interacciones.servicioEmpleado.ServicioEmpleadoImpl" file="ServicioEmpleadoImpl.java" line="87" method="agregarEmpleado"/>

<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="101" method="invoke"/>

<ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="WLSInstanceResolver.java" line="83" method="invoke"/>

<ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="152" method="invoke"/>

<ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="264" method="invoke"/>

<ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/>

<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="604" method="__doRun"/>

<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="563" method="_doRun"/>

<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="548" method="doRun"/>

<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="445" method="runSync"/>

<ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="275" method="process"/>

<ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="454" method="handle"/>

<ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="250" method="handle"/>

<ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="140" method="handle"/>

<ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="319" method="run"/>

<ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="232" method="post"/>

<ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="310" method="doPost"/>

<ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="727" method="service"/>

<ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="87" method="service"/>

<ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" 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="292" method="execute"/>

<ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="175" method="execute"/>

<ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3594" method="run"/>

<ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="321" method="doAs"/>

<ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="121" method="runAs"/>

<ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2202" method="securedExecute"/>

<ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2108" method="execute"/>

<ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1432" method="run"/>

<ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="201" method="execute"/>

<ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="173" method="run"/>

</ns2:stackTrace>

</ns2:exception>

</detail>

</S:Fault>

</S:Body>

</S:Envelope>

sebastin_alvarez
Participant
0 Kudos

Hi All, the problem is solved.

Here's the solution.

The problem is (I think) PI does not recognize the entire structure, so you have to work with the detail part, but what I did is a XSL mapping to get the first tag, and that's all.

I know there must be better ways to do it, but here's my solution.

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >

<xsl:template match="/">

<ns0:Fault xmlns:ns0="http://www.test.com.mx/test/">

<ns0:error><xsl:value-of select="*"/></ns0:error>

</ns0:Fault>

</xsl:template>

</xsl:stylesheet>

Thanks to all of you.

Edited by: Sebastián Alvarez on Nov 17, 2011 8:25 PM

JaySchwendemann
Active Contributor
0 Kudos

I know, this is an old thread but since I'm just dealing with this topic and always banging my head against the wall every time, I thought I give my 2 cents about it. Maybe this helps someone else or myself in about 2 month of time to get ones head around this (again) So here it goes

When you use the standard Soap adapter without any extra module parameters PI only recognizes child nodes below the <detail> node.

If there's no detail node or the detail node has no subnodes but only plain text in it, PI will throw a system error instead an application error.

That being said, if the original soap fault message has a detail node, you could simply use a graphical mapping that starts with the subnode of the detail node.

Input Soap Fault:


<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>Error al insertar Domicilio en servicio Empleado</faultstring>

            <detail>

                <ns0:errorDetails xmlns:ns0="http://example.com">

                    <errorLine>42</errorLine>

                    <severity>fatal</severity>

                </ns0:errorDetails>

            </detail>

        </S:Fault>

    </S:Body>

</S:Envelope>

This would be dealt with a graphical fault mapping that uses an external definition as data type which starts with node <ns0:errorDetails xmlns:ns0="http://example.com">

HTH

Cheers

Jens