title: com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 403: Forbidden
body: <p>I am getting following error while using the SharePoint web service:</p>
  
  <blockquote>
    <p>com.sun.xml.internal.ws.client.ClientTransportException: The server<br>
    sent HTTP status code 403: Forbidden  at<br>
    com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(Unknown
    Source)   at<br>
    com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown
    Source)   at<br>
    com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown
    Source)   at<br>
    com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown
    Source)   at<br>
    com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown
    Source)   at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown<br>
    Source)   at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown<br>
    Source)   at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown<br>
    Source)   at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown<br>
    Source)   at com.sun.xml.internal.ws.client.Stub.process(Unknown<br>
    Source)   at<br>
    com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)<br>
      at<br>
    com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown<br>
    Source)   at<br>
    com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown<br>
    Source)   at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown 
    Source)   at com.sun.proxy.$Proxy34.getListItems(Unknown Source)  at<br>
    com.jw.sharepoint.examples.SharePointListExample.querySharePointFolder(SharePointListExample.java:67)
      at<br>
    com.jw.sharepoint.examples.SharePointListExample.main(SharePointListExample.java:50)</p>
  </blockquote>
  
  <p>I am trying to access SharePoint 2010 web service using the following code:</p>
  
  <pre><code>    public void querySharePointFolder(ListsSoap ls) throws Exception {  
          try
          {
              disableCertificateValidation();
          GetListItems.ViewFields viewFields = null;
          GetListItems.QueryOptions msQueryOptions = new GetListItems.QueryOptions();
          GetListItems.Query msQuery = new GetListItems.Query();
          msQuery.getContent().add(createSharePointCAMLNode(query));
          msQueryOptions.getContent().add(createSharePointCAMLNode(this.queryOptions));
          GetListItemsResponse.GetListItemsResult result = ls.getListItems(
                  properties.getProperty("folder"), "", msQuery, viewFields, "",
                  msQueryOptions, "");
          writeResult(result.getContent().get(0), System.out);
  
          Element element = (Element)result.getContent().get(0);
          NodeList nl = element.getElementsByTagName("z:row");
          for(int i = 0; i &lt; nl.getLength(); i++){
              Node node = nl.item(i);
              logger.debug("ID: " + node.getAttributes().getNamedItem("ows_ID").getNodeValue());
              logger.debug("FileRef: " + node.getAttributes().getNamedItem("ows_FileRef").getNodeValue());
          }
          }
          catch(Exception e)
          {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>But its showing the error at following line:</p>
  
  <pre><code>GetListItemsResponse.GetListItemsResult result = ls.getListItems(
                  properties.getProperty("folder"), "", msQuery, viewFields, "",
                  msQueryOptions, "");
  </code></pre>
  
  <p>Can you please help me out over this as after using different different approaches i am still getting the same issue 403: Forbidden.</p>
  
  <p>I am using the same credential here through which i had created the folder over SharePoint. Do I need any other privileges for that credential to get the access. </p>