Hi all. Sorry for post this question here and not in Stack overflow, but we
have problems with the internet access in this days, as soon as I have
internet I repost the question with the answer in SO.

I have this scenario:

I consume some information from a data service and another information from
another data service and I want to merge this two information in a unique
response.

In this test I don´t use the data services, I use mock services in SOAPUI
and both mock services work fine separately .

The data I want to merge, an example:

Data service 1 response:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";
xmlns:obt="http://informatizacion.uci.cu/servicios/assets/ObtenerPersonas";>
   <soap:Header/>
   <soap:Body>
      <obt:Personas>
         <!--Zero or more repetitions:-->
         <obt:Persona>
            <obt:idExpediente>T123654</obt:idExpediente>
            <obt:primerNombre>yanet</obt:primerNombre>
            <obt:primerApellido>soraine</obt:primerApellido>
            <obt:segundoApellido>perez</obt:segundoApellido>
            <obt:sexo>F</obt:sexo>
            <obt:ci>920125848</obt:ci>
            <obt:provincia>matanzas</obt:provincia>
            <obt:municipio>varadero</obt:municipio>
            <obt:area>facultad5</obt:area>
            <obt:esDocente>false</obt:esDocente>
         </obt:Persona>
      </obt:Personas>
   </soap:Body>
</soap:Envelope>


Data service 2 response:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";
xmlns:preg="http://pregrado.uci.cu";>
   <soap:Header/>
   <soap:Body>
      <preg:Personas>
         <!--Zero or more repetitions:-->
         <preg:Persona>
            <preg:idExpediente>11111</preg:idExpediente>
            <preg:primerNombre>jorge</preg:primerNombre>
            <preg:primerApellido>infante</preg:primerApellido>
            <preg:segundoApellido>osorio</preg:segundoApellido>
            <preg:sexo>M</preg:sexo>
            <preg:ci>1221122112211221</preg:ci>
            <preg:provincia>holguin</preg:provincia>
            <preg:municipio>gibara</preg:municipio>
            <preg:area>CDAE</preg:area>
            <preg:esDocente>true</preg:esDocente>
         </preg:Persona>
         <preg:Persona>
            <preg:idExpediente>gero et</preg:idExpediente>
            <preg:primerNombre>sonoras imperio</preg:primerNombre>
            <preg:primerApellido>quae divum incedo</preg:primerApellido>
            <preg:segundoApellido>verrantque per
auras</preg:segundoApellido>
            <preg:sexo>per auras</preg:sexo>
            <preg:ci>circum claustra</preg:ci>
            <preg:provincia>nimborum in</preg:provincia>
            <preg:municipio>foedere certo</preg:municipio>
            <preg:area>profundum quippe ferant</preg:area>
            <preg:esDocente>false</preg:esDocente>
         </preg:Persona>
      </preg:Personas>
   </soap:Body>
</soap:Envelope>


So I build this proxy service:

<proxy xmlns="http://ws.apache.org/ns/synapse"; name="PersonaPoC"
transports="https,http" statistics="disable" trace="disable"
startOnLoad="true">
   <target inSequence="conf:/PersonaPoC/obtener_estudiantes"/>
   <publishWSDL key="conf:/wsdl/PersonaSimplev2.wsdl"/>
   <description></description>
</proxy>

With this sequences:

Name: obtener_estudiantes.

<sequence xmlns="http://ws.apache.org/ns/synapse";>
   <payloadFactory>
      <format>
         <preg:ObtenerEstudiantesPoC xmlns:preg="http://pregrado.uci.cu"/>
      </format>
   </payloadFactory>
   <send receive="conf:/PersonaPoC/guardar_Estudiantes">
      <endpoint>
         <address uri="http://destrono:8088/mockPregradoWSSOAP12Binding/"/>
      </endpoint>
   </send>
</sequence>

Name: guardar_Estudiantes.

<sequence xmlns="http://ws.apache.org/ns/synapse";>
   <enrich>
      <source clone="false" type="body"/>
      <target action="replace" type="property"
