Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-19-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
Problem with Silverlight and IceGrid deployment

Hi,

I'm having problem with having my Silverlight client locate the IceGrid server. It all worked fine locally, but when I deployed the Silverlight pages to IIS, i get error

Code:
Ice.ProtocolException
   reason = "invalid http response code: 12030"
Here are the configuration:

Grid:

Code:
IceGrid.InstanceName=DemoIceGrid

#
# The IceGrid locator proxy.
#
Ice.Default.Locator=DemoIceGrid/Locator:tcp -p 12000 -h 10.93.206.77 

#
# IceGrid registry configuration.
#
IceGrid.Registry.Client.Endpoints=tcp -p 12000 -h 10.93.206.77 
IceGrid.Registry.Server.Endpoints=tcp -h 10.93.206.77
IceGrid.Registry.Internal.Endpoints=tcp -h 10.93.206.77
IceGrid.Registry.Data=C:/Documents and Settings/Local Service/Local Settings/Application Data/ZeroC/icegrid/registry

IceGrid.Registry.DynamicRegistration=1

IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.SSLPermissionsVerifier=DemoIceGrid/NullSSLPermissionsVerifier
IceGrid.Registry.AdminSSLPermissionsVerifier=DemoIceGrid/NullSSLPermissionsVerifier
#
# IceGrid node configuration.
#
IceGrid.Node.CollocateRegistry=1
IceGrid.Node.Name=localhost
IceGrid.Node.Endpoints=tcp
IceGrid.Node.Data=C:/Documents and Settings/Local Service/Local Settings/Application Data/ZeroC/icegrid/node
IceGrid.Node.CollocateRegistry=1
#IceGrid.Node.Output=db
#IceGrid.Node.RedirectErrToOut=1

#
# Trace properties.
#
IceGrid.Node.Trace.Activator=1
IceGrid.Node.Trace.Patch=1
#IceGrid.Node.Trace.Adapter=2
#IceGrid.Node.Trace.Server=3

#
# Dummy username and password for icegridadmin.
#
IceGridAdmin.Username=foo
IceGridAdmin.Password=bar
Server:

Code:
#
# The server creates one single object adapter with the name
# "Hello". The following line sets the endpoints for this
# adapter.
#
Ice.ServerId=SimpleServer
Ice.ProgramName=SimpleServer
#Object adapter Hello
Hello.Endpoints=tcp
Hello.AdapterId=Hello
Hello.RegisterProcess=1
Ice.Default.Locator=DemoIceGrid/Locator:tcp -h 10.93.206.77 -p 4061


#
# Warn about connection exceptions.
#
#Ice.Warn.Connections=1

#
# We want a faster ACM for this demo.
#
Ice.ACM.Server=10

#
# Network Tracing
#
# 0 = no network tracing
# 1 = trace connection establishment and closure
# 2 = like 1, but more detailed
# 3 = like 2, but also trace data transfer
#
#Ice.Trace.Network=1

#
# Protocol Tracing
#
# 0 = no protocol tracing
# 1 = trace protocol messages
#
#Ice.Trace.Protocol=1

#
# Security Tracing
#
# 0 = no security tracing
# 1 = trace messages
#
#IceSSL.Trace.Security=1

#
# SSL plugin configuration
#
Ice.Plugin.IceSSL=icesslcs, Version=3.2.1.0, Culture=neutral, PublicKeyToken=1f998c50fec78381:IceSSL.PluginFactory
IceSSL.DefaultDir=../../../certs
IceSSL.ImportCert.CurrentUser.Root=cacert.pem
IceSSL.CertFile=s_rsa1024.pfx
IceSSL.Password=password
Ice.ThreadPerConnection=1
Server program:

Code:
 public override int run(string[] args)
    {
        Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Hello");
        Ice.Properties properties = communicator().getProperties();
        Ice.Identity id = communicator().stringToIdentity(properties.getProperty("Identity"));
        adapter.add(new HelloI(properties.getProperty("Ice.ServerId")), id);
        adapter.activate();
        communicator().waitForShutdown();
        return 0;
    }

Client - Global.asax

Code:
void Application_Start(Object sender, EventArgs e)
{  
    Ice.InitializationData initData = new Ice.InitializationData();
    initData.properties = Ice.Util.createProperties();
    //Ice.Properties prop = Ice.Util.createProperties();
    initData.properties.setProperty("Ice.Default.Locator", "DemoIceGrid/Locator:tcp -p 12000 -h 10.93.206.77");
    //initData.properties.load("ice.config");
    Application["com"] = Ice.Util.initialize(initData);

    //Application["com"] = Ice.Util.initialize();
}
and in the Page.xaml.cs, I create the proxy object as follows:

