I´ve been trying to write a Dummy Conector to Tomcat just to learn how I
must call an Adapter. It´s the first step to write a ISO-8583 connector.

For that, I instancialize an Request and Response (org.apache.coyote),
and set all attributes that I think to be necessary :

    request = new Request();
    response = new Response();
    ByteChunk inputChunk = new ByteChunk();
    InputBuffer inputBuffer = new ByteChunkInputBuffer(new ByteChunk());
    OutputBuffer outputBuffer = new ByteChunkOutputBuffer(new
ByteChunk());
    request.setInputBuffer(inputBuffer);
    response.setOutputBuffer(outputBuffer);

    // construct a fake request
    request.setResponse(response);
    request.setInputBuffer(inputBuffer);
    request.protocol().setString("HTTP/1.1");
    request.query().setString("");
    request.method().setString("GET");
    request.scheme().setString("http");
    request.serverName().setString("jlima-dsk1");
    request.requestURI().setString("/WebModule/servlet1");
    request.unparsedURI().setString("/WebModule/servlet1");
    request.queryString().setString("");
    request.setStartTime(System.currentTimeMillis());

After that, I try to invoke the container via an Adapter (
org.apache.coyote ), and finally I print the response.

adapter.service(request,response);

But what I got from the response is quit strange. I always get an 400
error, even when the host exist.

org.apache.coyote.Response.getMessage() = No Host matches server name
jlima-dsk1
org.apache.coyote.Response.getStatus() = 400

Do anybody know what I´m doing wrong ?

PS: I´m using J2SDK 1.4.2 and Tomcat 5.
                

Henrique Faria           Senior Consultant
Java Software Team      
tel:    55.11.3285 4699 
cel:    55.11.9811 8281 
fax:    55.11.3266 5121 
[EMAIL PROTECTED]       

Júlio Melhado Lima         Senior Consultant
Java Software Team      
tel:    55.11.3285 4699 
cel:    55.11.9811 8281 
fax:    55.11.3266 5121 
[EMAIL PROTECTED]       





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to