[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] Java Client in DMZ (HandleResolver.java)



"Unknown opCode in message: 0" sounds like a response has been sent instead of a request.  How is the "req" object constructed?

What you're doing should work.  I would recommend to use a higher-level method, though, as then you can take advantage of sessions for faster processing.  "sendRequestToSite" would be my preference.  You can get a SiteInfo, for example, from the siteinfo.bin in your handle server directory:

       SiteInfo site = new SiteInfo();
       FileInputStream fin = new FileInputStream("/path/to/siteinfo.bin");
       ByteArrayOutputStream bout = new ByteArrayOutputStream();
       byte buf[] = new byte[2048];
       int r;
       while((r=fin.read(buf))>=0) bout.write(buf, 0, r);
       Encoder.decodeSiteInfoRecord(bout.toByteArray(), 0, site);

"sendRequestToServerByProtocol" would also serve.

Robert  

On 2012-07-12, at 04:35 , Damian Ulbricht wrote:

> Hi,
> 
> currently I have a Handle-Server and a Java-Web-Application in the DMZ of our institution. The Web-Application will be used for Handle-Registration.
> 
> I wonder if there is a way to tell the HandleResolver-class to communicate only with our Handleserver. Or - is there a list of internet-hosts and -ports a handle-client must be able to talk to?
> 
> 
> Simply replacing
> 
> HandleResolver.processRequest(req)
> 
> with
> 
> HandleResolver.sendHdlTcpRequest(req,InetAddress.getByName("srvnName"),2641) 
> 
> does not work and throws a HandleException with code "1" and message "Unknown opCode in message: 0"
> 
> 
> Best Regards
> Damian
> 
> 
> 
> 
> -- 
> Damian Ulbricht
> Centre for GeoInformation Technology
> Phone: +49 331 288-2392
> Fax: +49 331 288-1703
> ------------------------------------------
> Helmholtz Centre Potsdam
> GFZ German Research Centre For Geosciences
> Public Law Foundation State of Brandenburg
> Telegrafenberg, D-14473 Potsdam
> 
> 
> _______________________________________________
> Handle-Info mailing list
> Handle-Info@cnri.reston.va.us
> http://www.handle.net/mailman/listinfo/handle-info


_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info