Returning Errors from a webservice using XMLBeans

I have a webservice that accepts XML as input and output parameters, and I'm using XMLBeans to handle this. I'm trying to work out how I can return error information from the webservice, so I created an Exception.xsd schema and 'include' it in the output XML Schema, so an exception xml element is valid in the output schema. The problem is, the XMLBean class generated from the output XML schema has no methods that allow me to create an Exception element. Is there some other way of handling the return of exceptions from webservices using XML?

The answer is just throw a SoapFaultException and put the exception.xsd XMLBean in the FaultDetail section of the SoapFaultException.

Similar Messages

  • How to join the results from 2 webservices using BPEL?Architecture question

    Hi,
    I am new to BPEL. BPEL process calls two webservices, which return complex results. I need to process the results from 2 webservices using BPEL .The result will be a complex xml, join/merge of previous results.
    What is the best practice to do it with BPEL?
    I see three ways:
    1.To do the processing (join/ merge) inside the BPEL process itself and return complex xml.
    2.Develop auxiliary webservice in java. Auxiliary webservice will do the processing (join/merge). Call this webservice from BPEL process.
    3.Do a plain concatenation of the two XMLs in BPEL and forward it to the frontend. Frontend then will do all the logic on its side
    Thanks,
    Boris

    you could process the XMLs one at a time, and use XSL transformations to process the payload to a target schema.
    Activity 1:
    output from webservice1 -> transform 1 -> partial XML (of target schema)
    Activity 2:
    output from webservice2 -> transform 2 -> completed XML (of target schema)
    Regards,
    Shanmu.

  • How to return error from subscription function of an event

    I am creating a subscription function for an oracle shipped event, oracle.apps.eng.cm.changeObject.submit. The event fires fine, i can do my custom validations in this function. In case the validations fail, I need to return an error message.
    As per the guides and metalink documents, the way to do this is by returning 'ERROR' . But even though I return an ERROR, it does not error out. Whether I return SUCCESS or ERROR , the behaviour is the same.
    While creating the subscription function, for On Error , I selected, "Stop And Rollback ".
    Is it possible to return errors from the subscription functions.
    thanks
    Satya

    You shouldn't be passing ResultSet objects across the EJB layer.
    Instead you should be passing data back and forth.
    All of the data access code should be in one place in one class.
    That class should open the connection, run the query, process/store the results of the query and then close the connection.
    In this case you probably want to return a list of something to your jsp.
    So your EJB call should be more like
    public List<resultBean> check(String id){
      ResultSet rs = Statement.("select * from table1 where id=123");
      List resultList = new ArrayList();
      while (rs.next()){
        Bean myBean = new Bean();
        myBean.setProperty1(rs.getString("field1"));
        myBean.setProperty2(rs.getString("field2"));
        resultList.add(myBean);
      return resultList;
    }

  • Error in consuming webservices using ABAP

    Dear Gurus,
    I am trying to consume webservices using ABAP. We dont have XI installed and no java instance installed.
    I created a customer proxy through SE80 and generated a proxy class by giving a WSDL link and also defined logical port. Traditionally followed the steps. But while testing webservices , I get a ICF error.
    The error is as follows:
    SOAP : 1:023 SRT : Processing error in internet communication framework ("ICF error when recieving the response  ICM_HTTP_CONNECTION_FAILED)
    Please let me know the cause of this error and solution to be provided.
    I also tried to call the method from an abap program, But I get CX_AI_SYSTEM_FAULT exception.
    Awaiting your replies.
    Thanks in advance for your support and valuable time.
    Thanks
    Gurushanthi

    Hi Gurushanthi,
    It could one of several problems, examples:
    - A firewall setting
    - http communication out disabled by Basis team or
    - The logical port wasn't configured correctly.
    Try the suggestions in this thread to narrow down the reason (particularly the telnet test from the server):
    [Re: Error testing external web service ICM_HTTP_CONNECTION_FAILED;
    Regards, Trevor

  • How to get an object of choice from XML data using XMLBean?

    I have xml schema and I have generated a jar to represent my schema using XMLBean. I also have few xml data files, these are valid xml for generated schema. Now I want to write a utility which takes xml file as input and returns an object of my choice (Assuming this Object type is available in the jar) as output and vice versa. Some thing like this –
    1. Object getObjectFromXML(File xmldatafile, Class classname)
    xmldatafile = presents the source of XML data
    classname = an object of this class type as output filled from the xml data.
    2. String getXMLStrFromObject(Object)
    Pass Object and get XML as String output
    Any pointer?
    Thanks,

    Hi! Maybe have a look at the documentation for XmlObject.Factory.parse(). It should allow you what you need to do.
    Cheers,
    G.

  • Hide an error from the application using a servererror trigger?

    We have an application designed for an old oracle version which issues some sql which is no more supported in todays database version.
    We want to use the application unchanged with a new database server.
    Old Server Version: 7.3.4 (still in production...)
    New Server Version: 10.2 or 11.2
    The application issues an
    ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS ;
    which results in ORA-01986 and the application dies.
    We would like to hide the error 01986 from the application using a trigger:
    create or replace
    trigger catch01986
      after servererror
      on schema
      begin
        if (ora_is_servererror (1986)) then
          null; -- what to do here? we want clear the ora-01986 from the error stack
        end if;
      end catch01986;How to handle the error, so that the alter session set ... statement is just ignored and no error code is returned to the application?
    I asked already some days ago in Database-General Forum, but triggers belong to PL/SQL, so i repost here.
    Tnx for help in advance!

    Hi,
    hoek wrote:
    A totally weird and untested (and unable to test today) thought:
    http://technology.amis.nl/blog/447/how-to-drive-your-colleagues-nuts-dbms_advanced_rewrite-oracle-10g
    Very interesting for real dirty solution.
    Does not work for my problem, DBMS_ADVANCED_REWRITE works only for select statements.
    BEGIN
       SYS.DBMS_ADVANCED_REWRITE.DECLARE_REWRITE_EQUIVALENCE (
       'alter_session_equivalence',
       'ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS',
       'ALTER SESSION SET OPTIMIZER_MODE = RULE',
       FALSE);
    END;
    ORA-30389: the source statement is not compatible with the destination statement
    ORA-00903: invalid table name
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
    ORA-06512: at line 2
    30389. 00000 -  "the source statement is not compatible with the destination statement"
    *Cause:    The SELECT clause of the source statement is not compatible with
               the SELECT clause of the destination statement
    *Action:   Verify both SELECT clauses are compatible with each other such as
               numbers of SELECT list items are the same and the datatype for
               each SELECT list item is compatible
    hoek wrote:You already had some trigger code, catching the error and sending it to null, why didn't that work?The trigger is fired when the error occurs, but after completion of the trigger, the error code is still delivered to the client.
    I dont know how to handle the error within the trigger.
    Does the client read the error stack and does it die after reading an error from the stack?The client just checks the error code. On error it terminates.
    With the SERVERERROR TRIGGER i did the following tests:
    Test 1: trigger does nothing
    CREATE OR REPLACE
    TRIGGER CATCH01986
      AFTER SERVERERROR
      ON SCHEMA
      BEGIN
        IF (ORA_IS_SERVERERROR (1986)) THEN
          NULL;
        END IF;
      END CATCH01986;
    ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS;
    ORA-01986: OPTIMIZER_GOAL is obsolete
    01986. 00000 -  "OPTIMIZER_GOAL is obsolete"
    *Cause:    An obsolete parameter, OPTIMIZER_GOAL, was referenced.
    *Action:   Use the OPTIMIZER_MODE parameter.
    -- Client Application reports errorcode 1986Test 2: Trigger raises NO_DATA_FOUND
    CREATE OR REPLACE
    TRIGGER CATCH01986
      AFTER SERVERERROR
      ON SCHEMA
      BEGIN
        IF (ORA_IS_SERVERERROR (1986)) THEN
          RAISE NO_DATA_FOUND;
        END IF;
      END CATCH01986;
    ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS;
    ORA-04088: error during execution of trigger 'AH.CATCH01986'
    ORA-01403: no data found
    ORA-06512: at line 9
    ORA-01986: OPTIMIZER_GOAL is obsolete
    04088. 00000 -  "error during execution of trigger '%s.%s'"
    *Cause:    A runtime error occurred during execution of a trigger.
    *Action:   Check the triggers which were involved in the operation.
    -- Client Application reports errorcode 4088Test 3: Trigger raising an APPLICATION ERROR
    CREATE OR REPLACE
    TRIGGER CATCH01986
      AFTER SERVERERROR
      ON SCHEMA
      BEGIN
        IF (ORA_IS_SERVERERROR (1986)) THEN
            DBMS_STANDARD.RAISE_APPLICATION_ERROR(-20999, 'this makes no sense', true);
        END IF;
      END CATCH01986;
    ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS;
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20999: this makes no sense
    ORA-06512: at line 10
    ORA-01986: OPTIMIZER_GOAL is obsolete
    00604. 00000 -  "error occurred at recursive SQL level %s"
    *Cause:    An error occurred while processing a recursive SQL statement
               (a statement applying to internal dictionary tables).
    *Action:   If the situation described in the next error on the stack
               can be corrected, do so; otherwise contact Oracle Support.
    -- Client Application reports errorcode 604Test 4: Adding an EXCEPTION part to the trigger does not help, this will catch only exceptions raised while the trigger executes:
    CREATE OR REPLACE
    TRIGGER CATCH01986
      AFTER SERVERERROR
      ON SCHEMA
      BEGIN
        IF (ORA_IS_SERVERERROR (1986)) THEN
            DBMS_STANDARD.RAISE_APPLICATION_ERROR(-20999, 'this makes no sense', true);
        END IF;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END CATCH01986;
    ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS;
    ORA-01986: OPTIMIZER_GOAL is obsolete
    01986. 00000 -  "OPTIMIZER_GOAL is obsolete"
    *Cause:    An obsolete parameter, OPTIMIZER_GOAL, was referenced.
    *Action:   Use the OPTIMIZER_MODE parameter.
    -- Client Application reports errorcode 1986So i do not know what to do inside the trigger to clean the error stack so that the client will receive no errorcode.

  • Error while generating webservices using Date

    I am facing the following problem while generating a web service which is having Date as one its members.
    I have serialized a class with the following DataStructure
    private String rowId1;
    private Date created;
    private String name;
    private String quoteNum;
    private String revNum;
    private String curcyCd;
    private String activeFlg;
    private Number discntAmt;
    private Number discntPercent;
    When i tried to expose this as webservice, If I use the class oracle.jbo.domain.Date for Date type, the webservice is not generated properly. It is not including the method which contains this call. ie) This method is not present in the WSDL file as well as in the proxy.
    When I used java.util.Date instead of oracle.jbo.domain.Date, I am able to expose the method and webservice got generated properly. But When i tried to generate the proxy for the WSDL in the consumer, I go the following error.
    oracle.jdeveloper.webservices.model.GenerationException: Proxy generation failed for the following reason:
         at oracle.jdeveloper.webservices.model.proxy.ProxyGenerator.doGeneration(ProxyGenerator.java:608)
         at oracle.jdeveloper.webservices.model.proxy.ProxyGenerator.generateImpl(ProxyGenerator.java:365)
         at oracle.jdeveloper.webservices.model.proxy.ProxyGenerator.mav$generateImpl(ProxyGenerator.java:77)
         at oracle.jdeveloper.webservices.model.proxy.ProxyGenerator$1ThrowingRunnable.run(ProxyGenerator.java:206)
         at oracle.jdeveloper.webservices.model.GeneratorUI$GeneratorAction.run(GeneratorUI.java:446)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.RuntimeException: generator error: no encoder for type "{http://www.w3.org/2001/XMLSchema}dateTime" and Java type "java.lang.String"
         at oracle.j2ee.ws.common.processor.Processor.runActions(Processor.java:105)
         at oracle.j2ee.ws.tools.wsa.AssemblerTool.run(AssemblerTool.java:99)
         at oracle.j2ee.ws.tools.wsa.WsdlToJavaTool.createProxy(WsdlToJavaTool.java:354)
         at oracle.j2ee.ws.tools.wsa.Util.createProxy(Util.java:838)
         at oracle.jdeveloper.webservices.model.proxy.ProxyGenerator.doGeneration(ProxyGenerator.java:549)
         ... 6 more
    Caused by: generator error: no encoder for type "{http://www.w3.org/2001/XMLSchema}dateTime" and Java type "java.lang.String"
         at oracle.j2ee.ws.common.processor.generator.GeneratorBase.doGeneration(GeneratorBase.java:181)
         at oracle.j2ee.ws.common.processor.generator.GeneratorBase.perform(GeneratorBase.java:137)
         at oracle.j2ee.ws.common.processor.Processor.runActions(Processor.java:97)
         ... 10 more
    I am referring to "Entity and view objects based on web service " in the following URL
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#93
    Thanks and Regards,
    James

    Hi all,
    I have applied the consolidated JRI fixes - patch 17191279 .
    Then, when generating Jar, received keypass is tampered error.
    re-generated the key using $ adjkey -initialize.
    Now, its working fine.
    Regards,
    Krish.

  • Error while testing webservice using SOAP

    Hi,
    While i was testing my published webservice using soap-ui it gave me following error,
    <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>
    <soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>Internal SOAP Processing Failure</faultstring>
    <detail/>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    and in the event log i can see a event as follows and there is no warning or error
    Upon investigation i got to know the following steps might solve the problem..i.e..
    - Is the receive location for the SOAP webservice enabled? - YES
    - Can you browse to (the WSDL of) the webservice? Is displayed correctly? -YES
    - Is the webservice configured to run in the correct application pool? -YES
    -The user under which application pool is running have the read/write permission on the %temp% folder.-Dont Know how to check
    -In IIS,Check the identity of the application pool on which Web service is running and make sure that the user is the member of both “IIS_WPG” and “BizTalk Isolated host users”.
    -DONT Know how to check
    Please Help me in guiding me in the last two points
    and if there are any other solutions for this..
    Thanks,
    Sarva.

    You mentioned you checked that the webservice is configured under correct application pool. you can find the user under which the application pool is configured (open iis- > select application pools -> find out the "Identity column" to
    know the user for your application pool.
    -The user under which application pool is running have the read/write permission on the %temp% folder.-Dont Know how to check
    Go to run -> type "%temp%" -> Go one step back -> Right click to the folder -> Properties -> Security -> check the application pool user is present under "Group or user names"
    -In IIS,Check the identity of the application pool on which Web service is running and make sure that the user is the member of both “IIS_WPG” and “BizTalk Isolated host users”.
    -DONT Know how to check
    Refer How to Add Service Account to the IIS_WPG Group to add your application pool user under IIS_WPG. Also similar activity to add your service account to "BizTalk Isolated
    host users" if it is local groups. Or Ask your network support team if "BizTalk Isolated host users" is domain group.
    Please Help me in guiding me in the last two points
    and if there are any other solutions for this..
    Thanks,
    Sarva.
    Your event viewer might have more information pointing exactly what is causing "Internal SOAP processing failure". 
    Also refer this
    which might be helpful for you.
    If this answers your question please mark it as Answer and if this post is helpful, please vote as helpful. Thanks !

  • WLS 9: WebServices using XMLBeans

    I'm attempting to implement a web service on WLS 9 (without workshop) that uses XMLbean types as parameters.
    The docs for jwsc hint that XMLBeans are given special treatment when used as web service arguments, but I have had no luck creating a functional web service this way.
    Does anyone have a functional example for this, or any other tips on how the get started?

    I'm attempting to implement a web service on WLS 9 (without workshop) that uses XMLbean types as parameters.
    The docs for jwsc hint that XMLBeans are given special treatment when used as web service arguments, but I have had no luck creating a functional web service this way.
    Does anyone have a functional example for this, or any other tips on how the get started?

  • Error while invoking webservice using UTL_HTTP from PL/SQL Block

    Hi All,
    I am invoking a webservice (SOAP Request) from a PL/SQL block using UTL_HTTP package.
    I am able to send the complete request and am getting the required instance on the BPEL Console, but the process is erroring out while getting response back.
    and the PL/SQL Block is ending in error mentioned below:
    ERROR at line 1:
    ORA-29266: end-of-body reached
    ORA-06512: at "SYS.UTL_HTTP", line 1321
    ORA-06512: at "APPS.CSM_BPEL_TEST_PKG", line 34
    ORA-06512: at line 1
    Package is completing successfully if i test in local DB and local BPEL.
    But giving above error in client's.
    Can anyone let me know what is the cause of this.
    Thanks in advance

    I got it working by making process Synchronous.
    But with asynchronous process it is still same error.
    Thanks...

  • Error while accessing webservice using generated stub

    I want to consume a webservice which supplies information about countries:
    http://www.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL
    I have generated a Webservice stub using JDeveloper. It supplies me with the right interface, but when I use the stub to access the webservice, I encounter an error:
    java.lang.ClassCastException: oracle.xml.parser.v2.XMLText
         at oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub.fromElement(WrappedDocLiteralStub.java:614)
         at mypackage3.CountryInfoServiceStub2.CapitalCity(CountryInfoServiceStub2.java:72)
         at mypackage3.callWS.main(callWS.java:19)
    I have checked the response message, but it is all right. With "some" handcoding , I can extract the answer I want out of the response XML. It seems, that the stub fails to cast the response to the right result class.
    The method I use from the stub generated by JDeveloper. The error occurs at the last line, where the content of the message should be cast to String :
    =========================================================
    public String CapitalCity(String sCountryISOCode) throws Exception
    URL endpointURL = new URL(_endpoint);
    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();
    String wrappingName = "CapitalCity";
    String targetNamespace = "http://www.oorsprong.org/websamples.countryinfo";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"sCountryISOCode", sCountryISOCode});
    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);
    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "", requestEnv);
    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();
    return (String)fromElement((Element)responseData.elementAt(0), java.lang.String.class);
    =========================================================
    The class I use to call the webservice:
    =========================================================
    package mypackage3;
    public class callWS
    public callWS() {  }
    public static void main(String[] args)
    {  System.out.println("Calling CountryInfo Webservice");
    try
    CountryInfoServiceStub2 ws1 = new CountryInfoServiceStub2();
    String capitalCity = ws1.CapitalCity("IT");
    System.out.println("Capital City=" + capitalCity);
    } catch (Exception exception)
    {   System.out.println("An error occured while calling CountryInfoStub2:" );
    exception.printStackTrace(System.out);
    =========================================================

    Hi dickdral
    I', afraid I have not solution but the same problem. Today I try use VIES (http://ec.europa.eu/taxation_customs/vies/api/checkVatPort)
    and the same exception occurs. Stub was generated by JDev 10.1.2.
    Do you resolve this problem?
    Thanks
    Jara

  • Error while invoking webservice using UTL_HTTP package

    Hi All,
    I am invoking a webservice (SOAP Request) from a PL/SQL block using UTL_HTTP package.
    I am able to send the complete request and am getting the required instance on the BPEL Console, but the process is errorring out while getting response back.
    and the PL/SQL Block is ending in error mentioned below:
    ERROR at line 1:
    ORA-29266: end-of-body reached
    ORA-06512: at "SYS.UTL_HTTP", line 1321
    ORA-06512: at "APPS.CSM_BPEL_TEST_PKG", line 34
    ORA-06512: at line 1
    Can anyone let me know what is the cause of this.
    Thanks in advance

    My guess would be that your request is not properly constructed,
    29266, 00000, "end-of-body reached"
    // *Cause:  The end of the HTTP response body was reached.
    // *Action: If the end of the HTTP response is reached prematurely, check if
    //          the HTTP response terminates prematurely.  Otherwise, end the
    //          HTTP response.John

  • Error from BPE Adapter using in Async Sync scenario

    Hi,
    I'm trying to use a Asyn Sync pattern with BPM:
    1)File adapter get a file from AS400, split it several XML messages and send to XI(Async)
    2)XI get each message and forward to BPM using XI adapter
    3)BPM has to send the message to R/3 via BAPI (Sync)
    4)R/3 reply the result message to BPM(Sync)
    5)BPM has to send the result message to e-mail system if an error had occurred in BAPI call (Async)
    When I send directly from File adapter to R/3 works like a charm, but when I want use the BPM, a soap header error says to me, that cannot identify a data type that I’m using in the message sent by File adapter.
    The error that I'm getting is BPE Adapter UNKNOWN_MESSAGE in soap header.
    Regards,
    Eduardo

    I got the same problem after installing new patches.
    This is what I had to do:
    Go to SXI_CACHE
    - Choose Business Processes
    - select your Buisness Process
    If your buisness process has Return Code 99
    - Click "Repeate Activate" button
    - On the next screen, click Activate again.
    This worked for me. Good Luck!

  • Errors from WAD when using template

    <u>Question 1</u>
    How can the following errors be fixed or removed from WAD when the template 0ANALYSIS_TEMPLATE is retrieved. All objects have been activated:
    E260    Template Include Item HEADER_TEMPLATE unresolved or empty. Close and reopen template.
    E260    Template Include Item FOOTER_TEMPLATE unresolved or empty. Close and reopen template.
    W155    Width of Object item:CONTAINER_LAYOUT_ITEM:CONTAINER_LAYOUT_CONTENT is very small (1)
    <u>Question 2</u>
    According to OSS note 1048857:
    <i>Import Support Package 14 for SAP NetWeaver 7.0 BI (BI Patch 14 or SAPKW70014) into your BI system</i>
    Is is this referring to using SNOTE for this particular problem? SP 14 has not yet been released.
    What is it referring to?
    <u>Question 3</u>
    How do I get to the portal system and get to the PCD? Is there some sort of authorizations that should be set to get to the protal as the EP user Admin.
    null

    Please activate all BEx Web templates (BTMP) that begin with '0'. Please activate all Reusable Web items (BITM) which' begin 'with '0'. After this you should restart the J2EE Engine. This will solve your problems.
    Regarding the note - It means that the issue "Object 'BTMP:0ANALYSIS_PATTERN' refers to the invalid object 'QU:" can be ignored now. This error message will not come in SP14 (whenever its released).

  • What is the correct process to return errors from an Event Handler

    I have a pre-Create and pre-Modify Event Handlers. If the event handler detects an error, I want to throw an exception back to terminate the create user or modify user event. I also want to display a meaningful error message on the OIM UI. In my pre-modify event handler I am throwing the following exception when an error is detected:
    throw new EventFailedException(processId, null, "User ID not available", "", "MODIFY", null);
    However, the OIM UI is not displaying the message "User ID not available" as I want it to. Instead it is displaying the following error message:
    An error occurred. The corresponding error code is IAM-0080062
    Does anyone know where that error code is coming from? My event handler is not doing that. Also, does anyone know where I can find any documentation on the proper use of the EventFailedException? What do the parameters mean? How do I get a meaningful error message to display on the OIM UI?
    Thank you for any help here.
    -Dave

    Please try to cancel the PO 1st and then Cancel Sales order...
    Refer following note id
    How to Cancel a Drop Ship Order Line (Doc ID 393688.1)
    Thanks

Maybe you are looking for