
Originally Posted by
bodybuzz
I am using ServiceCenter 6.2 not ServiceManager but i understand they are similar in the WSDL implementation.
I had the same problem and the only way i was able to fix was to use the FALCON login. Try using FALCON and see if you still get the same error.
I would be happy to look at your code to try to assist though.
..Darren
We are using manually created in SM web service for dataaccess operations (it helps to avoid conflicts with customization of SM being implemented by other team), besides there is no CreateIncidentActivity method in API WS.
This WS is quite simple and is very alike to the ones from native WS API.
SmServiceClient is WCF proxy generated with SvcUtil.exe.
Only trick here is slightly changed security section of binding in config:
Code:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" proxyCredentialType="None"
realm="" />
</security>
Here is the code of test reproducing the issue I've posted about. It takes existing activity, changes id and incident in retrieved object and posts it back to SM with create requests.
Code:
[Test]
public void CreateIncidentActivityTest()
{
SmServiceClient clnt=new SmServiceClient();
clnt.ClientCredentials.UserName.UserName = "falcon";
clnt.ClientCredentials.UserName.Password = "";
RetrieveSmIncActivityRequest request1 = new RetrieveSmIncActivityRequest();
request1.SmIncActivity=new SmIncActivity();
request1.SmIncActivity.ActivityId = new StringType();
request1.SmIncActivity.ActivityId.Value = "001A825";
RetrieveSmIncActivityResponse resp1 = clnt.RetrieveSmIncActivity(request1);
CreateSmIncActivityRequest request = new CreateSmIncActivityRequest();
request.SmIncActivity = resp1.SmIncActivity;
request.SmIncActivity.ActivityId = null;
request.SmIncActivity.IncidentId = new StringType();
request.SmIncActivity.IncidentId.Value = "IM10280";
CreateSmIncActivityResponse response = clnt.CreateSmIncActivity(request);
Console.Write(response.messages[0].Value);
Assert.AreEqual("SUCCESS",response.status);
}
Retrieve of existing activity passes ok, but creation of new one fails
test output is:
IncidentActivityTest.CreateIncidentActivityTest : Failed
User falcon does not have authorization to perform the action: add
NUnit.Framework.AssertionException:
expected: <"SUCCESS">
but was: <FAILURE>
at NUnit.Framework.Assert.AreEqual(Object expected, Object actual)
at IncidentActivityTest.IncidentActivityTest.CreateIn cidentActivityTest() in
IncidentActivityTest.cs:line 32
As you see I'm using FALCON credentials. Any ideas?
Bookmarks