[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using the response from one service to make another request- need a little Guidance



   I am using HTTPAPI to write an interface between our system (i5 V5R4)
   and Cityworks by Azeteca (running on  Windows 2003 MS-SQL 2005)

   (Thanks Scott and the `group' for the api and all the examples)


   I have completed several steps successfully for the interface using
   examples , soapUI( 2.5.1), and the debug file to work out the RPGLE
   code


   The last step is to update a `service request' (changing the status to
   `close' or `cancel').  At first I assumed I could send the service
   request id (key) and the tags for the fields I need to update.
   Apparently the webservice needs all of the data populated for the
   update (see note from developer below).

   According to the developer I should get the xml (using the
   getRequestByRequestId -see attached) change what needs to be changed
   and send it back.

   Their webservice will allow me to null or blank out fields not
   referenced and return
   "<UpdateRequestResult>true</UpdateRequestResult>"  Then when you try
   to access the record in their GUI it bombs


   Should I use the getrequest and parse out all fields then build the
   updaterequest from the parsed data?



   Side note: So far I've had to prefix the tags with"web:" while the
   results do not have a prefix


   Example:


   <web:requestId>0000824748</web:requestId>


   <RequestId>824748</RequestId>





   From Software developer:


   The correct approach for making an update via the SR API is to do the
   following:


   1.       Get a RequestData Object by using
   GetRequest/GetRequestByRequestId/GetRequestByOtherSystemId, and make
   sure it exists (RequestData.RequestId > 0)

   2.       Modify the attribute fields of the RequestData object (don't
    change the RequestId, ProblemSid, IncidentNum fields)

   3.       Call  the UpdateRequest method and use the modified
   RequestData object as argument.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:web="http://www.azteca.com/cityworks/webservices";>
   <soapenv:Header>
      <web:CWAuthHeader>
         <!--Optional:-->
         <web:UserName>you</web:UserName>
         <!--Optional:-->
         <web:Password>me</web:Password>
      </web:CWAuthHeader>
   </soapenv:Header>
   <soapenv:Body>
      <web:UpdateRequest>
         <!--Optional:-->
         <web:reqData>
            <web:RequestId>824748</web:RequestId>
            <web:DomainId>1</web:DomainId>
            <web:ProjectSid>-9999</web:ProjectSid>
            <!--Optional:-->
            <web:ProblemCode>CONNECT SERVICE</web:ProblemCode>
            <!--Optional:-->
            <web:Details>OWNERS 502269         Meter - Residential  - City water and Sewer      - 001 Dwelling units</web:Details>
            <!--Optional:-->
            <web:ReqCategory>FS</web:ReqCategory>
            <web:Description>On - Read</web:Description>
            <web:Priority>3</web:Priority>
            <web:SRX>0</web:SRX>
            <web:SRY>0</web:SRY>
            <web:ProblemSid>10196</web:ProblemSid>
            <web:ReqCustFieldCatId>6011</web:ReqCustFieldCatId>
            <web:ProbAddress>2112 JEFF DAVIS ST.</web:ProbAddress>
            <web:ProbCity>MACON</web:ProbCity>
            <web:ProbZip/>
            <web:ProbAddType>A</web:ProbAddType>
            <web:InitiatedBy>HJR via CITYWOSR - MWACIS</web:InitiatedBy>
            <web:DateTimeInit>2009-05-05T17:18:29</web:DateTimeInit>
            <web:SubmitToPager/>
            <web:SubmitToPhone/>
            <web:SubmitTo>-9999</web:SubmitTo>
            <web:SubmitToEmail/>
            <web:ClosedBy>MWA</web:ClosedBy>
            <web:DateTimeClosed>0001-01-01T00:00:00</web:DateTimeClosed>
            <web:WorkOrderId/>
            <web:ProjectName/>
            <web:DateSubmitTo>2009-05-05T17:18:29</web:DateSubmitTo>
            <web:SubmitToOpenBy/>
            <web:DateSubmitToOpen>0001-01-01T00:00:00</web:DateSubmitToOpen>
            <web:DispatchTo/>
            <web:DateDispatchTo>0001-01-01T00:00:00</web:DateDispatchTo>
            <web:DispatchOpenBy/>
            <web:DateDispatchOpen>0001-01-01T00:00:00</web:DateDispatchOpen>
            <web:MapPage/>
            <web:Shop/>
            <web:Status>CLOSED</web:Status>
            <web:Cancel>0</web:Cancel>
            <web:CancelledBy></web:CancelledBy>
            <web:DateCancelled>0001-01-01T00:00:00</web:DateCancelled>
            <web:LaborCost>0</web:LaborCost>
            <web:FieldInvtDone>false</web:FieldInvtDone>
            <web:DateInvtDone>0001-01-01T00:00:00</web:DateInvtDone>
            <web:WONeeded>false</web:WONeeded>
            <web:Excursion>false</web:Excursion>
            <web:TileNo/>
            <web:PrjCompleteDate>2009-04-29T21:30:00</web:PrjCompleteDate>
            <web:Text1/>
            <web:Text2/>
            <web:Text3/>
            <web:Text4/>
            <web:Text5/>
            <web:Text6/>
            <web:Text7/>
            <web:Text8/>
            <web:Text9/>
            <web:Text10/>
            <web:Text11/>
            <web:Text12/>
            <web:Text13/>
            <web:Text14/>
            <web:Text15/>
            <web:Text16/>
            <web:Text17/>
            <web:Text18/>
            <web:Text19/>
            <web:Text20/>
            <web:OtherSystemId>1225423</web:OtherSystemId>
            <web:OtherSystemStatus/>
            <web:OtherSystemCode/>
            <web:OtherSystemDesc/>
            <web:OtherSystemDesc2/>
            <web:ProbAptNum/>
            <web:ProbLandmark/>
            <web:ProbDistrict/>
            <web:ProbState/>
            <web:ProbLocation/>
            <web:CancelReason/>
            <web:Num1>-9999</web:Num1>
            <web:Num2>-9999</web:Num2>
            <web:Num3>-9999</web:Num3>
            <web:Num4>-9999</web:Num4>
            <web:Num5>-9999</web:Num5>
            <web:Date1>0001-01-01T00:00:00</web:Date1>
            <web:Date2>0001-01-01T00:00:00</web:Date2>
            <web:Date3>0001-01-01T00:00:00</web:Date3>
            <web:Date4>0001-01-01T00:00:00</web:Date4>
            <web:Date5>0001-01-01T00:00:00</web:Date5>
            <web:InitiatedByApp>MWACIS</web:InitiatedByApp>
            <web:Resolution/>
            <web:StreetName/>
            <web:LockedByDesktopUser/>
            <web:Comments>OWNERS 502269         Meter - Residential  - City water and Sewer      - 001 Dwelling units</web:Comments>
            <web:CustomerCalls>
               <web:CustomerCallData>
                  <web:IncidentNum>26752</web:IncidentNum>
                  <web:RequestId>824748</web:RequestId>
                  <web:FirstName/>
                  <web:LastName>UNKNOWN</web:LastName>
                  <web:Title/>
                  <web:MiddleInitial/>
                  <web:AcctNum>040374</web:AcctNum>
                  <web:CCX>0</web:CCX>
                  <web:CCY>0</web:CCY>
                  <web:AptNum/>
                  <web:CustAddress>2112 JEFF DAVIS ST.</web:CustAddress>
                  <web:CustCity>MACON</web:CustCity>
                  <web:CustZip/>
                  <web:CustAddType>A</web:CustAddType>
                  <web:HomePhone>4787432830</web:HomePhone>
                  <web:DateTimeCall>2009-05-05T17:18:29</web:DateTimeCall>
                  <web:OtherPhone/>
                  <web:Email> </web:Email>
                  <web:WorkPhone/>
                  <web:IsResident>true</web:IsResident>
                  <web:IsFollowUpCall>false</web:IsFollowUpCall>
                  <web:CallerType>?</web:CallerType>
                  <web:Comments/>
                  <web:CustContact>false</web:CustContact>
                  <web:DateTimeContact>0001-01-01T00:00:00</web:DateTimeContact>
                  <web:CustCallback>false</web:CustCallback>
                  <web:DateTimeCallback>0001-01-01T00:00:00</web:DateTimeCallback>
                  <web:ProbDetails>ON AND READ ON AND READ OWNERS 502269         Meter - Residential  - City water and Sewer      - 001 Dwelling units</web:ProbDetails>
                  <web:CellPhone/>
                  <web:Fax/>
                  <web:CustDistrict>5</web:CustDistrict>
                  <web:CustState>GA</web:CustState>
                  <web:Text1>?</web:Text1>
                  <web:Text2>?</web:Text2>
                  <web:Text3>?</web:Text3>
                  <web:Text4>?</web:Text4>
                  <web:Text5>?</web:Text5>
                 </web:CustomerCallData>
            </web:CustomerCalls>
         </web:reqData>
      </web:UpdateRequest>
   </soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:web="http://www.azteca.com/cityworks/webservices";>
   <soapenv:Header>
      <web:CWAuthHeader>
         <!--Optional:-->
         <web:UserName>me</web:UserName>
         <!--Optional:-->
         <web:Password>you</web:Password>
      </web:CWAuthHeader>
   </soapenv:Header>
   <soapenv:Body>
      <web:GetRequestByRequestId>
         <web:requestId>0000824748</web:requestId>
      </web:GetRequestByRequestId>
   </soapenv:Body>
</soapenv:Envelope>


results

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
   <soap:Body>
      <GetRequestByRequestIdResponse xmlns="http://www.azteca.com/cityworks/webservices";>
         <GetRequestByRequestIdResult>
            <RequestId>824748</RequestId>
            <DomainId>1</DomainId>
            <ProjectSid>-9999</ProjectSid>
            <ProblemCode>CONNECT SERVICE</ProblemCode>
            <Details>OWNERS 502269         Meter - Residential  - City water and Sewer      - 001 Dwelling units</Details>
            <ReqCategory>FS</ReqCategory>
            <Description>On - Read</Description>
            <Priority>3</Priority>
            <SRX>0</SRX>
            <SRY>0</SRY>
            <ProblemSid>10196</ProblemSid>
            <ReqCustFieldCatId>6011</ReqCustFieldCatId>
            <ProbAddress>2112 JEFF DAVIS ST.</ProbAddress>
            <ProbCity>MACON</ProbCity>
            <ProbZip/>
            <ProbAddType>A</ProbAddType>
            <InitiatedBy>HJR via CITYWOSR - MWACIS</InitiatedBy>
            <DateTimeInit>2009-05-05T17:18:29</DateTimeInit>
            <SubmitToPager/>
            <SubmitToPhone/>
            <SubmitTo>-9999</SubmitTo>
            <SubmitToEmail/>
            <ClosedBy/>
            <DateTimeClosed>0001-01-01T00:00:00</DateTimeClosed>
            <WorkOrderId/>
            <ProjectName/>
            <DateSubmitTo>2009-05-05T17:18:29</DateSubmitTo>
            <SubmitToOpenBy/>
            <DateSubmitToOpen>0001-01-01T00:00:00</DateSubmitToOpen>
            <DispatchTo/>
            <DateDispatchTo>0001-01-01T00:00:00</DateDispatchTo>
            <DispatchOpenBy/>
            <DateDispatchOpen>0001-01-01T00:00:00</DateDispatchOpen>
            <MapPage/>
            <Shop/>
            <Status>OPEN</Status>
            <Cancel>false</Cancel>
            <CancelledBy>?</CancelledBy>
            <DateCancelled>0001-01-01T00:00:00</DateCancelled>
            <LaborCost>0</LaborCost>
            <FieldInvtDone>false</FieldInvtDone>
            <DateInvtDone>0001-01-01T00:00:00</DateInvtDone>
            <WONeeded>false</WONeeded>
            <Excursion>false</Excursion>
            <TileNo/>
            <PrjCompleteDate>2009-04-29T21:30:00</PrjCompleteDate>
            <Text1/>
            <Text2/>
            <Text3/>
            <Text4/>
            <Text5/>
            <Text6/>
            <Text7/>
            <Text8/>
            <Text9/>
            <Text10/>
            <Text11/>
            <Text12/>
            <Text13/>
            <Text14/>
            <Text15/>
            <Text16/>
            <Text17/>
            <Text18/>
            <Text19/>
            <Text20/>
            <OtherSystemId>1225423</OtherSystemId>
            <OtherSystemStatus/>
            <OtherSystemCode/>
            <OtherSystemDesc/>
            <OtherSystemDesc2/>
            <ProbAptNum/>
            <ProbLandmark/>
            <ProbDistrict/>
            <ProbState/>
            <ProbLocation/>
            <CancelReason/>
            <Num1>-9999</Num1>
            <Num2>-9999</Num2>
            <Num3>-9999</Num3>
            <Num4>-9999</Num4>
            <Num5>-9999</Num5>
            <Date1>0001-01-01T00:00:00</Date1>
            <Date2>0001-01-01T00:00:00</Date2>
            <Date3>0001-01-01T00:00:00</Date3>
            <Date4>0001-01-01T00:00:00</Date4>
            <Date5>0001-01-01T00:00:00</Date5>
            <InitiatedByApp>MWACIS</InitiatedByApp>
            <Resolution/>
            <StreetName/>
            <LockedByDesktopUser/>
            <Comments>OWNERS 502269         Meter - Residential  - City water and Sewer      - 001 Dwelling units</Comments>
            <CustomerCalls>
               <CustomerCallData>
                  <IncidentNum>26752</IncidentNum>
                  <RequestId>824748</RequestId>
                  <FirstName/>
                  <LastName>UNKNOWN</LastName>
                  <Title/>
                  <MiddleInitial/>
                  <AcctNum>040374</AcctNum>
                  <CCX>0</CCX>
                  <CCY>0</CCY>
                  <AptNum/>
                  <CustAddress>2112 JEFF DAVIS ST.</CustAddress>
                  <CustCity>MACON</CustCity>
                  <CustZip/>
                  <CustAddType>A</CustAddType>
                  <HomePhone>4787432830</HomePhone>
                  <DateTimeCall>2009-05-05T17:18:29</DateTimeCall>
                  <OtherPhone/>
                  <Email></Email>
                  <WorkPhone/>
                  <IsResident>true</IsResident>
                  <IsFollowUpCall>false</IsFollowUpCall>
                  <CallerType>?</CallerType>
                  <Comments/>
                  <CustContact>false</CustContact>
                  <DateTimeContact>0001-01-01T00:00:00</DateTimeContact>
                  <CustCallback>false</CustCallback>
                  <DateTimeCallback>0001-01-01T00:00:00</DateTimeCallback>
                  <ProbDetails>ON AND READ ON AND READ OWNERS 502269         Meter - Residential  - City water and Sewer      - 001 Dwelling units</ProbDetails>
                  <CellPhone/>
                  <Fax/>
                  <CustDistrict>5</CustDistrict>
                  <CustState>GA</CustState>
                  <Text1>?</Text1>
                  <Text2>?</Text2>
                  <Text3>?</Text3>
                  <Text4>?</Text4>
                  <Text5>?</Text5>
               </CustomerCallData>
            </CustomerCalls>
         </GetRequestByRequestIdResult>
      </GetRequestByRequestIdResponse>
   </soap:Body>
</soap:Envelope>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------