Delete the object through tridion core service - tridion

I am not able to delete the object through core service.
I am getting object reference not found error. I am able to create and get the object but delete functionality fails.
I am using this code:
var client = new CoreService2010Client();
client.ClientCredentials.Windows.ClientCredential.UserName = Settings.UserID;
client.ClientCredentials.Windows.ClientCredential.Password = Settings.Password;
client.Open();
client.Delete(TCMURI);
here's the error:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Tridion.ContentManager.CoreService.Client.ICoreService.Delete(String id)
at Tridion.ContentManager.CoreService.Client.CoreServiceClient.Delete(String id)
at TridionCoreService.Program.testing() in C:\WORK\My Work\TridionCoreService\TridionCoreService\Program.cs:line 125
at TridionCoreService.Program.Main(String[] args) in C:\WORK\My Work\TridionCoreService\TridionCoreService\Program.cs:line 25
I am using above code only and pass the tcm URI
Error Code : {System.ServiceModel.FaultCode}

I had the same error and it was related to UGC.
I disabled UGC (commented out the model and editor in the config and the eventsystem.dll from ugc), restarted the server and everything worked.
Check the 'Tridion' Windows Event Log on the Content Manager Server. There is probably an error related to UGC. I think you need to contact CS to fix this, since the error is in the Eventsystem dll from UGC

Related

WebService cannot communicate with another WS via IIS but it can via VisualStudio

First of welcome as it is my first post.
I developed WebService (.NET 4.0) which is connecting to two other WebServices. One of these two is external, second one is internal but located on another server.
When developing in Visual Studio, communication was perfect, everything was fine - my WS against two other. But when I moved my WS to IIS on a server I received issue:
There was no endpoint listening at <<<url>>> that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
In inner exception I have (sorry for german;]):
Server stack trace:
bei System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
bei System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
bei System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei MessagingAgent.eCallWS.eCallSoap.SendSMSBasic(SendSMSBasicRequest request)
bei MessagingAgent.eCallWS.eCallSoapClient.MessagingAgent.eCallWS.eCallSoap.SendSMSBasic(SendSMSBasicRequest request) in C:\_projects\MessagingAgent\Service References\eCallWS\Reference.cs:Zeile 888.
bei MessagingAgent.eCallWS.eCallSoapClient.SendSMSBasic(String AccountName, String AccountPassword, String Address, String Message, String JobID, String SMSCallback, String Notification, String Answer, String SendDate, String MsgType, String NoLog, String AlwaysNotification) in C:\_projects\MessagingAgent\Service References\eCallWS\Reference.cs:Zeile 906.
bei MessagingAgent.SmsSender.SendSmsBasic(String address, String message, String jobId) in C:\_projects\MessagingAgent\SMS\SmsSender.cs:Zeile 46.
bei MessagingAgent.Service1.SendSMSWithJob(String telNo, String content, String jobID) in C:\_projects\MessagingAgent\SMSProvider.asmx.cs:Zeile 48.
In order to pass more information - WS hosted on IIS 6.1. I created new ApplicationPool for that
Can you help me somehow?
My problem was the proxy server on our corporate network. I had to explicity state it in my web.config and it worked fine.
Here is what I added to web.config:
<system.net>
<defaultProxy>
<proxy
proxyaddress="http://webproxy.mycompany.com:8080"
bypassonlocal="true"
/>
</defaultProxy>
</system.net>
What confuses me is that without the above statement it worked fine when it was hosted by the Visual Studio Development server but not on IIS. Never mind - I have it working now

BizTalk error : Unable to process exec message

