Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Sitecore Mobile SDK for Xamarin

Rajesh.6969Rajesh.6969 USMember
edited June 2015 in Xamarin.Android

Hi,
I am working on SiteCore Mobile Sdk in xamarin android,i downloaded sample project from https://components.xamarin.com/view/sitecore.mobile.sdk.
I modified my code as per my requirement changed instanceUrl and credentials and executed code it is not showing output.My Application Output shows

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Sitecore.MobileSDK.API.Exceptions.RsaHandshakeException: [Sitecore Mobile SDK] Public key not received properly ---> System.Xml.XmlException: Document Type Declaration (DTD) is prohibited in this XML. Line 4, position 10.
[MonoDroid] at Mono.Xml2.XmlTextReader.ReadDoctypeDecl () [0x00000] in :0
[MonoDroid] at Mono.Xml2.XmlTextReader.ReadDeclaration () [0x00000] in :0
[MonoDroid] at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in :0
[MonoDroid] at Mono.Xml2.XmlTextReader.Read () [0x00000] in :0
[MonoDroid] at System.Xml.XmlTextReader.Read () [0x00000] in :0
[MonoDroid] at Sitecore.MobileSDK.PublicKey.PublicKeyXmlParser.Parse (System.IO.Stream xmlStream, CancellationToken cancelToken) [0x00000] in :0
[MonoDroid] at Sitecore.MobileSDK.PublicKey.GetPublicKeyTasks+<>c__DisplayClass11.b__d () [0x00000] in :0
[MonoDroid] at System.Threading.Tasks.TaskActionInvoker+FuncInvoke1[Sitecore.MobileSDK.PublicKeyX509Certificate].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 [MonoDroid] at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 [MonoDroid] at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 [MonoDroid] --- End of inner exception stack trace --- [MonoDroid] at Sitecore.MobileSDK.ScApiSession+<GetPublicKeyAsync>d__0.MoveNext () [0x00000] in <filename unknown>:0 [MonoDroid] --- End of stack trace from previous location where exception was thrown --- [MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 [MonoDroid] at System.Runtime.CompilerServices.TaskAwaiter1[Sitecore.MobileSDK.API.Items.ScItemsResponse].GetResult () [0x00000] in :0
[MonoDroid] at AndroidMobileSdkDemo.MainActivity+d__2.MoveNext () [0x000d0] in c:\Users\Ashok v\Downloads\Sitecore.Mobile.SDK-1.0\samples\AndroidMobileSdkDemo\AndroidMobileSdkDemo\MainActivity.cs:44
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable

help me for solving this issue .

Tagged:

Posts

  • Rajesh.6969Rajesh.6969 USMember

    Can anybody please help me out here?

  • ThuatNguyenThuatNguyen USMember

    I also have the same problem.

  • @ThuatNguyen said:
    I also have the same problem.

    Please visit stackoverflow and check that answer solved your problem.

  • IgorIgor USMember
    edited January 2016

    Public key not received properly

    Possible reason, that Item Web API can be disabled by default. You should enable it in instanceUrl\Website\App_Config\Include\Sitecore.ItemWebApi.config

    Simply replace the node

    <site name="website">
            <patch:attribute name="itemwebapi.mode">Off</patch:attribute>
            <patch:attribute name="itemwebapi.access">ReadOnly</patch:attribute>
            <patch:attribute name="itemwebapi.allowanonymousaccess">false</patch:attribute>
    </site>
    with
    
    <site name="website">
            <patch:attribute name="itemwebapi.mode">StandardSecurity</patch:attribute>
            <patch:attribute name="itemwebapi.access">ReadOnly</patch:attribute>
            <patch:attribute name="itemwebapi.allowanonymousaccess">true</patch:attribute>
    </site>
    

    If you want your anonymous user to have readonly access for the website.
    You can find more details here:
    https://sdn.sitecore.net/upload/sdn5/modules/sitecore item web api/sitecore_item_web_api_developer_guide_sc65-66-a4.pdf, 'Security' chapter.

  • ThuatNguyenThuatNguyen USMember

    Please visit stackoverflow and check that answer solved your problem.

    @Andriy Mativskiy, this question was created by myself on stackoverflow. Thank you !

  • hi Rajesh.6969 - were you able to resolve this issue (Sitecore.MobileSDK.API.Exceptions.RsaHandshakeException: [Sitecore Mobile SDK] Public key not received properly). ? please let me know the solution, if you happens to overcome this?

Sign In or Register to comment.