The SIF® Zone
creating, assimilating, and promoting excellence in SIF® agent development

Connection to Non Edustructures ZIS

rated by 0 users
Not Answered This post has 0 verified answers | 4 Replies | 2 Followers

Top 25 Contributor
10 Posts
Points 210
xvinh.nguyen posted on 02-24-2010 19:15

Hi,

Using the ADK, I am trying to connect via push to a non Edustructures ZIS, and zone. The URL the ZIS is receiving has /zone/zoneId attached. Somewhere along the line, the ADK has appened to my URL and port. i.e. https://myulr:8000/zone/100

Is there away to stop it doing this?

Regards,

Vinh. 

 

 

  • | Post Points: 25

All Replies

Top 10 Contributor
72 Posts
Points 1,495

Hi,

Are you using an agent.cfg file?  If you are you should see an element like:

    <zone id="Zone1" template="Default" url="http://localhost:7080/Zone1" />

where your url is defined.  You should be able to set this to whatever is required.

In this example, Agents connect to this zone via theURL:
    http://127.0.1.1:7080/Zone1

Does this help?

Jon

 

  • | Post Points: 25
Top 25 Contributor
10 Posts
Points 210

Hi Jonathan,

Thanks for the response. I am wording it incorrectly.

I can connect to the ZIS ok, the URL which i am sending to the ZIS for it to know where to send the push messages has the /Zone/100 appended. But I think this could be a Jetty web server setting, as it needs a httpcontext.

 

Regards,

Vinh

  • | Post Points: 25
Top 10 Contributor
72 Posts
Points 1,495

Hi Vihn,

I believe the answer is that you can control everything except for ' /zone'.

Here is an excerpt from the ADK Developer's Guide which I believe explains the ADK's behavior:

SIF_URL Hostname & Port
When registering with a zone in Push mode, the ADK binds to a local IP address and
port to listen for incoming messages from the zone integration server. It uses the Host
and Port properties from the TransportProperties object when binding the socket. You
set these values by obtaining the HttpProperties object from the agent and then call-
ing the setHost and setPort methods as needed. The SIF_Protocol/SIF_URL ele-
ment included with each zone’s SIF_Register message is automatically prepared by
the ADK in the following format, using these same hostname and port values.
protocol://host:port/zone/ZoneId

Consider the following code in an agent’s initialize method:
// Set the messaging mode to Push
AgentProperties props = getProperties();
props.setMessagingMode( AgentProperties.PUSH_MODE );
// Set up the HTTP properties
HttpProperties http = getDefaultHttpProperties();
http.setHost( “agent.edustructures.com” );
http.setPort( 12345 );

// Connect to a zone
Zone testZone = getZoneFactory().getInstance(
“Test”, “http://zis:7080/Test”);
testZone.connect( ADKFlags.PROV_REGISTER );

When connecting to the zone, the ADK would bind to the port 12345 on the local ma-
chine at address “agent.edustructures.com”. The SIF_Register/SIF_Protocol/SIF_URL
element sent to the zone would be formatted as follows:
<SIF_URL>http://agent.edustructures.com:12345/zone/Test</SIF_URL>

In some cases it is necessary to specify a different SIF_URL hostname and port than
those used to bind the local socket. With the 1.5 version of the ADK you can achieve
this by calling two new methods of the HttpTransport class: setPushHost and set-
PushPort.
For example,
HttpProperties http = getDefaultHttpProperties();
http.setHost( “localhost” );
http.setPushHost( “agents01.edustructures.com” );
http.setPort( 12345 );
http.setPushPort( 12345 );

This code would cause the agent to bind on the local address “localhost:12345”, but
would send a SIF_URL value with “agents01.edustructures.com:12345” as the host-
name and port the zone integration server will use to contact the agent.
<SIF_URL>http://agent01.edustructures.com:12345/zone/Test</SIF_URL>

 

Jon

  • | Post Points: 25
Top 25 Contributor
10 Posts
Points 210

Hi Jonathan,

Thanks for the excerpt. You are correct, the /zone is mandatory and added on by the framework.

I finally got the  agent and the zone to connect, setting the properties mention at the bottom.

It is ironic that such a key point is at the very end of the dev guide!

Thanks for your help.

Regards,

Vinh.

 

  • | Post Points: 5
Page 1 of 1 (5 items) | RSS
Copyright ©2006-2009 sifzone.com
Sponsored by Edustructures
We Connect the Systems that Power Education
 
SIF and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.