You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Yari Marchetti <ma...@vanel.lightning.eu.org> on 2007/07/02 12:58:08 UTC

Deploy & TCPTransport

Hi everyone,
i'm trying to develop an axis service with a tcptransport, but i really
cant find a way to get it to work.
I start the tcpserver with a given port (7777) and a repository, with
only 1 service file deployed (ConnectionManager.aar).
The problem arise when i try to connect to it, because the ServiceClient
keeps receiving exceptions:

The service cannot be found for the endpoint reference (EPR)

for the connection i use this simple code:

        ServiceClient service = new ServiceClient();
        Options o = new Options();
        EndpointReference er = new
EndpointReference("tcp://localhost:777/ConnectionManager");
        o.setTo(er);
        o.setTransportInProtocol( "tcp");
        service.setOptions(o);
       service.sendReceive(payload);

but it seems im missing something, or im doing something wrong....
thx to anyone who can help, and sorry for my bad english

best regards,
Marchetti Yari

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Deploy & TCPTransport

Posted by Yari Marchetti <ma...@vanel.lightning.eu.org>.
yesterday i tried again but i cannot really find a way
to use ws-addressing. The code below seems to work, i think im doing
something wrong in the addressing part.
is this

EndpointReference er = new
EndpointReference("tcp://localhost:777/ConnectionManager");

a correct way to specify the EPR + service name with a tcp client/server?

Yari Marchetti ha scritto:
> thx a lot for the answer.
> i read the document and did how it was told, but i keep getting the same
> error.
> Here is the code snippet i use:
>
> TCPServer t = new TCPServer(7777,"C:\\axis2"); //axis2.xml  in this
> repository contains <module ref="addressing"/>
> t.start();
> ConfigurationContext cc =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:\\test\\prova",
> "C:\\test\\axis2.xml");//repository with addressing module
> ServiceClient service = new ServiceClient(cc,null);
> service.engageModule("addressing");
> Options o = new Options(); 
> EndpointReference er = new
> EndpointReference("tcp://localhost:777/ConnectionManager");
> o.setTo(er);
> o.setAction("PerformNetworkMonitoring");
> service.setOptions(o);
>  service.sendReceive(payload);
>
> The service name is ConnectionManager and the operation is
> PerformNetworkMonitoring. Using TCPMon i was able
> to sniff the packet and i can see there is no reference to the service
> name (in the W3C document http://www.w3.org/Submission/ws-addressing/
> there is a <wsa:ServiceName
> PortName="/xs:NCName/"?>/xs:QName/</wsa:ServiceName> but i cant find a
> way to set it), so i dont
> really know how the service dispatcher could dispatch this request.
>
> thx for any help
> yari
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Deploy & TCPTransport

Posted by Yari Marchetti <ma...@vanel.lightning.eu.org>.
thx a lot for the answer.
i read the document and did how it was told, but i keep getting the same
error.
Here is the code snippet i use:

TCPServer t = new TCPServer(7777,"C:\\axis2"); //axis2.xml  in this
repository contains <module ref="addressing"/>
t.start();
ConfigurationContext cc =
ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:\\test\\prova",
"C:\\test\\axis2.xml");//repository with addressing module
ServiceClient service = new ServiceClient(cc,null);
service.engageModule("addressing");
Options o = new Options(); 
EndpointReference er = new
EndpointReference("tcp://localhost:777/ConnectionManager");
o.setTo(er);
o.setAction("PerformNetworkMonitoring");
service.setOptions(o);
 service.sendReceive(payload);

The service name is ConnectionManager and the operation is
PerformNetworkMonitoring. Using TCPMon i was able
to sniff the packet and i can see there is no reference to the service
name (in the W3C document http://www.w3.org/Submission/ws-addressing/
there is a <wsa:ServiceName
PortName="/xs:NCName/"?>/xs:QName/</wsa:ServiceName> but i cant find a
way to set it), so i dont
really know how the service dispatcher could dispatch this request.

thx for any help
yari

Deepal Jayasinghe ha scritto:
> Hi  Yari ,
> When you start the server , you have to give axis2.xml or there will be
> axis2.xml in your repository . Please add
> <module ref="addressing"/> , there in that axis2.xml.
>
> In the client side , you have to call
>
> ServiceClient client = new ServiceClient();
> client.engageModule("addressing");
>
>
> The problem is discuss in http://wso2.org/library/233
>
> Thanks
> Deepal
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Deploy & TCPTransport

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi  Yari ,
When you start the server , you have to give axis2.xml or there will be
axis2.xml in your repository . Please add
<module ref="addressing"/> , there in that axis2.xml.

In the client side , you have to call

ServiceClient client = new ServiceClient();
client.engageModule("addressing");


The problem is discuss in http://wso2.org/library/233

Thanks
Deepal
> first thanks for the quick answer.
> what do u mean with i should engage addressing? could you point me in
> the right
> direction? i tried to look everywhere but the only thing i could find
> was the short
> page in the axis project, but i couldnt figure out how to solve the
> addressing problem..
>
> thx,
> yari
>
> Deepal Jayasinghe ha scritto:
>   
>> TCP only works when you engage addressing in both server side and client
>> side.
>>
>> Thanks
>> Deepal
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>   

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Deploy & TCPTransport

Posted by Yari Marchetti <ma...@vanel.lightning.eu.org>.
first thanks for the quick answer.
what do u mean with i should engage addressing? could you point me in
the right
direction? i tried to look everywhere but the only thing i could find
was the short
page in the axis project, but i couldnt figure out how to solve the
addressing problem..

thx,
yari

Deepal Jayasinghe ha scritto:
> TCP only works when you engage addressing in both server side and client
> side.
>
> Thanks
> Deepal
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Deploy & TCPTransport

Posted by Deepal Jayasinghe <de...@opensource.lk>.
TCP only works when you engage addressing in both server side and client
side.

Thanks
Deepal

Yari Marchetti wrote:
> Hi everyone,
> i'm trying to develop an axis service with a tcptransport, but i really
> cant find a way to get it to work.
> I start the tcpserver with a given port (7777) and a repository, with
> only 1 service file deployed (ConnectionManager.aar).
> The problem arise when i try to connect to it, because the ServiceClient
> keeps receiving exceptions:
>
> The service cannot be found for the endpoint reference (EPR)
>
> for the connection i use this simple code:
>
>         ServiceClient service = new ServiceClient();
>         Options o = new Options();
>         EndpointReference er = new
> EndpointReference("tcp://localhost:777/ConnectionManager");
>         o.setTo(er);
>         o.setTransportInProtocol( "tcp");
>         service.setOptions(o);
>        service.sendReceive(payload);
>
> but it seems im missing something, or im doing something wrong....
> thx to anyone who can help, and sorry for my bad english
>
> best regards,
> Marchetti Yari
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>   

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org