[MarkLogic Dev General] AngularJS to MarkLogic Connectivity Isssue

SateeshKumar Bheemsetty sateesh.bheemsetty at gmail.com
Mon Mar 30 20:23:16 PDT 2015

Hi Team,

I am trying to save a user entered[page developed in AngularJS] information
as a json document in Mark Logic through ML REST API but am facing below
issue :

*browser console:*
"NetworkError: 401 Unauthorized -
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at http://localhost:8003/v1/documents?uri=/docs/. This can
be fixed by moving the resource to the same domain or enabling CORS.

*In browser NetWork Tab it shows as below :*

<error-response xmlns="http://marklogic.com/xdmp/error">
  <status>Not Found</status>
  <message>RESTAPI-NODOCUMENT: (err:FOER0000) Resource or document does not
exist:  category: content message: /docs/userInfo.json

*code tried to connect :*
    method: 'PUT',
    url: 'http://localhost:8003/v1/documents?uri=/docs/userInfo.json',
    data: data1,
                'Access-Control-Allow-Origin': '*',
                'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE,
                'Access-Control-Allow-Headers': 'Content-Type,
}).success(function () {alert('Successfully Added In DB');});

My Angular JS web page is deployed in tomcat on port 7080 and my REST API
is located at 8003.Also i have not passed any credentials to connect ML and
am not not sure on how to pass authentication .

Could you please guide me in getting this resolved.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20150331/53b2fce8/attachment-0001.html 

More information about the General mailing list