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.
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
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.
Vinh
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 & PortWhen registering with a zone in Push mode, the ADK binds to a local IP address andport to listen for incoming messages from the zone integration server. It uses the Hostand Port properties from the TransportProperties object when binding the socket. Youset 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 bythe ADK in the following format, using these same hostname and port values.protocol://host:port/zone/ZoneIdConsider the following code in an agent’s initialize method:// Set the messaging mode to PushAgentProperties props = getProperties();props.setMessagingMode( AgentProperties.PUSH_MODE );// Set up the HTTP propertiesHttpProperties http = getDefaultHttpProperties();http.setHost( “agent.edustructures.com” );http.setPort( 12345 );// Connect to a zoneZone 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_URLelement 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 thanthose used to bind the local socket. With the 1.5 version of the ADK you can achievethis 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”, butwould 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>
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.