Throw Soap Exception in BPM.

Hi All,
My scenario is Soap->XI->BPM->RFC. I get a soap request in synchronous way with Request and Response messages I Map my request to a RFC and If there's any application error or mapping error I have to send SOAP fault exception to my Soap Sending system. But I don't see any option in BPM to throw soap exception only thing I can do is to map my errors in the soap response and send it to soap sender.
But my Soap sending system needs soap fault not a response message when any errors happen.
Please let me know if anybody has this same situation and how to handle it.
Thanks in Advance,
SP.

Hi VJ,
I have to use BPM as I am doing other stuff in my BPM. In my BPM I am catching mapping exception and then I have to send this to Soap Sender in SOAP fault message and in abstract interfaces we don't have option to give fault message types. Also, I am using S/A bridge and I have to close the brige in order to send some response to Soap Sender.
Is it possible to send soap fault when we close the S/A brige by send step.
Thanks,
SP.

Similar Messages

  • How to Throw/Catch Exceptions in BPM

    Hi All,
    I've seen a couple articles that talk about how to Throw/Catch an execption in a BPM. My question has two parts:
    1) RFC Call: I was able to catch an Fault Message in an exception step when calling an RFC (Synchronous Interface). What I wanted to do is use the fault message (exception) and store it in a DB for later review.
    2) IDOC: I'm sending an IDOC to R3 from a BPM. The send step is enclosed in a block w/ an exception. The send step is throwing an error (IDOC adpater system error), but the exception is never thrown. My question is: when the error occurrs at the adapter level does it still throw an exception in a BPM?
    Thanks for any tip/advice/anything!
    Fernando.

    Hi Fernando,
    1) Define a send step in the exception branch.
    2) If u send a IDoc from R/3 to XI and the IDoc adapter is running to an error of course there cant be an exception in ur business process. Usually the IDoc adapter sends back status back up via ALEAUD. In case of success IDoc should have then '03', if the adapter cannot send anything the IDoc should remain at '39'. U should send a ALEAUD in case of exception of BPM switching to status '40', in case of success to '41'.
    Regards, Udo

  • Throwing Runtime Exceptions from BPM. How?

    Hi !
    I want to make appear a red flag in the SXMB_MONI as a result of a custom condition inside a BPM. I tried with the control step, but it makes no "red flag".
    Should I make a transform step between 2 dummy message types with a UDF that throws the runtime exception there?? is there another way ?? We want a red flag as a result of a expired deadline while waiting a file adapter transport acknowledgement.
    Thanks !!
    Matias.

    Matias,
    As you said before you want the BPM to be errored out if it reach the deadline, am I right. In control step if u say cancel process it equivalent to logically deleting the work items, so obviously you will get an succesfull message. What I suggest you to do is in  Deadline branch - control branch select throw exception. The exception name has to be defined in Block level. So if you throw an exception it will look for the exception branch in the same block level if not the higher(super)block level, if it couldn't find the exception branch it will run out to error. Actually the exception branch is used to catch that exception and continue the rest of the process, so i think there is no need for defining the exception branch itself.
    Hope it helps you!!!
    Best regards,
    raj.

  • Ssrs report web service to save report as pdf throws error Soap exception unhandeled by user code

    I am creating a C# web application to save  an SSRS report as a pdf file on my local machine.
    I added the ReportService web reference as RS2005 and ReportExecution2005 web reference as RE2005.
    http://myServer/ReportServer_DEVPROJECT/ReportExecution2005.asmx?WSDL
    http://myServer/ReportServer_DEVPROJECT/ReportService2005.asmx?WSDL
    I created the following function SaveReport that is called on button click. My report can be accessed on the report server with the following url:
    http://myServer/Reports_DEVPROJECT/Pages/Report.aspx?ItemPath=%2fData+Mgmt%2fSample+Letter
    On the Report Manager home page the report link appears as "SAMPLE LETTER".
    It is deployed in the DataMgmt folder on the Report Manager.
    It uses a data source called "DS Letter" with option "Credentials stored securely in the report server"
    My application gets compiled, but I get the following run time error:
    Error: Soap exception unhandeled by user code. The item '/DataMgmt/Sample Letter' cannot be found. ---> Microsoft.ReportingService
    s.Diagnostics.Utilities.ItemNotFoundException: The item '/DataMgmt/Sample Letter' cannot be found.
    Please check my code and let me know what I can do to run this successfully. Once this is done, I would like to get help with passing a parameter (memberID) to the generate report for that member, through this application.
    Thank You in advance for your help.
    public static void SaveReport()
    RS2005.ReportingService2005 rs;
    RE2005.ReportExecutionService rsExec;
    // Create a new proxy to the web service
    rs = new RS2005.ReportingService2005();
    rsExec = new RE2005.ReportExecutionService();
    // Authenticate to the Web service using Windows credentials
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
    rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;
    rs.Url = "http://myServer/ReportServer_DEVPROJECT/ReportService2005.asmx";
    rsExec.Url = "http://myServer/ReportServer_DEVPROJECT/ReportExecution2005.asmx";
    string historyID = null;
    string deviceInfo = null;
    string format = "pdf";
    Byte[] results;
    string encoding = String.Empty;
    string mimeType = String.Empty;
    string extension = String.Empty;
    RE2005.Warning[] warnings = null;
    string[] streamIDs = null;
    string fileName = @"c:\temp\samplerHAPeport.pdf";
    string _reportName = @"/DataMgmt/Sample HAP Letter";
    string _historyID = null;
    bool _forRendering = false;
    RS2005.ParameterValue[] _values = null;
    RS2005.DataSourceCredentials[] _credentials = null;
    RS2005.ReportParameter[] _parameters = null;
    try
    _parameters = rs.GetReportParameters(_reportName, _historyID, _forRendering, _values, _credentials);
    RE2005.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);
    RE2005.ParameterValue[] parameters = new RE2005.ParameterValue[1];
    if (_parameters.Length > 0)
    //parameters[0] = new RE2005.ParameterValue();
    //parameters[0].Label = "";
    //parameters[0].Name = "";
    //parameters[0].Value = "";
    rsExec.SetExecutionParameters(parameters, "en-us");
    results = rsExec.Render(format, deviceInfo,
    out extension, out encoding,
    out mimeType, out warnings, out streamIDs);
    using (FileStream stream = File.OpenWrite(fileName))
    stream.Write(results, 0, results.Length);
    catch (Exception ex)
    throw ex;
    protected void BtnGenReport_Click(object sender, EventArgs e)
    SaveReport();

    Hello Devster,
    Thank you to post your question on TechNet forum.
    After reviewing the whole post, I have a question to you. You can access the report via the link, http://myServer/Reports_DEVPROJECT/Pages/Report.aspx?ItemPath=%2fData+Mgmt%2fSample+Letter.
    From the URL, I can see that the report is located at: /Data Mgmt/Sample Letter, instead of /DataMgmt/Sample Letter. In addition, I found that the target report is "/DataMgmt/Sample HAP Letter" instead of "/DataMgmt/Sample Letter" as the error described. I
    am not sure whether you post out the correct code segment.
    Please check the above things on your side, and hope it is helpful to you.
    Regards,
    Edward
    Edward Zhu
    TechNet Community Support

  • Interface mapping test successful, throws exception in BPM

    Hi.
    We are having a problem with an Interface mapping which works when
    tested in Integration Builder, but throws an Exception when it is part
    of the Transformation in a BPM.
    The scenarion is such:
    1. The sender calls the outbound interface using a web service.
    2. XI uses the input and passes to the Integration Process
    3. In the BPM, a LOGON message is built to call the web service as
    specified by an external web service . The input and
    output messages are just a single string, in which the other XML is
    embedded.
    4. XI receives a response from the web service call
    5. XI Extracts the sessionId from the response and combines it with the
    initial input (Step 1) to create the query for the query message in
    the web service.
    It is in Step 5 where the transformation fails, with an Exception in
    the DefaultTrace.trc as
    Runtime exception occurred during execution of application mapping program com/sap/xi/tf/_MM_LogonResponse_PropertySearchRequest_to_ExternalRequestSOAP_: com.sap.aii.utilxi.misc.api.BaseRuntimeException; RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:Messages/ns0:Message1/ns1:EXTERNAL/REQUEST. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    Thrown:
    MESSAGE ID: com.sap.aii.ibrun.server.mapping.rb_MappingRuntimeException.EXCEPTION_DURING_EXECUTE
    com.sap.aii.ibrun.server.mapping.MappingRuntimeException: Runtime exception occurred during execution of application mapping program com/sap/xi/tf/_MM_LogonResponse_PropertySearchRequest_to_ExternalRequestSOAP_: com.sap.aii.utilxi.misc.api.BaseRuntimeException; RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:Messages/ns0:Message1/ns1:EXTERNAL/REQUEST. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    I have extracted the data from the initial request (step 1) and the
    logon response (step 4) and using these I have tested the Interface
    Mapping. There is no problem with this and the tests are successful.
    From what I can see, because the Response field in the LOGONResponse
    contains more XML tags, XI must be parsing it and assuming the tags are
    tags in the message, and not just the string, thus it is complaining
    that the XSD types do not match. This extra XML Parsing does not take
    place in the Interface Mapping Test.
    I have put the response into a User Defined Function which just has one
    line "return new String("Hello")" and that fails. However, if this UDF
    does not have the Response as the input, it does not complain.
    Please advise.
    --Reenal

    hi
    You will have to use specific replacements for you xml tags if it is coming as a paramter
    replace '<' with &lt;
    replace '>' with &gt;
    for eg: I want to pass <TakeIt>200</TakeIt> as value to Element <A>
    Mapping won't work if it is passed like
    a) <A><TakeIt>200</TakeIt></A> - Wrong
    Instead the replace the angle brackets
    b) <A>&lt;TakeIt&gt;200&lt;/TakeIt&gt;</A> - Correct
    While testing the mapping in IR (a) will work bcoz the test tool will convert it to (b) format. Check the xml source in test tool.
    So ensure the web response is like (b)
    rgds,
    Arun

  • How to throw a SOAP exception

    Hi,
    I have a requirement from customer that when they call the WSDL from their app and the workflow will not get what it should, that it should throw standard SOAP exception.
    To give more details on it, they will send for example input string "A" and based on that I will return output string "B" in the process.
    Now if they ask for "C" for instance, I need to be able to throw that SOAP exception. Is that possible? The process in workbench consists of simple decision point and set value activity based on route conditions.
    Thanks
    J.

    I am assuming you are wanting something to come back as a SOAP fault element?
    Unhandled process exceptions are sent back as faults. So, theoretically, you could write a service component to do nothing but throw an exception. Then you could route your process to call that in specific situations.
    As an alternative, I would consider having something like an additional 'status' output variable that always came back in the response which indicated the status of your process.
    Good Luck,
    Ryan M. Jacobs
    [email protected]
    Cardinal Solutions Group

  • Throwing Client Soap Exceptions

    I am writing j2ee web services and would like to throw Client soap exceptions when a input validation error occurs. Currently I can throw a soap exception and have the msg= be set to what I would like. I cannot set the faultCode to what I would like.
    An example of the kind of errors I am generating.
    SOAPException: faultCode=SOAP-ENV:Server; msg=Input SSN is not valid.]
    An exmpale of the kind of error I would like to generate.
    SOAPException: faultCode=SOAP-ENV:Client; msg=Input SSN is not valid.]
    Thank you,
    David Schwartz

    Hi ,
    The client does not have a hook on the SOAP Fault(or for that matter , the SOAP message ).It only receives the marshalled java objects from the proxy.
    You might hack the generated proxy code , and hack further into the Response objects , and the Fault object to create your customized fault .
    Thanks
    Anirban

  • Exception in BPM

    Hello Dear Community ,
    I have an asynchronous scenario using BPM and it's working well.........
    Start->Receiver->Transformation->Send->Stop
    I inserted a Container operation and Control using Michal's Blog "Alerts with variables from the messages payload (XI) - UPDATED" /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated to send an alert and it worked well too.
    I move the Container and Control Steps to an Exception Block.....but when mapping error occurs It seems to be that the Exception isn't caught and the alert is never send...
    I did next steps:
    - I inserted a block and I entered the exception "runtime".
    - I add an exception handler branch and I entered the exception "runtime" in the   exception handler attribute.
    - In the transformation step I entered the exception "runtime".
    - I moved the Container operation and the Control step into the exception branch.
    My doubt is if I can catch any exception in the BPM. In this case the mapping error was due to a bad index using the substring function.
    Or is it necessary to throw the exception explicitly in the mapping ?.
    thanks a lot for your help.

    First, check whether your BPM instances have "COMPLETED" status in SWWL (or SXMB_MONI_BPE, but SWWL is simpler; don't delete any instances though ).
    If there are any instances with "ERROR" status in SWWL, then your BPM is having problem before that and is not even getting to the exception throwing step.
    You can double click the BPM name in order to go into technical workflow (and from there you can check which steps executed with errors).
    If all the instances are ok, make sure that the exception branch was not executed.
    Go into the BPM technical workflow and check which steps were executed. Make sure that the steps in exception branch were not.
    If they were executed, then the problem is with your alert. Maybe it was not defined correctly.
    If they were not, then the problem really is in exception throwing.
    Which exception did you expect to happen? Are you sure it had happened?
    Get the payload which is used in Transformation Step (from SXMB_MONI message which goes into BPM) and test it in Message Mapping (or Interface Mapping) test tab.
    Regards,
    Henrique.

  • Control step for exception in BPM

    Hi
    i am tring to learn exception in BPM.
    i inserted this Send step (Synchronous) in exception branch in block. and then inserted control step in exception branch.
    i created Errorsend as abbreviation on exception in block.
    and assigned this to system error under exceptions in send step. and then defined on Exception handler,
    and now <b>i could not define anything</b> on exception in control step for action as Throw Exception, i am not looking at Throw alert.
    i made receiver jdbc error and also mapping error in intentionally. when i see sxmb_moni, i can see jdbc error as normal process like not using exception branch.
    i would like to complete exception branch and control step for finishing touches.
    thanks
    venjamin

    hi,
    send step is for synch and jdbc,,,
    abaproxy to jdbc (sync)
    i made receiver jdbc error intentionaly. can i send back exception log to sender system program or send email to someone?
    when have you been using this function in bpm? if i am not right way.
    thanks
    venjamin

  • Trigger an exception in BPM ( Control Step )

    Hi everyone,
    I have a BPM which has a switch with three branch, one of them has a transformation to generate a mail structure and a sender to send the email, now I need throw an exception after send the email, I have think use a control step to do it, but I don't know how use the control step to throw an exception.
    Could someone please help me?
    Thanks, in advance.

    Jose,
    Please refer to the following url
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Also refer to the example scenarios in the Design: Integration Builder.  For example
    <b>Software component</b> SAP BASIS
    <b>Software component version</b> SAP BASIS 6.40
    <b>Namespace</b> http://sap.com/xi/XI/System/Patterns
    <b>Integration Scenarios and Integration Processes</b>
    <b>Integration Processes</b> BpmPatternReqRespTimeOut
    Regards,
    Mike

  • Throwing generic exception in XI

    Hi friends
    I was trying to incorporate one of the blog by champion blogger Michal, which deals with Throwing Generic Exception.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6398. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Is there any way around for avoiding ABAP mapping (hard part) and implementing some java code in place of that?
    In second step instead of going for ABAP mapping I tried to raise an exception by using  exception classes as explained in   https://www.sdn.sap.com/pub/wlg/3069. [original link is broken] [original link is broken] [original link is broken] [original link is broken] but by that way Error in SOAP header (in SXMB_MONI) displayed Runtime Exception rather than showing user defined/desired message

    hi,
    just like explained in my blog - you can only do it in ABAP
    to have it in error header segment of XI message
    >>>>but by that way Error in SOAP header (in SXMB_MONI) displayed Runtime Exception rather than showing user defined/desired message
    just like Alex mentioned in his blog - that's why I wrote mine
    Regards,
    michal

  • ARB PHP Sample Code SOAP Exception

    Hello Everybody
    I m using ARB PHP Sample Code.
    I m using it as it is provided with my login id and transaction key
    I m using PHP 5.2 version
    I m quite new to SOAP.
    Everything seems fine but the script is throwing following exception.
    SoapFault exception: [soap:Client] Server was unable to read request.
    ---> There is an error in XML document (2, 584). ---> Input string was
    not in a correct format. in /mysite//php_arb/PHP/
    api_authorize_net_soap_v1.php:1869 Stack trace: #0 /mysite//php_arb/
    PHP/api_authorize_net_soap_v1.php(1869): SoapClient-
    >__soapCall('ARBCreateSubscr...', Array) #1 /mysite//php_arb/PHP/
    subscription_create.php(24): AuthorizeNetWS-
    >ARBCreateSubscription(Object(ARBCreateSubscription)) #2
    May i please have some help on how to resolve this and get the code
    working for me?
    I m trying to trace out the issue but my efforts are in vain.
    I look forward to recieve some help from everybody in this group
    Pls reply
    Thanking You in advance

    Hello Devster,
    Thank you to post your question on TechNet forum.
    After reviewing the whole post, I have a question to you. You can access the report via the link, http://myServer/Reports_DEVPROJECT/Pages/Report.aspx?ItemPath=%2fData+Mgmt%2fSample+Letter.
    From the URL, I can see that the report is located at: /Data Mgmt/Sample Letter, instead of /DataMgmt/Sample Letter. In addition, I found that the target report is "/DataMgmt/Sample HAP Letter" instead of "/DataMgmt/Sample Letter" as the error described. I
    am not sure whether you post out the correct code segment.
    Please check the above things on your side, and hope it is helpful to you.
    Regards,
    Edward
    Edward Zhu
    TechNet Community Support

  • Is it possible to throw an exception from a handler chain with JAXWS???

    I know I cannot throw directly an exception from the handler cause my handler extends SOAPHandler and the method handlerMessage cannot throw exceptions. The problem is that I would like to validate some authorization and if the client doesn't have the appropriate rights, I would like to throw an exception from the handler without calling the web service itself, so the client would receive a valid soap response from the server. Is it possible?? Is there another mechanism that I can use to do that??
    Thanks a lot
    Korg

    You can throw a ProtocolException or RuntimeException from handleMessage().
    If you throw ProtocolException, HandleFault() is called on previously invoked handlers.
    If you throw a RuntimeException, handleFault() or handleMessage() is not called on previously invoked handlers, and the Exception is converted to Fault message and dispatched.

  • JAXB2 marshaller throws Validation Exception

    Hello All.. I am trying to marshall a JAXB Object using JAXB2 marshaller and validate it against an xsd.
    During this process of validation, the parser when reads the xsd fails with the parse error. The schema xsd is a working xsd from a webservice provider. The validation is fine when it is done on XML Spy and SOAP UI. But when this xerces xmlschema validator comes to picture its even not able to parse the XSD for validating against it.
    Here is the head of the xsd..
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
         xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
         xmlns:tns="http://com.cyber.space./services"          
         targetNamespace="http://com.cyber.space./services"
         elementFormDefault="qualified"
    and a huge schema followed.
    Step.1: I used this xsd to generate JAXB classes.
    Step2. Used jaxb2marshaller from spring.oxm,
    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
              <property name="contextPath" value="com.cyberspace.service"/>
              <b><property name="schema" value="classpath:pathtoXsd"/></b>
         </bean>
    so in my application , i have reference to marshaller object.so can use like this.
    request ( the jaxb request object populated with valid values as per the schema)
    result - output -- outgoing xml.
    marshaller.marshall(requsest, result);
    Here comes the problem..The out going xml is like this..
    <?xml version="1.0" encoding="UTF-8" ?>
    <Request xmlns="http://com.cyber.space./services">
    <RequestService>123</RequestService>
    etec etc etc.. son on..
    This xml when converted to soap message and sent over to webservice its accepted as valid request and response is back. But all it happens when i dont validate it against the schema that i have.
    Look at the :
    <b><property name="schema" value="classpath:pathtoXsd"/></b> set as a property to jaxb2 marshaller.
    This makes sure that the xml generated out the jaxb object after marshall process is valid against the XSD schema. Here it fails for some reason.
    If the dont ask the marshaller to validate( removing the schema property ), then the xml is fine able to proceed with next steps of sending the successfull VALID SOAP REQUEST and response is back. But if do a validation by setting the schema property with value as path to xsd.
    The error is :
    Caused by:<b> org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.2: ' ' is not a valid value of list type 'null'.</b>
         at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109)
         at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104)
         at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
         at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
         at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429)
    ...,more
    Is it a problem with namespace.? If i assume that the resulting xml out of the marshall process when validated against the XSD is failing for some missing data( business data), then the request itself would not be sent as soap requst.
    But the problem is not that with data in the xml. its some thing going on with the strict validation the validator is doing.
    Edited by: cnu_coder on May 22, 2008 7:41 AM
    Edited by: cnu_coder on May 23, 2008 8:14 AM

    Hello,
    The ABAP code looks ok except the missing if error != null statement.
    Please check the similar code for raising exception provided in the below blog:
    /people/ravi.gupta4/blog/2010/02/04/automating-cancellation-of-a-failed-message-in-xi
    Also, Can you check whether exception is raised using Dynamic config UDF and a call to abap mapping is made.
    Check the other approach of raising an exception:
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    -Rahul

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi,
    I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:-
    System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
    Server stack trace: 
    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 Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type us
    Same code works perfectly on my Development machine, Please help. Below is the Code
    base.EventFiringEnabled = false;
    bool isFile = (properties.AfterProperties["vti_filesize"] != null);
    if (isFile == true)                   
    SPWeb currentWeb = properties.OpenWeb();
    // Get foldername from url like Document/EC10001/filename.txt                       
    string folderName = properties.AfterUrl.Split(new char[] { '/' })[1];
    SPList spList = currentWeb.Lists[properties.List.ID];                       
    SPQuery spQuery = new SPQuery();                       
    spQuery.Query = "<OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>";
    //Getting the folder object from the list                       
    SPFolder folder = spList.RootFolder.SubFolders[folderName];
    //Set the Folder property                       
    spQuery.Folder = folder;
    int fileSequenceId = 0;                      
    SPListItemCollection items = spList.GetItems(spQuery);
    if (items.Count > 0)                       
    string documentID = items[0]["DocumentID"] != null ? items[0]["DocumentID"].ToString() : string.Empty;
    if (!string.IsNullOrEmpty(documentID))                           
    string splitNumber = documentID.Split(new char[] { '-' })[1];                               
    fileSequenceId = Convert.ToInt32(splitNumber) + 1;                           
    else                           
    properties.ErrorMessage = "Unable to generate Document Id";                               
    properties.Cancel = true;                           
    else                       
    fileSequenceId = 1;                       
    // Set DocumentID like EC10001-001                       
    properties.AfterProperties["DocumentID"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));      
    // Retrive "EEC000" string from Constant List               
    properties.AfterProperties["vti_title"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));   
    // Retrive "EEC000" string from Constant List                
    base.EventFiringEnabled = true;
    Thanks,
    Pranay Chandra Sapa

    Hi,
    According to your description, my understanding is that when you upload document in Office 365 site, the event receiver in sandbox solution throws error.
    Per my knowledge, if you want to use event receiver in Office 365 environment, you need to use remote event receiver instead the normal event receiver in an app.
    Here are some detailed articles for your reference:
    Create a remote event receiver in apps for SharePoint
    Handle events in apps for SharePoint
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • 5th gen Ipod not playing in any docking station

    I have a 6th generation ipod classic that works great in my pioneer receiver and in both cars. I bought a 5th gen ipod on ebay for my wife and it seems to work just fine. I restored it using itunes, then put synced songs to it. Everything works fine

  • Location search problem with iPhone map

    I am posting this to see if anybody else have the same problem, and hopeful a solution as well. The problem is that iPhone map started from a 3ird party software does not use my current location by default. For example, I did a search for pizza in go

  • Create Equipment Master at Goods Issue Save - Non Serialised Material

    Hi, We need to create equipment master for a material while issuing the material, i.e while saving the Goods Issue for that material. The material is not serialised. Are there any BAPI's or a BADI which I can use to accomplish the desired functionali

  • SOAP:ENV Error: Resource..not found on this server

    I created a simple java class with a method that returns org.w3c.dom.Element type. Created web service for this class and method in Jdeveloper. Deployed this web service in OC4J locally (as explained by other web services examples). Then I created a

  • Oracle XML source code

    Does Oracle plan to make the XML parser source code available to developers any time in the (near!!) future? Donald Wheeler null