4 Replies Latest reply: Jun 6, 2012 9:17 PM by PaulCo RSS

    Web Services Activity Insert problem with linking to child contact records

    PaulCo
      Hi - I am trying to use WS 2.0 to insert a new activity and link it to a list of contacts. I have converted this from WS 1.0. It works fine without the contact linking code but fails with the following message when linking to the contact records...

      Update operation on integration component 'Activity' failed because no matching record in business component 'Action' with search specification '[Description] = "Test2"' could be found.(SBL-EAI-04403)

      Here is a simplified version of the code in question...

      activity2.Activity act = new activity2.Activity();
      act.Url = cs.crmSessionUrl;
      activity2.ActivityInsert_Input input = new activity2.ActivityInsert_Input();
      input.ListOfActivity = new activity2.ListOfActivityData();
      input.ListOfActivity.Activity = new activity2.ActivityData[1];
      input.ListOfActivity.Activity[0] = new activity2.ActivityData();
      input.ListOfActivity.Activity[0].Subject = "Test2";
      input.ListOfActivity.Activity[0].Activity = "Task";
      input.ListOfActivity.Activity[0].Status = "Completed";
      input.ListOfActivity.Activity[0].Type = "Email";
      input.ListOfActivity.Activity[0].DueDate = DateTime.Parse( DateTime.Now.ToString("M/d/yyyy HH:mm:ss"));
      input.ListOfActivity.Activity[0].AccountId = "AEGA-BGV8Z9";
      input.ListOfActivity.Activity[0].ListOfContact = new activity2.ListOfContactData();
      input.ListOfActivity.Activity[0].ListOfContact.Contact = new activity2.ContactData[1];
      input.ListOfActivity.Activity[0].ListOfContact.Contact[0] = new activity2.ContactData();
      input.ListOfActivity.Activity[0].ListOfContact.Contact[0].Id = "AEGA-CCMEWM";
      activity2.ActivityInsert_Output output = act.ActivityInsert(input);

      Any suggestions would be great!
        • 1. Re: Web Services Activity Insert problem with linking to child contact records
          Runndn2-Oracle
          Is there a way you can get the output of the XML that is being built?
          • 2. Re: Web Services Activity Insert problem with linking to child contact records
            PaulCo
            Hi - here is the SOAP message,

            <?xml version="1.0" encoding="utf-8"?><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><ActivityInsert_Input xmlns="urn:crmondemand/ws/ecbs/activity/"><ListOfActivity xmlns="urn:/crmondemand/xml/Activity/Data"><Activity><Subject>Test2</Subject><AccountId>AEGA-BGV8Z9</AccountId><Type>Email</Type><Status>Completed</Status><Activity>Task</Activity><ListOfContact><Contact><Id>AEGA-CCMEWM</Id></Contact></ListOfContact></Activity></ListOfActivity></ActivityInsert_Input></soap:Body></soap:Envelope>

            Thanks for your help...
            • 3. Re: Web Services Activity Insert problem with linking to child contact records
              Runndn2-Oracle
              Try using execute instead.


              <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:ns="urn:crmondemand/ws/ecbs/activity/10/2004"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
              xmlns:data="urn:/crmondemand/xml/Activity/Data">
              <soapenv:Header>
              <wsse:Security>
              <wsse:UsernameToken>
              <wsse:Username>yourusername</wsse:Username>
              <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">yourpassword</wsse:Password>
              </wsse:UsernameToken>
              </wsse:Security>
              </soapenv:Header>
              <soapenv:Body>
              <ns:ActivityExecute_Input>
              <data:ListOfActivity lastpage="?" recordcount="?">
              <data:Activity operation="insert">
              <Subject>Test7</Subject>
              <AccountId>AALA-5KC0OV</AccountId>
              <Type>Email</Type>
              <Status>Completed</Status>
              <Activity>Task</Activity>
              <data:ListOfContact>
              <data:Contact >
              <data:Id>AALA-5851K0</data:Id>
              </data:Contact>
              </data:ListOfContact>
              </data:Activity>
              </data:ListOfActivity>
              </ns:ActivityExecute_Input>
              </soapenv:Body>
              </soapenv:Envelope>



              <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
              <SOAP-ENV:Body>
              <ns:ActivityExecute_Output xmlns:ns="urn:crmondemand/ws/ecbs/activity/10/2004">
              <ListOfActivity xmlns="urn:/crmondemand/xml/Activity/Data">
              <Activity>
              <ModifiedDate>2012-06-07T01:00:09Z</ModifiedDate>
              <CreatedDate>2012-06-07T01:00:09Z</CreatedDate>
              <ModifiedById>AALA-583LBZ</ModifiedById>
              <CreatedById>AALA-583LBZ</CreatedById>
              <ModId>1</ModId>
              <Id>AALA-5TG95O</Id>
              <CreatedBy>Web Services Administrator, 06/06/2012 18:00:09</CreatedBy>
              <ModifiedBy>Web Services Administrator, 06/06/2012 18:00:09</ModifiedBy>
              <ListOfContact>
              <Contact>
              <ModifiedDate>2012-03-19T20:19:55Z</ModifiedDate>
              <CreatedDate>2012-03-05T21:43:14Z</CreatedDate>
              <ModifiedById>AALA-583LBZ</ModifiedById>
              <CreatedById>AALA-583LBZ</CreatedById>
              <ModId>79</ModId>
              <Id>AALA-5851K0</Id>
              <CreatedBy>Web Services Administrator, 03/05/2012 13:43:14</CreatedBy>
              <ModifiedBy>Web Services Administrator, 03/05/2012 13:43:14</ModifiedBy>
              </Contact>
              </ListOfContact>
              </Activity>
              </ListOfActivity>
              </ns:ActivityExecute_Output>
              </SOAP-ENV:Body>
              </SOAP-ENV:Envelope>
              • 4. Re: Web Services Activity Insert problem with linking to child contact records
                PaulCo
                Thanks for the advice - yes using execute worked. I'm not sure why - do you have any idea why execute is a better way to go? and why insert fails?

                For those that are interested the .net code was

                activity2.ActivityExecute_Input input = new activity2.ActivityExecute_Input();
                input.ListOfActivity = new activity2.ListOfActivityData();
                input.ListOfActivity.Activity = new activity2.ActivityData[1];
                input.ListOfActivity.Activity[0] = new activity2.ActivityData();
                input.ListOfActivity.Activity[0].Subject = "Test3";
                input.ListOfActivity.Activity[0].Activity = "Task";
                input.ListOfActivity.Activity[0].Status = "Completed";
                input.ListOfActivity.Activity[0].Type = "Email";
                input.ListOfActivity.Activity[0].DueDate = DateTime.Parse( DateTime.Now.ToString("M/d/yyyy HH:mm:ss"));
                input.ListOfActivity.Activity[0].AccountId = "AEGA-BGV8Z9";
                input.ListOfActivity.Activity[0].ListOfContact = new activity2.ListOfContactData();
                input.ListOfActivity.Activity[0].ListOfContact.Contact = new activity2.ContactData[1];
                input.ListOfActivity.Activity[0].ListOfContact.Contact[0] = new activity2.ContactData();
                input.ListOfActivity.Activity[0].ListOfContact.Contact[0].Id = "AEGA-CCMEWM";
                input.ListOfActivity.Activity[0].operation = "insert";