property="listado_estudiantes"/>
   </enrich>
   <payloadFactory>
      <format>
         <obt:ObtenerPersonasPoC
xmlns:obt="http://informatizacion.uci.cu/servicios/assets/ObtenerPersonas"/>
      </format>
   </payloadFactory>
   <log level="full"/>
   <send receive="conf:/PersonaPoC/unir_Personas">
      <endpoint>
         <address uri="http://destrono:8888/mockAssetsSOAP12Binding"/>
      </endpoint>
   </send>
</sequence>


At this point I see this error in the ESB when execute the service:

This is a log of the message send to the second service,
mockAssetsSOAP12Binding. I don´t know why appear this namespace:
xmlns:preg=http://pregrado.uci.cu  in the request because I don´t used it in
the payloadfactory mediator.

[2013-04-10 20:17:17,303]  INFO - LogMediator To:
http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
MessageID: urn:uuid:26b0c552-d8e6-4285-8814-84c595dae544, Direction:
response, Envelope: 
<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";
xmlns:preg="http://pregrado.uci.cu";>
      <soap:Body>
         <obt:ObtenerPersonasPoC
xmlns:obt="http://informatizacion.uci.cu/servicios/assets/ObtenerPersonas"/>
      </soap:Body>
</soap:Envelope>

The error:

[2013-04-10 19:49:30,472] ERROR - RelayUtils Error while building
Passthrough stream
org.apache.axiom.soap.SOAPProcessingException: Transport level information
does not match with SOAP Message namespace URI
        at
org.apache.axis2.builder.BuilderUtil.validateSOAPVersion(BuilderUtil.java:77
4)
        at
org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:58)
        at
org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocumen
t(DeferredMessageBuilder.java:146)
        at
org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUti
ls.java:150)
        at
org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtil
s.java:91)
        at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediat
or.java:62)
        at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.
java:114)
        at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2Syn
apseEnvironment.java:223)
        at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseC
allbackReceiver.java:443)
        at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbac
kReceiver.java:166)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217
)
        at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerP
ool.java:172)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
10)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
03)
        at java.lang.Thread.run(Thread.java:722)

when I used the data services in AS 5.1.0 I saw this error:
org.apache.axiom.soap.SOAPProcessingException: First Element must contain
the local name, Envelope , but found faultstring


If I put the TCPMon I can see this message exchange:

Incoming message:
POST /mockAssetsSOAP12Binding HTTP/1.1
Content-Encoding: gzip
Content-Type: application/soap+xml; charset=UTF-8
Server: Jetty(6.1.x)
Transfer-Encoding: chunked
Host: 127.0.0.1:8888
Connection: Keep-Alive

124
<?xml version='1.0' encoding='UTF-8'?><soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope";
xmlns:preg="http://pregrado.uci.cu";><soap:Body>
      
   <obt:ObtenerPersonasPoC
xmlns:obt="http://informatizacion.uci.cu/servicios/assets/ObtenerPersonas"/>
</soap:Body></soap:Envelope>
0


Outgoing message:
HTTP/1.1 500 Internal Server Error
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

1a0
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
  <soap:Body>
    <soap:Fault>
      <soap:Code>
        <soap:Value>Server</soap:Value>
      </soap:Code>
      <soap:Reason>
        <!--1 or more repetitions:-->
        <soap:Text xml:lang="en">java.io.IOException: Decompression of
response failed</soap:Text>
      </soap:Reason>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
0


This is the last sequence.
Name: unir_Personas.

<sequence xmlns="http://ws.apache.org/ns/synapse";>
   <enrich>
      <source clone="false" type="body"/>
      <target action=" sibling" type="property"
property="listado_estudiantes"/>
   </enrich>
   <send/>
</sequence>

Any idea?

Saludos,
Ing. Jorge Infante Osorio.
CDAE.
Fac. 5.
UCI.
“En un mundo perfecto las pizzas serían una comida saludable, las laptops se
cargarían desde una fuente de corriente inalámbrica y todos los JAR serían
bundles de OSGI ”



http://www.uci.cu
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to