Corrections to InfoPath/HWS Example (look below in my blog)


A. It asks you to define a Status element in the ActionSection:


1.       Right-click the ActionSection node, click Insert Schema Node, and then click Child Field Element.


2.       In the placeholder node that appears, type Status.


it should be renamed to “TaskStatus” because in the hwsAdapters it refers to ActionSection/TaskStatus, instead of ActionSection/Status


B. You need a component for the pipeline. You can get this component here


Hopefully the InfoPath Team will fix this on the main page shortly.


Comments (21)

  1. abbas foroughi says:

    InfoPathTaskPatchingPipeline.zip is not working!

  2. Scott Woodgate (MSFT) says:

    Can you provide more details of the issue you are experiencing?

  3. abbas foroughi says:

    I can’t download this component. I get an application error: HttpException Resource not found.

    http://blogs.msdn.com/scottwoo/archive/2004/04/23/home.comcast.net/%20~sdwoodgate/InfoPathTaskPatchingPipeline.zip

  4. Scott Woodgate (MSFT) says:

    Ah… sorry about that. All fixed 🙂

  5. Panchy says:

    Just curious — why is interop still being used? Would be nice to have the references needed (browsing the list and/or guessing is longish).

  6. Prashant says:

    I still get :

    application error: HttpException Resource not found

  7. abbas foroughi says:

    Please can you suggest how to debug the following error:

    InfoPath cannot submit the form.

    An error occurred while the form was being submitted.

    The form definition (.xsf) file has an invalid mapping from the document to the submit Web service.

    I have added the following code to the manifest.xsf

    <xsf:hwsWorkflow taskpaneVisible="yes">

    <xsf:location url="abc"></xsf:location>

    <xsf:allowedActions>

    <xsf:action name="Approval" actionTypeID="40D13DD6-0CE0-1EEC-07CE-1738B79022B9" canInitiateWorkflow="yes" caption="Start Approval"></xsf:action>

    </xsf:allowedActions>

    <xsf:allowedTasks>

    <xsf:task name="RespondToApproval" taskTypeID="http://tempuri.org/Hws_Task_Approval&quot; caption="Respond To Approval"></xsf:task>

    </xsf:allowedTasks>

    </xsf:hwsWorkflow>

    <xsf:dataAdapters>

    <xsf:hwsAdapter name="Approval" wsdlUrl="http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot; submitAllowed="yes" queryAllowed="no">

    <xsf:hwsOperation type="addActionToNewActivityFlow" typeID="40D13DD6-0CE0-1EEC-07CE-1738B79022B9" serviceUrl="http://localhost/hwsservice/hwsservice.asmx?op=GetActivityList"&gt;

    <xsf:input source="Activation.xml">

    <xsf:partFragment match="ActionSection/Target" replaceWith="/my:myFields/my:Target"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/Description" replaceWith="/my:myFields/my:Description"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/TaskStatus" replaceWith="/my:myFields/my:TaskStatus"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/EndAction" replaceWith="/my:myFields/my:EndAction"></xsf:partFragment>

    </xsf:input>

    </xsf:hwsOperation>

    </xsf:hwsAdapter>

    <xsf:hwsAdapter name="ExtendApproval" wsdlUrl="http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot; submitAllowed="yes" queryAllowed="no">

    <xsf:hwsOperation type="addActionToActivityFlow" typeID="40D13DD6-0CE0-1EEC-07CE-1738B79022B9" serviceUrl="http://localhost/hwsservice/hwsservice.asmx"&gt;“>http://localhost/hwsservice/hwsservice.asmx"&gt;

    <xsf:input source="Activation.xml">

    <xsf:partFragment match="ActionSection/Target" replaceWith="/my:myFields/my:Target"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/Description" replaceWith="/my:myFields/my:Description"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/TaskStatus" replaceWith="/my:myFields/my:TaskStatus"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/EndAction" replaceWith="/my:myFields/my:EndAction"></xsf:partFragment>

    </xsf:input>

    </xsf:hwsOperation>

    </xsf:hwsAdapter>

    <xsf:hwsAdapter name="RespondToApproval" wsdlUrl="http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot;“>http://localhost/hwsservice/hwsservice.asmx?WSDL&quot; submitAllowed="yes" queryAllowed="no">

    <xsf:hwsOperation type="sendTaskResponse" typeID="http://tempuri.org/Hws_Approval&quot; serviceUrl="http://localhost/hwsservice/hwsservice.asmx"&gt;“>http://localhost/hwsservice/hwsservice.asmx"&gt;

    <xsf:input source="">

    <xsf:partFragment match="HwsSection/TaskStatus" replaceWith="/my:myFields/my:TaskStatus"></xsf:partFragment>

    <xsf:partFragment match="ActionSection/EndAction" replaceWith="/my:myFields/my:EndAction"></xsf:partFragment>

    </xsf:input>

    </xsf:hwsOperation>

    </xsf:hwsAdapter>

    and activation.xml includes:

    <ns0:HwsMessage xmlns:ns0="http://tempuri.org/Hws_Task_Approval&quot;>

    <HwsSection HwsMessageType="Hws_Task">

    <ActivityFlowID/>

    <TaskID/>

    <TaskDescription/>

    <ActionTypeID/>

    <ActionInstanceID/>

    <InitiatingActor/>

    <ActorElementXPath/>

    <TargetActor/>

    <ActivityModelTypeID/>

    <ActivityModelStepID>1</ActivityModelStepID>

    <TaskProperties>

    <Property Name="" Description="" Type=""/>

    </TaskProperties>

    <ActivityModelInstanceID/>

    <HwsWebServiceUrl>http://localhost/HwsService/HwsService.asmx</HwsWebServiceUrl&gt;

    <TaskStatus>InProgress</TaskStatus>

    <PercentageComplete>1</PercentageComplete>

    <NumberOfResponses/>

    <Reassignment>

    <ReassignedByActor/>

    <FromTaskID/>

    </Reassignment>

    </HwsSection>

    <ActionSection>

    <Target/>

    <Description/>

    <TaskStatus/>

    <EndAction/>

    </ActionSection>

    <Payloads>

    <Payload ID="ID_0"/>

    </Payloads>

    </ns0:HwsMessage>

    Thanks

    Abbas.

  8. Rick Severson (MSFT) says:

    For the partFragment matches, the easiest fix is to change the partFragment matches in the AddActionToActivityFlow and AddActionToNewActivityFlow. The ActionSecton/TaskStatus should be ActionSection/Status. Or you can change the Activation.xml file to ActionSection/Status, but you must also change the Activation schema or else a schema validation error will occur.

    The partFragment match in the SendTaskResponse can still be ActionSection/TaskStatus.

    As a rule, the what Activation schema file defines is what should determine what used in the AddActionToNewActivityFlow and AddActionToActivityFlow adapters within the InfoPath manifest.xsf file.

    What the Task schema file defines is what should determine what partFragment match is placed in the SendTaskResponse adapter within the InfoPath manifest.xsf file.

  9. abbas foroughi says:

    Rick,

    Do you have any documentation for hwsAadpter?

    I don’t understand why I have to rename TargetStatus to Status:

    My Hws_Activate_Approval.xsd schema is:

    <xs:element name="ActionSection">

    – <xs:complexType>

    – <xs:sequence>

    <xs:element name="Target" type="xs:string" />

    <xs:element name="Description" type="xs:string" />

    <xs:element name="TaskStatus" type="xs:string" />

    <xs:element name="EndAction" type="xs:boolean" />

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    Then I generated an activation xml in VS.NET and corrected the payloads section.

    I also think the partFragment match in the SendTaskResponse should be HwsSection/TaskStatus as defined in Hws_Task_Approval.xsd

    Do you have a working Sample?

    Thanks

    Abbas.

  10. Panchy says:

    Getting back to the pipeline component for a sec, I’m getting:

    The referenced component ‘Microsoft.BizTalk.Pipeline’ could not be found …

    … when opening HwsInfoPathPipelineComponent.csproj

    in VS.NET.

    Can anybody let me know how to resolve that so I can build the component as described in Lab 12? Any other clues that would help resolve other discrepancies, like — where is SendPipeline1.btp? — for example would be appreciated.

  11. Rick Severson says:

    An updated lab will be posted on MSDN shortly.

  12. Rick Severson says:

    The pipeline refrence should be to <BizTalkDir>Microsoft.BizTalk.Pipeline.dll

  13. Rick Severson says:

    Abbas,

    Do you mean TaskStatus to Status? The key is to have what is detailed in the Activation schema, match what is in the Activation.xml, to what is in the Match portion of the hwsAdapter.

    The partFragment follows this logic:

    The Activation.xml file is the source template that will be used in the SOAP message sent to the web service. Since HWS is expecting the Activation message to be in a format matching the Activation schema, the Activation.xml file ultimately sent must validate. Once InfoPath has the template activation file, it tries to determine if any values in the file need to be replaced by values out of the InfoPath document object model. These are the partFragment matches. In this example, it is replacing Target, Status, Description, and EndAction from the template file with values from the main dom.

    In InfoPath, click the ? help icon. Click Table Of Contents. Click InfoPath Developer Reference (at the bottom of the list of links). Click InfoPath Object Model reference. Click Objects. Click HWSAdapter. Here you will find information on the HWSAdapter object for InfoPath.

  14. Ravi says:

    1. The web link (as against the MSDN link) has not been updated with the DeployActions.cmd script instructions.

    http://www.msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_12.asp

    2. In the "Activating hwsWorkflow Within Manifest.xsf" section, the document tells you to replace the actionTypeID in Delegate action. Actually it should be the Approval action.

    <xsf:action name="Delegate" actionTypeID="F8E1453A-0813-1E96-

    D42C-FFC41C50E5C7" canInitiateWorkflow="no" caption="Delegate

    Task"></xsf:action>

  15. Rick Severson says:

    The new hands on lab 12 is now available on msdn. The .cs file is in odc_INF03_Labs2.exe.

  16. Damon Kelly says:

    As well as the issue that Ravi noted above when setting up the sendTaskResponse adapter type for the hwsAdapter for

    RespondToApproval it says to says to paste the partFragment match as

    "HwsSection/Status" when it should be "HwsSection/TaskStatus".

    I’ve now got most of this lab working, I can submit the infopath document

    for approval, open up the document to approve it. The problem I now have is

    when I try and ‘respond to approval’ I get:

    ‘Microsoft.BizTalk.Hws.SoapService.HwsServiceSoapException: You cannot

    access this activity flow, action or task.’

    Error being thrown and in the event viewer I get:

    You cannot access this activity flow, action or task.

    Anyone got any thoughts on how to fix this and has anyone got this lab completly working?

  17. Damon Kelly says:

    Ok I’ve now got it working sort of!

    I can now submit it from infopath, open it and approve it once. After the first time any additional attempts to approve additional submissions fail as I can’t get the status when I open up the XML file.

    I also know what’s causing it to fail but not why this is happening. The problem is that any additional submissions for some reason are missing action target when I check the activity flow in HWSAdministration.

    Does anyone have any idea what after the first time I do a submission on additional submissions the action targets are not recorded in HWSAdministration?

  18. hasan says:

    The new lab still doesn’t seem to be available. I couldn’t find odc_INF03_Labs2.exe on msdn. Rick Severson, could you please post a link to the new lab and file.

  19. Tommy Jacobsen says:

    Damon how did you solve this problem

    ‘Microsoft.BizTalk.Hws.SoapService.HwsServiceSoapException: You cannot

    access this activity flow, action or task.’