Access Denied Error While invoking WebService Method

Hi,
When i am trying to invoke web service method from client machine, it throws an Error 401 - Access Denied (Detail Error Shown below)....
Please let me know to set WindowsAuthentication UserName and Password in WebService calling through Java. Here Iam using Stub class to connect WebService through Java...
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)Access Denied
faultActor:
faultNode:
faultDetail:
     {}:return code: 401
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr>
<head>
<style>
a:link {font:8pt/11pt verdana; color:FF0000}
a:visited {font:8pt/11pt verdana; color:#4e4e4e}
</style>
<META NAME="ROBOTS" CONTENT="NOINDEX">
<title>You are not authorized to view this page</title>
<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>
<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
     //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
     DocURL=document.URL;
     //this is where the http or https will be, as found by searching for :// but skipping the res://
     protocolIndex=DocURL.indexOf("://",4);
     //this finds the ending slash for the domain server
     serverIndex=DocURL.indexOf("/",protocolIndex + 3);
     //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
     //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
     //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
     BeginURL=DocURL.indexOf("#",1) + 1;
     urlresult=DocURL.substring(BeginURL,serverIndex);
     //for display, we need to skip after http://, and go to the next slash
     displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
     InsertElementAnchor(urlresult, displayresult);
function HtmlEncode(text)
return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
function TagAttrib(name, value)
return ' '+name+'="'+HtmlEncode(value)+'"';
function PrintTag(tagName, needCloseTag, attrib, inner){
document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
if (needCloseTag) document.write( '</' + tagName +'>' );
function URI(href)
IEVer = window.navigator.appVersion;
IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
encodeURI(href) :
escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
function InsertElementAnchor(href, text)
PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
//-->
</script>
<body bgcolor="FFFFFF">
<table width="410" cellpadding="3" cellspacing="5">
<tr>
<td align="left" valign="middle" width="360">
     <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->You are not authorized to view this page</h1>
</td>
</tr>
<tr>
<td width="400" colspan="2">
     <font style="COLOR:000000; FONT: 8pt/11pt verdana">You do not have permission to view this directory or page using the credentials you supplied.</font></td>
</tr>
<tr>
<td width="400" colspan="2">
     <font style="COLOR:000000; FONT: 8pt/11pt verdana">
     <hr color="#C0C0C0" noshade>
<p>Please try the following:</p>
<ul>
<li>Click the Refresh button to try again with different credentials.</li>
<li>If you believe you should be able to view this directory or page, please contact the Web site administrator by using the e-mail address or phone number listed on the
     <script>
     <!--
     if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
          Homepage();
     //-->
     </script>
     home page.</li>
</ul>
<h2 style="font:8pt/11pt verdana; color:000000">HTTP 401.2 - Unauthorized: Logon failed due to server configuration<br>
Internet Information Services</h2>
     <hr color="#C0C0C0" noshade>
     <p>Technical Information (for support personnel)</p>
     <ul>
     <li>Background:<br>
     This is usually caused by a server-side script not sending the proper WWW-Authenticate header field. Using Active Server Pages scripting this is done by using the <strong>AddHeader</strong> method of the <strong>Response</strong> object to request that the client use a certain authentication method to access the resource.
<p>
<li>More information:<br>
Microsoft Support
</li>
</p>
</ul>
     </font></td>
</tr>
</table>
</body>
</html>
     {http://xml.apache.org/axis/}HttpErrorCode:401
(401)Access Denied
     at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
     at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
     at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
     at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
     at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
     at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
     at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
     at org.apache.axis.client.Call.invoke(Call.java:2767)
     at org.apache.axis.client.Call.invoke(Call.java:2443)
     at org.apache.axis.client.Call.invoke(Call.java:2366)
     at org.apache.axis.client.Call.invoke(Call.java:1812)
     at engine.citynet_dta.IDTAEngineStub.sendMessage(IDTAEngineStub.java:219)
     at test.Test.main(Test.java:37)

I hope the sun forum can help for me. Lets see

Similar Messages

  • Error while invoking webservice throu https

    Error while invoking webservice throu https://
    can any one help me on this topic please:
    CODE:
    SOAPConnection con = null;
              try{
                   String endpoint = "https://wks3089639:4565/Service.serviceagent/PortTypeEndpoint1";
                   //String endpoint = "http://wks3101999:5539/Service.serviceagent/PortTypeEndpoint1";
                   //String endpoint      = args[0];
                   //String soapAction      = args[1];
                   System.out.println("javax.net.ssl.keyStore-->"+System.getProperty("javax.net.ssl.trustStore"));
                   System.setProperty("javax.net.ssl.trustStore","C:/Documents and Settings/1067555/Desktop/certificates/cer.jks");
                   System.setProperty("javax.net.ssl.keyStore","C:/Documents and Settings/1067555/Desktop/certificates/server.keystore");
                   System.setProperty("javax.net.ssl.trustStorePassword","password");
                   System.setProperty("javax.net.ssl.keyStorePassword","password");
                   // use Sun's reference implementation of a URL handler for the     "https" URL protocol type.
                   //System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
                   // dynamically register sun's ssl provider
                   System.setProperty("security.provider","com.sun.net.ssl.internal.ssl.Provider");
                   //Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
                   System.out.println("javax.net.ssl.trustStore-->"+System.getProperty("javax.net.ssl.trustStore"));
                   System.setProperty("javax.net.debug","ssl,handshake");
                   SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
                   con = connectionFactory.createConnection();
                   MessageFactory messageFactory      = MessageFactory.newInstance();
                   SOAPMessage message                = messageFactory.createMessage();
                   SOAPPart soapPart                     = message.getSOAPPart();
         SOAPEnvelope envelope                = soapPart.getEnvelope();
         SOAPBody body                          = envelope.getBody();
    //     MimeHeaders headers = message.getMimeHeaders();
    //     headers.addHeader("SOAPAction", soapAction);
    //     headers.addHeader("SOAPAction", "/Service.serviceagent/PortTypeEndpoint1/Operation");
    //     headers.addHeader("Content-Type","text/xml");
    //     headers.addHeader("charset","utf-8");
         MimeHeaders headers = message.getMimeHeaders();
         headers.addHeader("SOAPAction", "/Service.serviceagent/PortTypeEndpoint1/sampleOperation");
         headers.addHeader("Content-Type","text/xml");
         headers.addHeader("charset","utf-8");
         StreamSource inputmsg = new StreamSource(new FileInputStream("client.wsdl"));
         soapPart.setContent(inputmsg);
         System.out.println("REQUEST:\n");
         message.writeTo(System.out);
         System.out.println();
         message.saveChanges();
         SOAPMessage reply = con.call(message, new URL(endpoint));
         System.out.println("RESPONSE:\n"+reply.toString());
         System.out.println("Header:::"+reply.getSOAPHeader());
         System.out.println("Body:::"+reply.getSOAPBody());
         System.out.println("RESPONSE:\n");
         TransformerFactory transformerFactory      = TransformerFactory.newInstance();
         Transformer transformer                     = transformerFactory.newTransformer();
         //Extract the content of the reply
         Source responseContent                          = reply.getSOAPPart().getContent();
         //Set the output for the transformation
         StreamResult result = new StreamResult(System.out);
         transformer.transform(responseContent, result);
         System.out.println();
              }catch(Exception e){
                   e.printStackTrace();
              finally{
                   con.close();
    Exception:
    10-Nov-2008 11:55:04 com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection post
    SEVERE: SAAJ0009: Message send failed
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:127)
         at com.Sample.main(Sample.java:91)
    Caused by: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         ... 1 more
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:325)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 3 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:282)
         ... 4 more
    CAUSE:
    java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         at com.Sample.main(Sample.java:91)
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:325)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 3 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:282)
         ... 4 more
    CAUSE:
    java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         at com.Sample.main(Sample.java:91)
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:325)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 3 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:282)
         ... 4 more
    Edited by: javausers07 on Nov 10, 2008 11:58 AM

    I hope the sun forum can help for me. Lets see

  • Errors while invoking webservice

    I am getting below error while invoking webservice in jdev:
    <env:Envelope
      xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
      <env:Fault>
       <faultcode>env:Server</faultcode>
       <faultstring>Failure in SDOSerializer.deserialize.</faultstring>
      </env:Fault>
    </env:Body>
    </env:Envelope>
    I can see only below log in jdev server log :
    <oracle.adf.model> <SDOHelper> <findHelperContext> <SDOHelperContext identified by {http://xmlns.oracle.com/apps/projects/projectManagement/common/projectServiceV2/}ProjectService has not been defined yet!>
    <oracle.adf.model> <SDOHelper> <findHelperContext> <SDOHelperContext identified by {http://xmlns.oracle.com/apps/projects/projectManagement/common/projectServiceV2/}ProjectService has not been defined yet!>
    could anybody help me to understand what gone wrong ?

    This thread might help you:
    Problems invoke Web Service

  • Access Denied Error while accessing "Site Settings Access requests and invitations"

    Hi,
    I am getting Access Denied Error while accessing "Site Settings > Access requests and invitations" in SharePoint  2013 online. Currently I am the owner of the site and have "FULL CONTROL" access. I am able to access using
    site collection account. So, what permission I have to give my regular account to access this page?
    Thanks, Pal

    Hello,
    Have you recently changed the Owners group of the site collection or removed the user from the original owners group? 
    The reason I am asking is when the Access requests and invitations list are created, the permissions are given only to the default owners group at the time that the Access Request list was created.  If this "regular account" is not part of that owners
    group, the user will receive access denied.  Site Collection Admins always have permissions for the Access Request List.
    A workaround for the Access Denied issue is listed in the KB article http://support.microsoft.com/kb/2911390/en-us.  By giving the correct group or user the permissions to this list, the users will not receive
    the Access Denied issue anymore.  
    Preferably, in order to grant the user the full permissions ( you will see features like resending invitations may still fail after implementing the above workaround) there is one other workaround that may be required depending on what the original issue
    was.  Below are additional steps to restore full functionality.
    1)Access the /_layouts/15/permsetup.aspx of the site collection, make sure the default Owners Group
    is set correctly.  (There is a group selected)
    2) Add user to that Owners Group.  (Issue may be resolved at this step if the site collection Owners
    Group was never changed, if not continue to next step.)
    3) Implement workaround on http://support.microsoft.com/kb/2911390/en-us, by adding that owners
    group as Full control on Access Request list Permissions.
    Let me know how this works out for you.
    - Shpendi Jashari

  • Timerjob Access denied error while opening web object

    Hi Team,
    I have created a timer job to get list information on the site. Everything is fine in the development(Stand alone server) . Got access denied error while running same timer job in QA server(one app and one WFE).
    Note: This timer job is globally deployed.
    Code snippet : 
    SPSite site1 = webApp.Sites[0];
    SPWeb web = site1.RootWeb;
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite site = new SPSite(site1.ID))
    using (SPWeb currWeb = site.OpenWeb(web.ID))                  // Got access denied error here.
    Additional information:
    Sharepoint timer service account : Domain\SP_Farm
    Site app pool account : Domain\SP_App.
    Both accounts have site collection administrative access on the site. Do i need to check access permissions on DB level also  this error ?
    Waiting for urgent reply..

    Hi,
    1. Please check the link below:
    Fixing Access Denied Errors With SharePoint 2010 Timer Jobs
    http://www.sharepointsecurity.com/sharepoint/sharepoint-security/fixing-access-denied-errors-with-sharepoint-2010-timer-jobs/
    2. Try to set RemoteAdministratorAccessDenied  to false using PowerShell
    Access denied when deploying a timer Job or activating a feature from SharePoint 2010 content web application
    https://support.microsoft.com/kb/2564009?wa=wsignin1.0
    3. Check your ULS log for detail error message.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Error while invoking onHeartBeat() method, exception is "Cannot load header

    I have a problem that when I read out an IMAP mailbox I sometimes get the above problem, and sometimes I don't get the problem.
    Below I attached the main parts of my environment to get an insight within the code:
    bpel.xml of process that is reading out the IMAP mailbox
    <activationAgents>
    <activationAgent className="com.collaxa.cube.activation.mail.MailActivationAgent"
    heartBeatInterval="60">
    <property name="accountName">account</property>
    </activationAgent>
    account.xml
    <mailAccount xmlns="http://services.oracle.com/bpel/mail/account">
    <userInfo>
    <displayName>Eneco Process lAyer</displayName>
    <organization>iFactory</organization>
    <replyTo>[email protected]</replyTo>
    </userInfo>
    <outgoingServer>
    <protocol>smtp</protocol>
    <host>10.126.16.73</host>
    <port>25</port>
    <authenticationRequired>false</authenticationRequired>
    </outgoingServer>
    <incomingServer>
    <protocol>imap</protocol>
    <host>10.126.20.8</host>
    <port>143</port>
    <email>IFACAORTA</email>
    <password>CRYPT{IB3B7SrA3kMYHoBDzWwsEg==}</password>
    <folderName>InBox</folderName>
    </incomingServer>
    </mailAccount>
    The domain.log of the appserver
    <2006-12-04 15:08:25,546> <ERROR> <default.collaxa.cube.activation> <HeartBeatListenerJob::execute> Error while invoking onHeartBeat() method, exception is "Cannot load header".
    <2006-12-04 15:08:25,562> <ERROR> <default.collaxa.cube.activation> <HeartBeatListenerJob::execute> Error while invoking onHeartBeat() method, exception is "No content".

    This problem is occuring only on BPEL release 10.1.3.
    I retested this again on BPEL 10.1.2, but there the problem did not occur.

  • Error while invoking onHeartBeat() method, exception is "Username supplied

    hi ...
    I am trying to invoke bpel process when we get email..
    but i am getting the following error..
    Error while invoking onHeartBeat() method, exception is "Username supplied in error".
    <mailAccount xmlns="http://services.oracle.com/bpel/mail/account">
         <userInfo>
              <displayName>Oracle BPM</displayName>
              <organization>xxx</organization>
              <replyTo>bpel@localhost</replyTo>
         </userInfo>
         <outgoingServer>
              <protocol>smtp</protocol>
              <host>xxxxx</host>
              <authenticationRequired>false</authenticationRequired>
         </outgoingServer>     
         <incomingServer>
              <protocol>pop3</protocol>
              <host>xxxxx</host>
              <port>143</port> -- tried with 110 prot also
              <email>xxxx</email>
              <password></password>
              <folderName>Inbox</folderName>
              <authenticationRequired>false</authenticationRequired>
         </incomingServer>     
    </mailAccount>
    Can any one help me on this ?
    thanks,
    bharath

    This problem is occuring only on BPEL release 10.1.3.
    I retested this again on BPEL 10.1.2, but there the problem did not occur.

  • Getting access denied error while importing file using input type="file"

    Hi All,
    I am using struts application wherein I need to import file for some purpose.I have used input type="file" for the same which goes like:
    <input type="file" id="uploadFile" name="uploadFile" size="50">
    I have the import button on which I have used onClick event to call javascript function submitValues() used to validate all the fields from the page which goes like:
    <input type="button" name="select" value="Import" class="CSSButton" onClick="javascript:submitValues();">
    The JS function then in turn submits the form and calls the action.The problem is sometimes even when the correct path is specified for the file to be imported results in access denied error.This error comes sometimes and other times it works fine.But when this error comes,I need to relogin into the application and then it works fine.I am using IE7 for this.
    Any idea why I am getting access denied error while importing? Has it got something to do with IE7 version or with the input type="file" which is being used here?
    Thanks for any help if anyone can provide.
    Edited by: passionateforjava on Mar 4, 2009 2:18 AM

    vishnuS1984 wrote:
    Hi Friends,
    I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
    public static void copyFiles(File src, File dest) throws IOException
    // dest is a 'File' object but represents the C:\GetMe1 directory, right?
    fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
    BTW, this is awful:
    catch (IOException e)
    IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
    src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
    wrapper.initCause(e);
    wrapper.setStackTrace(e.getStackTrace());
    throw wrapper;
    }1) You're hiding the original IOException and replacing it with your own? For what good purpose?
    2) Even if you had a good reason to do that, this would be simpler and better:
    throw new IOException("your custom message goes here", e);
    rather than explicitly invokign initCause and setStackTrace. Yuck!

  • Problem while invoking webservice-method in client-code

    Hi,
    I had written webservice-client-code (using uddi-ext.jar, as i am using uddi for publishing webservices.) which is invoking webservice method successfully with complex datatypes(both for return type and input paramters).
    But while calling following webservice-method from my client-code:
    public ComplexType[] getData(String[] p_str1, String[] p_str2)
    it is throwing exception
    The Exception is:
    [ERROR] - 27 Mar 2007 12:34:38 -failed to invoke operation 'getData' due to an error in the soap layer (SAAJ); nested exception is: Message[failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException: mapping lookup failure. type=['java:language_builtins.lang']:ArrayOfString schema context=TypedSchemaContext{javaType=[Ljava.lang.String;}]
    Although I had done correct registration of mapping of ArrayOfString in client-code:
    registry = m_Service.getTypeMappingRegistry();
                   m_TypeMapping = registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING );
                   m_TypeMapping.register( ArrayOfStringHolder.class,
    new QName( "java:language_builtins.lang", "ArrayOfString" ),
    new ArrayOfStringCodec(),
    new ArrayOfStringCodec());
    But some how it doesnt works.
    I had searched on google as well but didnt find any reliable solutions.
    Please advice.
    Edited by meetmrdeepak at 03/27/2007 2:43 AM
    Edited by meetmrdeepak at 03/27/2007 2:45 AM

    See item A.1 of the [RMI FAQ|http://java.sun.com/j2se/1.5.0/docs/guide/rmi/faq.html].

  • Access denied Error while calling Web Service form Infopath Form 2010.

    Hi Dear All,
    I have been facing an error while calling an GetUserProfileByName() web service method from InfoPath 2010 from.
    i have FBA(Forms Base Authentication )configured . After Infopath form published to site collection when i select an user from people picker control i want to get Email Id of Selected user for that i am calling getUserProfileByName() Web Method, but 
    i am getting Access denied error code 500.
    Any Help would be more than welcome.
    Thanks.

    Hi,
    Greetings. Please check 
    Check the IE settings. Click Internet Options> Security>Custom level. Make sure that the ‘Access data source across domains’ is enabled. Make sure that you have permission to the web service and to the content which the web service tries to modify.
    For more information, please refer to this site:
    "Access is denied." error in Infopath 2007 form + ASMX: http://us.generation-nt.com/answer/access-denied-error-infopath-2007-form-plus-asmx-help-65808252.html
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Access denied error while writing a file to the file system - myfileupload.saveas() throws system.unauthorizedexception

    hi,
    as part of my requirement , i have to perform read and  write  operations of  few files [ using the file upload control in my custom visual web part] and on submit button click.
    but while writing these files - with the help of  fileupload control - and when i use  myfileupload.saveas(mylocation);
    - i am saving these files into my D:\ drive of my server , where i am executing my code -, am getting access denied error.
    it throws system.unauthorizedexception.
    i have given full control on that folder where i was trying to store my attached files. and also  after following asp.net forums,
    i have added  iusr group added and performed all those steps such that, the file is saved in my D:\ drive.
    but unfortunately  that didnt happen.
    also
    a) i am trying the code with runwithelevatedprivileges(delegate() )  code
    b) shared the drive within the  d :drive where i want o save the files.
    c) given the full privieleges for the app pool identity- in my case , its
    network service.
    the  other strange thing is that, the same code works perfectly in  other machine, where the same sp, vs 2012  etc were installed .
    would like to know, any other changes/ steps i need to make it on this  server, where i am getting the  error.
    help is  appreciated!

    vishnuS1984 wrote:
    Hi Friends,
    I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
    public static void copyFiles(File src, File dest) throws IOException
    // dest is a 'File' object but represents the C:\GetMe1 directory, right?
    fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
    BTW, this is awful:
    catch (IOException e)
    IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
    src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
    wrapper.initCause(e);
    wrapper.setStackTrace(e.getStackTrace());
    throw wrapper;
    }1) You're hiding the original IOException and replacing it with your own? For what good purpose?
    2) Even if you had a good reason to do that, this would be simpler and better:
    throw new IOException("your custom message goes here", e);
    rather than explicitly invokign initCause and setStackTrace. Yuck!

  • Access denied error while trying to install graphics drivers

    Hello,
    I have a new toshiba laptop P70-A. I have installed windows 7 and the pc was working excellent up until now. Noticed yesterday that the nvidia automated system failed to install the new update. When I tried to install the new driver manually, even from the
    device manager, I got the access denied message. 
    A day now wasted reading all the possible causes and solutions but with no luck. Read all the forums and all the posts, tried almost everything. Below youll find everything I tried as a solution and failed.
    1.Disabled UAC
    2.Enabled the administrator account and trying to take control from there
    3.Run the subinacl and the reset.cmd
    4.Tried manually to take control the folder windows (and access denied while changing the rights)
    5. Scanned the system with everything there is available ( Kaspersky, MalwareBytes, RegCurePro, Tuneup Utilities, CCleaner) The system came out clean.
    6. Tried restoring the system to an earlier time (got again access denied error code 0x80070005)
    7. Checked all the group policies (all seem to be fine)
    8. Run a script to take immediate ownership over all of C:
    TAKEOWN /A /F C:
    then the next one
    TAKEOWN /F C: 
    9. With subinacl I run all the above scripts... (still nothing changed)
    @echo off
    title Resetting ACLs...
    echo.
    echo Determine whether we are on an 32 or 64 bit machine
    echo.
    if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto x86
    set ProgramFilesPath=%ProgramFiles(x86)%
    goto startResetting
    :x86
    set ProgramFilesPath=%ProgramFiles%
    :startResetting
    echo.
    cd /d "%ProgramFilesPath%\Windows Resource Kits\Tools"
    echo. 
    echo Resetting ACLs...
    echo (this may take several minutes to complete)
    echo. 
    echo IMPORTANT NOTE: For this script to run correctly, you must change
    echo the values named Athena to be the Windows user account that
    echo you are logged in with.
    echo.
    echo ==========================================================================
    echo. 
    echo. 
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=Athena=f /setowner=administrators > %temp%\subinacl_output.txt
    echo. 
    echo. 
    subinacl /keyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=Athena=f /setowner=administrators >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    subinacl /keyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    subinacl /keyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    echo System Drive...
    subinacl /subdirectories %ProgramFilesPath%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    echo Windows Directory...
    subinacl /subdirectories %windir%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt
    echo. 
    echo. 
    echo ==========================================================================
    echo. 
    echo FINISHED.
    echo. 
    echo Press any key to exit . . .
    pause >NUL
    Im frustrated really... ANY help at all would be really appreciated.
    Thanks in Advance and sorry for the long post
    Athena 

    Hello,
    Thanks for the replies, i much appreciate it. I tried all of the above with no luck again. Safe mode allows me though to install drivers but thats reverting the moment im entering windows. Im always running commands and programs as a administrator or in
    the Admin enabled account.
    It seems the problem is solved today. Via tune up utilities I disabled most of the startup programs and services and it seems that 1 service is causing this issue. Although I havent played much with the disabled services but 3 remain to be checked. One of
    the three is causing this.
    Thanks again guys and Ill keep you posted about the soft. conflict.
    Athena

  • Error while invoking Webservice API ItemService_GetItemInformation

    The following error is encountered while invoking Webservice API "ItemService_GetItemInformation"
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <faultcode>wsse:InvalidSecurity</faultcode>
    <faultstring>Missing &lt;wsse:Security> in SOAP Header</faultstring>
    <faultactor/>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    Same is repeated even after passing
    RESPONSIBILITY_NAME => Inventory
    RESPONSIBILITY_APPL_NAME => INV
    SECURITY_GROUP_NAME => Standard
    NLS_LANGUAGE => AMERICAN
    Any pointer for the root cause of this error & how to resolve this?
    Thanks In Advance!
    priyadarshi

    Hi ..
    The error meaning: you need input the user_name and password for the SOAPHeader

  • "general access denied error" while implementing out-of-process COM Server Implementation in Windows Phone 8.1

    I have a Service (.exe) where I was registering for my COM Component like below
    CoInitializeEx(NULL, COINIT_MULTITHREADED);
    HRESULT hres = CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, 0);
    if (hres != S_OK)
    OutputDebugStringA("Security Descriptor not initialized");
    ITypeLib* pTypeLib;
    HRESULT hr_1 = LoadTypeLibEx(L"ServiceIdl.tlb", REGKIND_REGISTER, &pTypeLib);
    if (pTypeLib != NULL)
    pTypeLib->Release();
    RegisterServer(L"Service.exe", CLSID_classAImpl, L"ClassAImpl Sample", L"Component.ClassAImpl", L"Component.ClassAImpl.1", 0);
    g_hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    DWORD reg = 0;
    IClassFactory *pIFactory = new classAFactory;
    HRESULT hr0 = CoRegisterClassObject(CLSID_classAImpl, pIFactory, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &reg);
    if (FAILED(hr0))
    OutputDebugStringA("classAImpl is not registered");
    CoUninitialize();
    exit(1);
    HRESULT hr1 = CoResumeClassObjects();
    if (hr1 == S_OK)
    OutputDebugStringA("classAImpl is Resumed Registering");
    WaitForSingleObject(g_hEvent, INFINITE);
    CloseHandle(g_hEvent);
    CoRevokeClassObject(reg);
    pIFactory->Release();
    CoUninitialize();
    From Client Code I am CreatingInstance  Like Below
    COSERVERINFO si;
    MULTI_QI qi;
    COAUTHINFO cai = { RPC_C_AUTHN_NONE, RPC_C_AUTHZ_NONE, 0, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, 0, EOAC_NONE };
    si.dwReserved1 = 0;
    si.pwszName = L"\\\\localhost";
    si.pAuthInfo = &cai;
    si.dwReserved2 = 0;
    qi.pIID = &IID_classA;
    qi.pItf = NULL;
    qi.hr = 1;
    CoInitializeEx(NULL, COINIT_MULTITHREADED);
    HRESULT hr = CoCreateInstanceEx(CLSID_classAImpl, 0, CLSCTX_LOCAL_SERVER, &si, 1, &qi);
    hr returning error "general access denied error";

    I think we may run into the limitations mentioned in the remarks of CoCreateInstanceFromApp doc(show as below). If you can provide a repro project, I
    can give you more details about what happens.
    The CoCreateInstanceFromApp function reads class registrations only from Fusion contexts and manifests, and from the HKLM\SOFTWARE\Classes\CLSID registry hive.
    Only built-in classes that are supported in the app container are supplied. Attempts to activate unsupported classes, including all classes installed by 3rd-party code as well as many Windows classes, result in error code
    REGDB_E_CLASSNOTREG.
    The CoCreateInstanceFromApp function is available to Windows Store apps. Desktop applications can call this function, but they have the same restrictions as Windows Store apps.
    If you are trying to call some windows classes in your library, I will suggest you check how to create windows runtime out of process component by viewing
    this sample. This is what I usually do.
    To be honest, I did not try to implement the out of process COM component using the method you tried as we previsouly do on desktop. I will suggest you try to register a very simple library(like a signle class and single interface which returns an integer),
    and see if it will work.
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • Access denied error while exporting chart to excel

    I need to export data from a gridview to chart in excel. Through system account credentials it works fine. But through a user's credentials its giving an access denied error. The gridview data is exported properly but the current chart which is displayed
    on page is not getting displayed in excel.
    So is there any other way to achieve this?
    I was thinking og saving it to virtual folder in the Site but I cannot figure out the exact code for it. Since file upload control is not involved, how to save the chart to the virtual folder. Any inputs on this?

    Hello,
    Would you mind if you use "runwithelevatedprivileges" in your code to execute code with admin privilege?
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
    >I was thinking og saving it to virtual folder in the Site
    Do you want to save excel in system folder or SP site folder?
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • Batch combine/merge different folders into 1 image?

    I have a large set of images I need to batch process from 2 different folders, I want to combine 2 of the images into 1 psd, add a curve between the 2 layers, then save. These images will ultimatly be imported into Premier for a video so the sequence

  • How to set a form field focus

    Is there a simple way to set a form field focus... so basically on load the field focus is set to a specific field?  I know how to write it in javascript but was wondering if there is a simple way to basically select the field and click a button or t

  • Installing Flash Player in Vista

    I´ve had trouble installing the latest Flash Player in windows vista. Even when it´s worked in the past, the next time I use the computer, it no longer seems to be installed. Could it be my antivirus that blocks this? I use Avira. When I try to downl

  • Can 10g release 2 standalone database control behaves as 9i oem

    Hi all, My question is ,in 9i we have oem,we can add multiple databases in 9i oem.At the same time we can login to multiple databases and see different sessions,OS user,memory information, storage information of different databases.Can we perform the

  • Best strategy to recharge battery

    I have a new tx2, and i wonder when to recharge my battery. Should i wait until it is 100 %discharge or always keep a small amount of charge i.e.... recharge at 25 % Should i keep the tx2 always plug? Meaning the battery will be always near 100% So w