I've been getting the following error in a production environment. Please refer the error in the bottom. So far I was able to recreate the problem by letting the orchestration suspend by forcing a db timeout in the application db call, and resuming the instance. After repeating the action for 2 rounds on the same instance, third time the instance will get suspended with the error below.
What could be the reason for this behavior?
BizTalk Error
Uncaught exception (see the 'inner exception' below) has suspended an
instance of service '{ORCHESTRATION
NAME}(57adc083-7423-2bff-bd2d-ca813b8c0f4e)'. The service instance
will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state
and may re-throw the same unexpected exception. InstanceId:
1bca1f03-7780-4f45-af2e-020724c8a92d Shape name: ShapeId: Exception
thrown from: segment -1, progress -1 Inner exception: Unable to
process exec message.
Exception type: Exception Source: Microsoft.XLANGs.BizTalk.Engine Target Site: System.Object[]
get_Args() The following is a stack trace that identifies the location
where the exception occured
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.get_Args() at
{ORCHESTRATION NAME}.segment1(StopConditions stopOn) at
Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
StopConditions stopCond, Exception& exp)
Stack trace
xlang/s engine event log entry: Failed while delivering a message to a
service instance. Message details follow. Message ID:
61eaa7fc-ac85-42d9-bf3e-1bed258b82be Service Instance ID:
1bca1f03-7780-4f45-af2e-020724c8a92d Service Type ID:
57adc083-7423-2bff-bd2d-ca813b8c0f4e Subscription ID:
00000000-0000-0000-0000-000000000000 Body part name: Service type:
{ORCHESTRATION NAME}, {Assembly Details}
Exception type: BTXMessageDeliveryException The following is a stack
trace that identifies the location where the exception occured
at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._receiveOneMessage(Guid&
instanceId, Guid& serviceId, IBTMessage currentMsg) at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession.ReceiveMessages(IBTMessage[]
messages, Int32 firstIdx, Int32 count) at
Microsoft.BizTalk.XLANGs.BTXEngine.AppDomains.AppDomainRoot.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object
objMsg)
Additional error information:
Failed while delivering a message to a service instance. Message details follow. Message ID:
61eaa7fc-ac85-42d9-bf3e-1bed258b82be Service Instance ID:
1bca1f03-7780-4f45-af2e-020724c8a92d Service Type ID:
57adc083-7423-2bff-bd2d-ca813b8c0f4e Subscription ID:
00000000-0000-0000-0000-000000000000 Body part name: Service type:
{ORCHESTRATION NAME}, {Assembly Details}
Exception type: BTXMessageDeliveryException Source:
Microsoft.XLANGs.BizTalk.Engine Target Site: Void
DeliverMessage(System.Guid,
Microsoft.BizTalk.Agent.Interop.IBTMessage, Boolean ByRef) The
following is a stack trace that identifies the location where the
exception occured
at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._tryReceiveOneMessage(Boolean&
loggedError, Guid& instanceId, IBTMessage currMsg) at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._receiveOneMessage(Guid&
instanceId, Guid& serviceId, IBTMessage currentMsg) at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession.ReceiveMessages(IBTMessage[]
messages, Int32 firstIdx, Int32 count) at
Microsoft.BizTalk.XLANGs.BTXEngine.AppDomains.AppDomainRoot.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object
objMsg)
Additional error information:
The XLANG/s message has no part at index '0'. The total number of parts found in the message is '0'. If you expect a multipart
message, check that the pipeline supports multipart messages such as
MIME.
Exception type: MissingPartException Source:
Microsoft.XLANGs.BizTalk.Engine Target Site: Void
ReadMessageState(Microsoft.XLANGs.Core.Envelope,
Microsoft.XLANGs.BaseTypes.XLANGMessage) The following is a stack
trace that identifies the location where the exception occured
at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.ReadMessageState(Envelope
env, XLANGMessage msg) at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.ArgsFromExecEnvelope(IBTMessage
msg) at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.DeliverMessageImpl2(Guid
subscriptionId, IBTMessage msg, Boolean& receiveCompleted) at
Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.DeliverMessage(Guid
subscriptionId, IBTMessage msg, Boolean& receiveCompleted)
Received this myself. Not sure what you were doing when you started receiving it. For me, I had a working orchestration and then added a correlation set. I use BTDF so simply updated the GAC only with new orchestration when I really should've done a full re-deploy (I know, lazy.).
Anyway, once I did redeploy fully, cycle hosts, and retest it worked fine.
Probably not answer you are looking for but it helped me. Here was my stack trace:
Exception type: BTXMessageDeliveryException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void DeliverMessage(System.Guid, Microsoft.BizTalk.Agent.Interop.IBTMessage, Boolean ByRef)
The following is a stack trace that identifies the location where the exception occured
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._tryReceiveOneMessage(Boolean& loggedError, Guid& instanceId, IBTMessage currMsg)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._receiveOneMessage(Guid& instanceId, Guid& serviceId, IBTMessage currentMsg)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession.ReceiveMessages(IBTMessage[] messages, Int32 firstIdx, Int32 count)
at Microsoft.BizTalk.XLANGs.BTXEngine.AppDomains.AppDomainRoot.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object objMsg)
at Microsoft.XLANGs.BizTalk.CrossProcess.AppDomainStubProxy.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object msgs)
Additional error information:
Index was outside the bounds of the array.

