[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-java-user
Subject:    Re: [User] Problem with API in ESB
From:       "Jorge Infante Osorio" <jorgeio () uci ! cu>
Date:       2012-05-19 3:25:32
Message-ID: !&!AAAAAAAAAAAYAAAAAAAAADEDMahRnnVKvgclMiDfrb3CgAAAEAAAAJCKWGrnePBIs9SV5P+Omg8BAAAAAA== () uci ! cu
[Download RAW message or body]

Hi all.
Any idea on this?

Saludos,
Ing. Jorge Infante Osorio.
J´Dpto Soluciones SOA.
CDAE.
Fac. 5.
UCI.

De: user-bounces@wso2.org [mailto:user-bounces@wso2.org] En nombre de Jorge
Infante Osorio
Enviado el: miércoles, 16 de mayo de 2012 2:28
Para: user@wso2.org
Asunto: [User] Problem with API in ESB

Hi all.
I have this API:

<api xmlns="http://ws.apache.org/ns/synapse" name="DatosUsuarios"
context="/datos">
   <resource methods="GET" uri-template="/listadousuarios"
inSequence="RESTin" outSequence="RESTout" faultSequence="fault" />
   <resource methods="GET" uri-template="/getporid/{id}"
inSequence="RESTinid" outSequence="RESToutid" faultSequence="fault" />
</api>

I want to call it in this way: curl -v
http://127.0.0.1:8280/datos/getporid/1 but the request in the BE it´s
malformed. 


The Sequence RESTinid:

<sequence xmlns="http://ws.apache.org/ns/synapse" name="RESTinid"
trace="enable">
    <log level="full" category="DEBUG"/>
    <payloadFactory>
        <format>
            <axis2ns37:_getdatosusuario_id
xmlns:axis2ns37="http://cdae.uci.cu/servicios/">
                <axis2ns37:id>$1</axis2ns37:id>
            </axis2ns37:_getdatosusuario_id>
        </format>
        <args>
            <arg xmlns:ns="http://org.apache.synapse/xsd"
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns3="http://org.apache.synapse/xsd"
expression="get-property('uri.var.id')"/>
        </args>
    </payloadFactory>
    <send>
        <endpoint>
            <address
uri="http://127.0.0.1:9765/services/DatosUsuariosREST.HTTPEndpoint/datosusua
rio" format="rest"/>
        </endpoint>
    </send>
</sequence>

With the payloadFactory mediator I have this error in the message format in
the BE restful service deploy in AS:

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Header />
   <soapenv:Body>
      <axis2ns57:_getdatosusuario_id
xmlns:axis2ns57="http://cdae.uci.cu/servicios/">
         <axis2ns57:id>datos/getporid/1</axis2ns57:id>
         <axis2ns57:id>1</axis2ns57:id>
      </axis2ns57:_getdatosusuario_id>
   </soapenv:Body>
</soapenv:Envelope>

Without the payloadFactory I see this:

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Header />
   <soapenv:Body>
      <axis2ns56:_getdatosusuario_id
xmlns:axis2ns56="http://cdae.uci.cu/servicios/">
         <axis2ns56:id>datos/getporid/1</axis2ns56:id>
      </axis2ns56:_getdatosusuario_id>
   </soapenv:Body>
</soapenv:Envelope>

In any case I don´t know why I get this value: datos/getporid/1

In ESB I see this error:
Message ID : urn:uuid:b82cbd23-2c74-4e6f-9aeb-6b711c8f779e] [Status
Completed : true] [Status SendingCompleted : true]
[2012-05-16 02:19:44,816]  WARN - ClientWorker Unexpected response received.
HTTP response code : 500 HTTP status : Internal Server Error exception :
com.c
tc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected
</HR>.
at [row,col {unknown-source}]: [67,187]
[2012-05-16 02:19:44,818] ERROR - NativeWorkerPool Uncaught exception
java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMTextImpl
cannot be cast to org.apache.axiom.om.OMElement
        at
org.apache.synapse.util.MessageHelper.cloneSOAPFault(MessageHelper.java:441)
        at
org.apache.synapse.util.MessageHelper.cloneSOAPEnvelope(MessageHelper.java:2
54)
        at
org.apache.synapse.core.axis2.SOAPUtils.convertSOAP11toSOAP12(SOAPUtils.java
:95)
        at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseC
allbackReceiver.java:323)
        at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbac
kReceiver.java:160)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
        at
org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:275)
        at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerP
ool.java:173)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
        at java.lang.Thread.run(Thread.java:662)

The out sequence:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="RESTout"
trace="enable">
    <send/>
</sequence>


I try the BE service with curl, and all it´s fine.
curl
http://127.0.0.1:9765/services/DatosUsuariosREST.HTTPEndpoint/datosusuario/1


Saludos,
Ing. Jorge Infante Osorio.
J´Dpto Soluciones SOA.
CDAE.
Fac. 5.
UCI.









10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION

http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci
_______________________________________________
User mailing list
User@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic