5 Replies Latest reply on Jul 14, 2012 1:26 PM by od74

    Error with Autoit Script to add a new computer (Soap method)

    Rookie

      Hello,

       

      We work on Landesk Management Suite 9.0.3.1 on Windows 2003 server, IIS 7

      I want to add a new computer remotely in the Landesk database. For this, a use this Soap code, include in a autoit script :

       

      $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

      $oHTTP.Open("POST", "http://ewqblnsrv052/mbsdkservice/msgsdk.asmx/AddComputer", False)

      $oHTTP.SetCredentials("hach-lange\    ","   ",0)

      $oHTTP.SetRequestHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E")

      $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")

      $oHTTP.SetRequestHeader("Content-Length", "length")

      $oHTTP.SetRequestHeader("Connection", "Close")

      $oHTTP.Send("deviceName=TEST&type=Computer&ipAddress=1.2.3.4&IPName=Test")

      MsgBox(0,"",$oHTTP.responseText)

       

       

      And i get this error :

       

       

      Server Error in '/MBSDKService' Application. 
       

      Request format is unrecognized for URL unexpectedly ending in '/AddComputer'.

      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

      Exception Details: System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/AddComputer'.

      Source Error:

       

      An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


      Stack Trace:

       

      [InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/AddComputer'.]  System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +405913  System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212  System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47  System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193  System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

       

       

      I get this error for every action i want to do with the Soap system, i suppose i forgot to configure IIS...

      Do yo have any idea to configure Soap fonctionnality ?

      Thanks in advance