为什么此Web服务的XML响应在SSIS Web服务任务中导致错误?

时间:2016-12-29 11:25:55

标签: web-services ssis-2012

我正在使用SSIS 2012来创建一个包,该包将从Web服务检索数据并加载数据库。我已经在这个包中成功创建了许多Web服务任务,在这个Web服务上调用了许多其他方法,但其中一个方法出了问题。

GetDeviceInfo方法接受以下参数:

  1. certificate - 在调用WS登录方法后收到
  2. accountId - 设备中存在的帐户
  3. cmuId - 特定设备的序列号
  4. 当使用我知道不存在的任意cmuId调用该方法时(本例中为1234567),XML响应(表示未找到任何记录)正确返回,如下所示:

    <?xml version="1.0" encoding="utf-16"?>
    <ResponseModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <message xsi:nil="true"     xmlns="http://schemas.datacontract.org/2004/07/CellocatorPlusModels" />
      <state xmlns="http://schemas.datacontract.org/2004/07/CellocatorPlusModels">valueNotFound</state>
      <timestamp xmlns="http://schemas.datacontract.org/2004/07/CellocatorPlusModels">6.36186059963802E+17</timestamp>
    </ResponseModel>
    

    但是,只要输入了cmuId的有效值,SSIS就会抛出错误:

    SSIS package "<redacted>\getData.dtsx" starting.
    Error: 0xC002F304 at Web Service Task, Web Service Task: An error occurred with the following error message: "Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException: Could not execute the Web method. The error is: There was an error generating the XML document..
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebMethodInvokerProxy.InvokeMethod(DTSWebMethodInfo methodInfo, String serviceName, Object connection)
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTaskUtil.Invoke(DTSWebMethodInfo methodInfo, String serviceName, Object connection, VariableDispenser taskVariableDispenser)
       at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()".
    Task failed: Web Service Task
    SSIS package "<redacted>\getData.dtsx" finished: Success.
    

    Web服务任务失败,响应未写入输出文件。

    使用相同的参数从浏览器调用Web服务,返回以下内容,这正是我所期待的:

    <ResponseModel xmlns="http://schemas.datacontract.org/2004/07/CellocatorPlusModels" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <message i:type="ExtendedUnitInfoModel">
        <Account><..></Account>
        <AccountId i:nil="true"/>
        <AssemblyDate>05/13/2015</AssemblyDate>
        <CMUID>1169817</CMUID>
        <CurrentFWVersion>331</CurrentFWVersion>
        <FWStatus>On Wait</FWStatus>
        <FirstFWVersion i:nil="true"/>
        <FirstPLVersion i:nil="true"/>
        <FirstStatusDate>05/13/2015</FirstStatusDate>
        <GroupID>22493</GroupID>
        <GroupName>CR300B</GroupName>
        <Modem>CR300B GE864</Modem>
        <PLName i:nil="true"/>
        <ProgStatus>Normal Operation</ProgStatus>
        <Prov></Prov>
        <ProviderId>5186</ProviderId>
        <PurchaseOrder>SO28906.4</PurchaseOrder>
        <SIMNumber/>
        <SerialId/>
        <ShipmentDate>06/07/2015</ShipmentDate>
        <ShipmentTrackingNumber>8577</ShipmentTrackingNumber>
        <TesterName>Arcam3</TesterName>
        <TestingDate>05/14/2015</TestingDate>
        <WarrantyExpDate>06/08/2016</WarrantyExpDate>
      </message>
    <state>success</state>
    <timestamp>6.3618603925336154E+17</timestamp>
    </ResponseModel>
    

    我尝试创建一个独立的软件包,其中只包含此Web服务任务以进行故障排除,结果相同。

    因为我可以完全正常地调用此WS上的其他方法,所以当我指定一个不存在的设备并且我可以在这些情况下正确写入输出文件时,任务可以正常运行我只能得出结论在此响应中出现了错误或者我错过了一些非常愚蠢的东西。

    有什么想法吗?提前谢谢。

0 个答案:

没有答案