The Security Support Provider Interface (SSPI) negotiation failed

I have error for my custom asp.net
my code asp code:
IServiceConfiguration<IOrganizationService> orgConfigInfo =
ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(new Uri("http://crm.tadbirgaranbm.com/TadbirgaranMellat/XRMServices/2011/Organization.svc"));
var creds = new ClientCredentials();
creds.UserName.UserName = "user";
creds.UserName.Password = "pass";
using (_serviceProxy = new OrganizationServiceProxy(orgConfigInfo, creds))
{
// This statement is required to enable early-bound type support.
_serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
_service = (IOrganizationService)_serviceProxy;
using (context srv = new context(_service))
{
Account acc = new Account();
acc.thr_FirstName = firstname.Text;
acc.thr_LastName = lastname.Text;
acc.thr_NationalCode = nationalcode.Text;
acc.EMailAddress1 = email.Text;
acc.thr_Mobile = cellphone.Text;
acc.Telephone1 = tel.Text;
srv.AddObject(acc);
srv.SaveChanges();
alert.ForeColor = System.Drawing.Color.Green;
alert.Text = "با موفقیت ثبت شد";
}
}
and then when i run this code in my visual studio work correctly but when i run in iis i get this error
The Security Support Provider Interface (SSPI) negotiation failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The Security Support Provider Interface (SSPI) negotiation failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Win32Exception (0x80004005): The Security Support Provider Interface (SSPI) negotiation failed.]
System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy) +6115112
System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState) +1325
System.ServiceModel.Security.IssuanceTokenProviderBase1.GetNextOutgoingMessage(Message incomingMessage, T negotiationState) +91
System.ServiceModel.Security.IssuanceTokenProviderBase1.DoNegotiation(TimeSpan timeout) +586
[SecurityNegotiationException: SOAP security negotiation with 'http://crm.tadbirgaranbm.com/TadbirgaranMellat/XRMServices/2011/Organization.svc' for target 'http://crm.tadbirgaranbm.com/TadbirgaranMellat/XRMServices/2011/Organization.svc' failed. See inner exception for more details.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14489026
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request) +0
Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request) +892
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request) +254
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChange(OrganizationRequest request, IList`1 results) +43
[SaveChangesException: An error occured while processing this request.]
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChanges(SaveChangesOptions options) +1791
crm.Reg.submit_Click(Object sender, EventArgs e) +790
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
this error occurs due to the time zone as the server is hosted on some other region which has a different time zone then the local timezone where the web application is running.
to solve this problem server have to manage the offset of every timezone and the simplest way to do it tom manage the time in UTC format. to learn more about UTC click here

FTPWebRequest in Batch

I made a batch class to check an FTP for files, download them and delete them on the FTP.
When I run it manually (not in batch) it works perfectly and downloads all files in the FTP and deletes them when the downloading is done.
The problem starts when i try to run this in batch, I tried both serverside and client batches.
Both of them give a timout error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The operation has timed out.
at System.Net.FtpWebRequest.CheckError()
at System.Net.FtpWebRequest.GetResponse()
--- End of inner exception stack trace ---
Does anyone have any experience downloading files from an FTP in batch?
I have tried setting the timeout time higher. I also tested the connection on the servers executing the batch-job and i can access the FTP. So it's not a firewall issue. I think it must be something within AX but I can't really think of anything.
this is the code (note: downloadfile and deletefile is the same code to make the connection with a differenct set_method():
permissionSet = new Set(Types::Class);
files = new List(types::String);
permissionset.add(new InteropPermission(InteropKind::DllInterop));
permissionset.add(new InteropPermission(InteropKind::ClrInterop));
CodeAccessPermission::assertMultiple(permissionset);
ftpo = System.Net.WebRequest::Create(<ftp link>);
request = ftpo;
request.set_KeepAlive(false);
request.set_UsePassive(false);
request.set_UseBinary(true);
request.set_Method("NLST");
credential = new System.Net.NetworkCredential(<user>,<pw>);
request.set_Credentials(credential);
try
{
//first get the filelist from FTP
response = request.GetResponse();
reader = new System.IO.StreamReader(response.GetResponseStream());
while(!reader.get_EndOfStream())
{
text = reader.ReadLine();
files.addStart(text);
}
reader.Close();
response.Close();
CodeAccessPermission::revertAssert();
if(files.elements() >0)
{
it = New ListIterator(files);
while(it.more())
{
filename = it.value();
downloadfile(filename);
deleteFile(filename);
it.next();
}
}
}
This is the full exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The operation has timed out.
at System.Net.FtpWebRequest.CheckError()
at System.Net.FtpWebRequest.GetResponse()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ClrBridgeImpl.InvokeClrInstanceMethod(ClrBridgeImpl* , ObjectWrapper* objectWrapper, Char* pszMethodName, Int32 argsLength, ObjectWrapper** arguments, Boolean* argsAreByRef, Boolean* isException)
In my experience file operations are not reliable when run in batch. If you try to run it on the client and it still times out then you may have another issue. In my experience, you may need to open up the properties for your FTP server (most likely it will be in IIS) and increase the time out limit. I had to do something similar with a web service that we use to generate sales tax. If we had a sales order with more than 100 lines, it would generate the same error. When we increased the timeout, the error went away.

Null buffer error

I've just noticed that when running an application I periodically get an error message.
Server Error in '/' Application.
Buffer cannot be null.
Parameter name: buffer
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Buffer cannot be null.
Parameter name: buffer
Stack trace:
[ArgumentNullException: Buffer cannot be null.
Parameter name: buffer]
System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) +12627669
MemcachedProviders.Session.Common.Deserialize(HttpContext context, Byte[] serializedItems, Int32 timeout) +47
MemcachedProviders.Session.Db.SQLDbOperations.GetItem(String strSessionId, String strApplicationName, Int32 iTime, HttpContext context, Boolean lockRecord, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +1221
MemcachedProviders.Session.SessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +1069
System.Web.SessionState.SessionStateModule.GetSessionStateItem() +178
System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object state) +299
[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
System.Web.SessionState.SessionStateModule.EndAcquireState(IAsyncResult ar) +11513726
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107
Our application uses Enyim memcached and MemcachedProviders and runs in a load balanced environment.
The application does alot of managing of PDF reports and compiling of responses then generating a final report pdf. So we use streams quite a bit.
This problem only appears to affect our management application as we also expose a webservice and I never get the error when looking at the service definition and WSDL.
From looking at the session table in the DB I can see that they are being created but, many of them have null in the SessionItems field and the locked flag set to 1.
The data time stamps seem to correlate to the null buffer error occurances.
Is this a case of a buffer set incorrectly or maxing out?

Resources