Unable to Execute WebService Task From ASP.NET Application

Unanswered Unable to Execute WebService Task From ASP.NET Application

  • Wednesday, February 13, 2013 4:18 PM
     
     

    Hi,

    I have created one SSIS Package which contains the Web Service Task. The Web Service Task is using the HTTP Connection Manager which is pointing to the address where the Web Service is hosted. When we execute the Task without any credentials, it throws the error -

    Error 401 - Unauthorized : The Remote Server returned an Error.

    When we give the credentials, then the Test Connection results in success.

    The Asp.Net Web.Config contains the code like below -

    <location path="SERVICE">
        <system.web>
          <authorization>
            <allow user = "?">        
            <allow roles="DOMAIN\ROLENAME"/>
            <allow users="DOMAIN\USERNAME"/>
       </authorization>
      </system.web>
    </location>


    However, we don't have to give the username & password in HTTP Connection Manager but on the other hand the webservice must be executed by the roles and users mentioned in Web.Config file.

    Please suggest how can we achieve this?

    Thanks in advance.

    Regards,

    iJankya


    • Edited by iJankya Wednesday, February 13, 2013 4:18 PM
    •  

All Replies

  • Wednesday, February 13, 2013 4:23 PM
    Moderator
     
     

    You need to run the package using a proxy account that adheres to 

    <allow roles="DOMAIN\ROLENAME"/>
      allow users="DOMAIN\USERNAME"/>


    Arthur My Blog

  • Wednesday, February 13, 2013 5:25 PM
     
     

    When I am working on the Localhost i.e. running the Web Service on localhost and testing the connection from same server where the WebService is running , its working fine.

    With Web.Config Setting as -

    <authorization>
            <allow user = "?">        
            <allow roles="DOMAIN\ROLENAME"/>
            <allow users="DOMAIN\USERNAME"/>
    </authorization>

    But when the deployment occurs, it doesn't perform the action specified in Web Service. Moreover, gives the error 401 : Unauthorized.

    Please suggest what can be done?

  • Wednesday, February 13, 2013 6:19 PM
    Moderator
     
     
    All will work on LocalHost where you are the boss, but in real world security exists, see setting a proxy to run SSIS packages

    Arthur My Blog

  • Thursday, February 14, 2013 4:32 PM
     
     

    Thanks Arthur for your suggestions...But still having the problem.

    Web Service Deployed on DEV Server -

    HTTP Connection Manager : Without Credentials --- Error [401 : Unauthorized!!] 

                                              : With Credentials --- Success

    Web Service Task -

    Does not execute (with Successful HTTP Connection Manager Setting) : Error : Unable to Connect to Remote Server