I have a problem

I'm using PAYLOAD with an external service 
I am using bluesprint.

    <camelcxf:cxfEndpoint id="datosciudadanos"
    address="${urlServicioEnEsb.DatosCiudadanosLDAPService}"
    wsdlURL="http://190.152.146.149:8080/WEBRegCiv/WSRegistroCivil?wsdl";>
    <camelcxf:inInterceptors>
        <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
        <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
             <property name="properties">
                <map>
                    <entry key="action" value="UsernameToken" />
                    <entry key="passwordType" value="PasswordText" />
                    <entry key="passwordCallbackRef">
                            <ref component-id="myPasswordCallback"/>
                    </entry>
                </map>
            </property>
        </bean>
    </camelcxf:inInterceptors>
    </camelcxf:cxfEndpoint>

    <camel:camelContext id="camel"
xmlns="http://camel.apache.org/schema/blueprint";>
        <route streamCache="true">
           <from uri="cxf:bean:datosciudadanos?dataFormat=PAYLOAD"/>
           <to uri="routerDatosCiudadanosService"/>
        </route>
    </camel:camelContext>


when running the web service with soap-ui
process procedure is executed:


public void process(Exchange exchange) throws Exception


I get the error on the client sending soap-ui parameters
following:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Body>
      <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:Client</faultcode>
               <faultstring>Couldn't create SOAP message due to exception:
unexpected XML tag. expected:
{http://schemas.xmlsoap.org/soap/envelope/}Envelope but found:
{http://registrocivil.gob.ec/}busquedaPorCedula</faultstring>
            </S:Fault>
         </S:Body>
      </S:Envelope>
   </soap:Body>
</soap:Envelope>

in the process (Exchange exchange) is the following code.

public void process(Exchange exchange) throws Exception {

        //Check the headers for the call
        HttpServletRequest request =
exchange.getIn().getBody(HttpServletRequest.class);

        //Are they requesting a WSDL?
        if (exchange.getIn().getHeaders().containsKey("wsdl")) {
            String wsdl = getWsdl(exchange.getOut());
            if (wsdl == null) {
                return;
            }

            exchange.getOut().setHeader("Content-Type", "text/xml;
charset=utf-8");
            exchange.getOut().setBody(wsdl);

            return;

        }

        //Are they requesting a xsd?
        if (request.getMethod().equals("GET")) {
            String caller = ((Request) request).getRootURL().toString() +
request.getRequestURI();
            getOther(caller, request.getQueryString(), exchange.getOut());
            return;
        }

        String body = exchange.getIn().getBody(String.class);

        AbstractBuffer buf = new ByteArrayBuffer(body.getBytes("UTF-8"));
        ContentExchange httpExchange = new ContentExchange(true);
        httpExchange.setURL(address);
        httpExchange.setRequestContent(buf);
        httpExchange.setMethod("POST");
        httpExchange.setRequestContentType("text/xml; charset=utf-8");

        String soapAction = (String)
exchange.getIn().getHeader("SOAPAction");
        if (soapAction != null) {
            httpExchange.setRequestHeader("SOAPAction", soapAction);
        }

        client.send(httpExchange);

        // Waits until the exchange is terminated
        int exchangeState = httpExchange.waitForDone();

        if (exchangeState == HttpExchange.STATUS_COMPLETED) {
            exchange.getOut().setHeader("Content-Type",
httpExchange.getResponseFields().getStringField("Content-Type"));
            exchange.getOut().setBody(httpExchange.getResponseContent());

        } else if (exchangeState == HttpExchange.STATUS_EXCEPTED) {
            sendError(exchange.getOut(), "Error occurred retrieving SOAP
from " + address);
        } else if (exchangeState == HttpExchange.STATUS_EXPIRED) {
            sendError(exchange.getOut(), "Error occurred retrieving SOAP
from " + address);
        }

when I deploy this in service mix and return the wsdl but i cant ejecute
with soap-ui


att
Luiggi








--
View this message in context: 
http://servicemix.396122.n5.nabble.com/problem-with-procedure-process-with-PAYLOAD-tp5714728.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Reply via email to