axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sharada Deshpande <sharad...@yahoo.com>
Subject TCP Transport from client
Date Wed, 08 Oct 2003 18:36:07 GMT
We have attempted to write a custom transport class
that connects to a TCP based XML provider(not AXis
based) and we are receiving a blank result. If we
check the contents of the message context in the
client we can see the correct returning xml string but
the call.invoke is not returning it deserialized to an
object. The object is returned with all values blank.
Does anyone have a similar working example we can
follow?

We tried to follow the TCP sample provided with the
axis. The only difference between our code and the
sample TCPSender code is, the sample is using the
BufferredInputStream for constructing the message
object and we are using a string object.

Thank you very much.

client code:

Call.addTransportPackage("xxx.yyy");
    Call.setTransportForProtocol("tcp",
xxx.yyy.tcp.TCPTransport.class);
        
EngineConfiguration defaultConfig =
            (new DefaultEngineConfigurationFactory()).
                getClientEngineConfig();
            SimpleProvider config = new
SimpleProvider(defaultConfig);
  SimpleTargetedChain c = new SimpleTargetedChain(new
xxx.yyy.tcp.TCPSender());
            config.deployTransport("tcp", c);

            Service service = new Service(config);
            Call call = (Call) service.createCall();
        
            call.setTransport(new
xxx.yyy.tcp.TCPTransport());
  call.registerTypeMapping(To.class, 
                        new
QName("urn:xxx.yyy.inquiry", "FDResponse"),           
             sf, df, false);
        
       
call.setOperationStyle(org.apache.axis.enum.Style.DOCUMENT);
       
call.setOperationUse(org.apache.axis.enum.Use.LITERAL);
       
        call.addParameter( XMLType.XSD_STRING,
XMLType.XSD_STRING, ParameterMode.IN );
        call.addParameter( new
QName("urn:xxx.yyy.inquiry", "FDResponse"),new
QName("urn:xxx.yyy.inquiry", "FDResponse"),
FDResponse.class, ParameterMode.OUT );
        call.setReturnType( new
QName("urn:xxx.yyy.inquiry", "FDResponse") );
       
call.setReturnClass(xxx.yyy.Inquiry.FDResponse.class);
        call.setReturnQName( new
QName("urn:xxx.yyy.inquiry", "FD") );
       
call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
       
call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
        call.setOperationName(new
javax.xml.namespace.QName("", "JDS"));
        call.setPortName(new QName("", "JDS"));
FDResponse _resp = (FDResponse) call.invoke(new
java.lang.Object[] {symbol});
call.getMessageContext().getCurrentMessage().writeTo(System.out);


TCPSender code:

 outMsg = new Message (Responsedata as a string with
soap envelope);
 outMsg.setMessageType(Message.RESPONSE);
 msgContext.setResponseMessage( outMsg ); 



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

Mime
View raw message