[mapguide-users] Re: Configuration Error in MapviewerNet in MGOS 2.1

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Wed Feb 3 03:28:23 EST 2010


You are mixing the MaestroAPI and the regular API.
When you create a MaestroAPI connection, it automatically creates a 
session for you.
You can read the sessionId from the conn variable.

In your code, you will create two sessions.
You can either remove the MgUserInformation and related code,
or create the HttpServerConnection with the sessionid instead of the 
username/password.

The variable "layout" is of type WebLayout, yet you use it in a querystring.
The "&WEBLAYOUT=" should hold the resourceId, not the object.

A simple fix would be to change the line to:

<iframe id="I1" src="../mapviewernet/ajaxviewer.aspx?SESSION=<%=sessionId%>&WEBLAYOUT=<%=resrce%>"


Regards, Kenneth Skovhede, GEOGRAF A/S

On 03-02-2010 04:52, padmini godavarthi wrote:
>
>    Hi kenneth,
> Thanks for your reply.i have passed the input parameters to the
> ajaxviewer.aspx .but is shows the result as
>
>
> invalid repository type
> invalid repository type
>
> in browser .  just see my code
>
>
> Public sessionId As String
>      Public webLayout As String
>      Dim resrce As ResourceIdentifier
>      Public layout As WebLayout
>
> Dim realPath As String = Request.ServerVariables("APPL_PHYSICAL_PATH")
>          Dim configPath As String = realPath + "webconfig.ini"
>          MapGuideApi.MgInitializeWebTier(configPath)
>          Dim userinfo As MgUserInformation = New
> MgUserInformation("Administrator", "admin")
>          'Dim mgsiteconn As MgSiteConnection = New MgSiteConnection()
>          Dim site As MgSite = New MgSite()
>          site.Open(userinfo)
>          sessionId = site.CreateSession()
>          Dim host As Uri = New
> Uri("http://localhost/mapguide/mapagent/mapagent.fcgi")
>          Dim conn As HttpServerConnection = New HttpServerConnection(host,
> "Administrator", "admin", "en", True)
>          layout = conn.GetWebLayout("Library://sample/Layout.WebLayout")
>          resrce = New ResourceIdentifier("sample", ResourceTypes.WebLayout,
> sessionId)
>          conn.SaveResourceAs(layout, resrce)
>          HttpContext.Current.Session("sid") = sessionId
>          HttpContext.Current.Session("layout") = resrce
>
>
> and in source file(default.aspx)
>
>
>
>   <div>
>      <iframe id="titleframe"  runat="server" frameborder="1"  visible="true"
> src="title.html">
>      </iframe>
>   </div>
>
>       <iframe id="I1"
> src="../mapviewernet/ajaxviewer.aspx?SESSION=<%=sessionId%>&WEBLAYOUT=<%=layout%>"
>    
>>      
>
>      </iframe>
>
> is any thing wrong in my code??
>
> Regards,
> Padmini G.
>    


More information about the mapguide-users mailing list