Code:
Ice.InitializationData initData = new Ice.InitializationData();
                initData.properties = Ice.Util.createProperties();
                initData.properties.setProperty("Ice.BridgeUri", "http://10.93.206.77/IceBridge/IceBridge.ashx");
                _comm = Ice.Util.initialize(initData);

                try
                {
                    _hello = Demo.HelloPrxHelper.uncheckedCast(_comm.stringToProxy("hello"));
                   
                    // _hello = Demo.HelloPrxHelper.uncheckedCast(_comm.stringToProxy("hello:tcp -p 10000"));
                    // _helloOneway = Demo.HelloPrxHelper.uncheckedCast(_hello.ice_oneway());
                }
                catch (Ice.NotRegisteredException)
                {             
                    IceGrid.QueryPrx query =
                        IceGrid.QueryPrxHelper.checkedCast(_comm.stringToProxy("DemoIceGrid/Query"));
                    _hello = HelloPrxHelper.checkedCast(query.findObjectByType("::Demo::Hello"));

                    
                }


Can you tell me what I am doing wrong?
Reply With Quote
  #2 (permalink)  
Old 03-19-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
The line in the Server config should read
Ice.Default.Locator=DemoIceGrid/Locator:tcp -p 12000 -h 10.93.206.77.

Still doesn't work on IIS.
Reply With Quote
  #3 (permalink)  
Old 03-20-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,060
In general, it is more convenient if you package up any sample code along with all configuration files, and project files (ie: as a self-contained, compilable example) in an archive and attach to the post, rather than post multiple code segments.

In this case, however, I suspect that you have not correctly configured the bridge. You must set Ice.Default.Locator on the bridge, not on the SL client, since it is the bridge that talks with IceGrid (the locator), not the client itself.

To fix this look at Global.asax:

Code:
void Application_Start(Object sender, EventArgs e)
{
    //Ice.InitializationData initData = new Ice.InitializationData();
    //initData.properties = Ice.Util.createProperties();
    //initData.properties.load("ice.config");
    //Application["com"] = Ice.Util.initialize(initData);
    Application["com"] = Ice.Util.initialize();
}
Change the code to load ice.config. Then in ice.config set Ice.Default.Locator to the correct location. Alternatively, you could set the locator manually.

Code:
void Application_Start(Object sender, EventArgs e)
{
    Ice.InitializationData initData = new Ice.InitializationData();
    initData.properties = Ice.Util.createProperties();
    initData.properties.setProperty("Ice.Default.Locator", "DemoIceGrid/Locator:tcp -p 12000 -h 10.93.206.77");
    Application["com"] = Ice.Util.initialize(initData);
}
Reply With Quote
  #4 (permalink)  
Old 03-24-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
I already have the configuration in the Global.asax to point to the Default Locator.

To configure the Bridge on IIS, I have followed the instructions in Issue 27, but I run into the following error when accessing IceBridge.ashx

Compiler Error Message: CS0117: 'Ice.InputStream' does not contain a definition for 'readBlob'.

I am hosting the bridge on IIS5.1, placed the Global.asax in the same directory as the IceBridge.ashx, with a bin folder for icecs.dll.
Reply With Quote
  #5 (permalink)  
Old 03-24-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,060
It seems that you are not using the icecs.dll that was distributed with the Silverlight distribution. From the INSTALL.txt:

In order to use Ice for Silverlight it is necessary to also install
Ice for C#. Specifically it is necessary to install a patched version
of the Ice for C# 3.2.1 icecs.dll. You can either download a
precompiled patched DLL or compile the Ice for C# sources yourself
after applying the patch to the Ice for C# source distribution.

The Ice for C# source distribution can be downloaded here:

http://www.zeroc.com/download.html

The precompiled DLL and the source patch can be downloaded here:

http://www.zeroc.com/labs/download.html

Once downloaded or compiled the DLL must be installed in the GAC:

gacutil -i icecs.dll
Reply With Quote
  #6 (permalink)  
Old 03-24-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
I am now using the icecs.dll that comes with the Silverlight distribution. However, running IceBridge.ashx gives the following exception in the event log:

Bridging Error: Ice.UnmarshalOutOfBoundsException
reason = (null)
at IceInternal.BasicStream.readBlob(Int32 sz)
at Ice.InputStreamI.readBlob(Int32 sz)
at IceBridge.Bridge.ProcessRequest(HttpContext context) in c:\Web Applications\IceBridge\IceBridge.ashx:line 110
Caused by: System.InvalidOperationException: buffer underflow
at IceInternal.ByteBuffer.checkUnderflow(Int32 size)
at IceInternal.ByteBuffer.get(Byte[] b, Int32 offset, Int32 length)
at IceInternal.ByteBuffer.get(Byte[] b)
at IceInternal.BasicStream.readBlob(Int32 sz).

Are there any additional configuration not mentioned in Issue 27 that I could be missing in the bridge configuration? - MIME type, permissions ?

Running the Silverlight app still returns Ice exception
Ice.ProtocolException
reason = "invalid http response code: 12030"

Last edited by JNg : 03-24-2008 at 03:39 PM.
Reply With Quote
  #7 (permalink)  
Old 03-25-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,060
The reported readBlob exception is failing when trying to unmarshal the Ice magic number, which is the start of the request payload. This means that the message payload is not received at all by the bridge application. Most likely the problem is that you are missing the necessary MIME types for the request octet data. The transferred Ice request data is MIME content type "application/binary". The 12030 received by the Ice for SL client is caused by the above failure. Once this failure is rectified then that should go away.

We have only tested Ice for SL with IIS 7.0, so I am not exactly sure what is necessary to get IIS 5.1 to work in this situation. Is there any way you could use IIS 7, or the Mono ASP.NET web server for your tests?
Reply With Quote
  #8 (permalink)  
Old 03-25-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
Unfortunately, I only have IIS5.1 and IIS6 to test against.

What would be the extension for MIME type application/binary?
Reply With Quote
  #9 (permalink)  
Old 03-25-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,060
I'm sorry, but I'm not exactly sure how to configure IIS 5.1/6.0. You can download a free version of the mono ASP.NET web server to test against at Main Page - Mono.

If your organization is interested in commercially licensing Ice we can investigate IIS 5.1/6 support further. If interested, please contact us at sales@zeroc.com.
Reply With Quote
  #10 (permalink)  
Old 04-09-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,060
The most likely cause of this problem is that you have not enabled PUT on the bridge (IceBridge.ashx). If you do not enable PUT then all calls on the bridge will be rejected with permission denied.
Reply With Quote
  #11 (permalink)  
Old 04-10-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
I have configured the app to add PUT to the list of verbs for the .ashx extension.

Pls find attached the IIS configuration for the web app that contains the bridge.

Thanks for helping.
Attached Files
File Type: zip IIS_IceBridge.zip (66.9 KB, 14 views)
Reply With Quote
  #12 (permalink)  
Old 04-11-2008
JNg JNg is offline
Registered User
 
Name: Jennifer Ng
Organization: RBC
Project: Ice for Silverlight sample
 
Join Date: Feb 2008
Posts: 18
I have also tried Mod Mono for win32 (Apache 2.0.59 and Mono 1.2.6) using the windows patch from
mod_mono-win32 - mod_mono port for Apache 2 (and 2.2) under windows

i cannot get the Mod Mono server to run. Do you know whether this should run fine on win32?

Last edited by JNg : 04-11-2008 at 09:33 PM.
Reply With Quote
  #13 (permalink)  
Old 04-12-2008
xdm's Avatar
xdm xdm is offline
ZeroC Staff
 
Name: José Gutíerrez de la Concha Martínez
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Sep 2003
Location: La Coruña, Spain
Posts: 292
Hi Jennifer.

I have been testing IceSl with IIS-5.5 and is working fine for me.

I have attached the screens of my IIS configuration for the IceSl hello demo.

Also from your error i think that there is a problem with file rigths, not sure .
The files need the correct right acces for IIS can serve it, Make sure that the IIS user can read and execute IceBridge.ashx & Global.asax

IIS use by default the account IISUSR_(MachineName) for annonymous access. If your machine name
is SIUX the name of IIS user will be IISUSR_SIUX.

have you enabled logs on IIS and view if there is any HTTP error in the Windows Event Viewer.

Also if all fails you can add same trace in the IceBridge.ashx and view where the error cames.

Use this for log to the Event viewer form IceBridge.ashx
Code:
 _log.WriteEntry("foo");
Hope this help
Attached Files
File Type: zip iss-setup.zip (548.9 KB, 14 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Silverlight - IceGrid JNg Help Center 6 02-27-2008 03:26 PM
ICE for Silverlight kwaclaw Comments 8 01-31-2008 12:14 PM
Silverlight and ICE kwaclaw Comments 2 06-21-2007 02:23 PM
Deployment with v3.2 Kruppy Help Center 12 05-15-2007 10:50 AM
A very complex deployment, Does it possible? weixiande Help Center 2 12-12-2004 03:25 AM


All times are GMT -4. The time now is 09:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.