Defining complex types in ABAP

Hi Folks,
I am new to the ABAP world and has started programming in it for about two weeks now (therefore, two weeks of experience so far ). I have a question regarding definition of complex types in ABAP. Basically what I want to achieve is to define a type which is either mytype1 or mytype2. During the runtime, it should be decided whether complextype is of mytype1 or of mytype2. Maybe to put some more concrete context: I will call a method with an object of type "complextype". Depending how I set this object, this will be of mytype1 or mytype2. Please see the code schema below.
TYPES BEGIN OF mytype1.
    TYPES:
    TYPES END OF mytype1.
TYPES BEGIN OF mytype2.
    TYPES:
    TYPES END OF mytype2.
TYPES BEGIN OF complextype.
    TYPES:
          mytype_name TYPE mytype1,
          mytype_name TYPE mytype2.
    TYPES END OF complextype.
Is this a correct way to approach? If yes, how can I express this (either mytype1 or mytype2 but only one of them at a certain time) in ABAP types correctly?
I will appreciate any kind of help.
Thanks a million,
Boldbaatar
Edited by: Boldbaatar Tsend-Ayush on Apr 6, 2011 8:24 PM

Hi,
I think you should use the dynamic data reference .
TYPES BEGIN OF mytype1.
    TYPES:
    TYPES END OF mytype1.
TYPES BEGIN OF mytype2.
    TYPES:
    TYPES END OF mytype2.
data: dref_complex type ref to data.
field-sumbols:<fs_any> type any.
if type eq mytype1.
l_type = 'MY_TYPE1'.
elseif type eq mytype2.
l_type = 'MY_TYPE2'.
endif.
create data dref_complex type (l_type).
"In order to access the components of  dref_complex , you should assign the same to field symbol
assing dref->*  to <fs_any>.
"then u can use  ASSIGN COMPONENT to get individual components
Regards
Arshad

Similar Messages

  • Define complex types

    Hi,
    I'm trying to define a new complex type in my .wsdl file of my bpel process project.
    I want one of the elements in this complex type to be of the same type as an element defined in one of my partner link's WSDL.
    How can I make this connection (what do I define as namespaces) from my .wsdl file to a partner link's wsdl file.
    Thank you!!!

    Thanks Clemens!
    I will try the first option.
    This is my wsdl b - the wsdl I want to import types from :
    <definitions
    targetNamespace="http://Images/WebService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:s0="http://Images/WebService"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >
    <import namespace="http://Images/WebService" location="webServiceFlickr.wsdl"/>
    <plnk:partnerLinkType name="webServiceFlickrHttpGet_PL">
    <plnk:role name="webServiceFlickrHttpGet_Role">
    <plnk:portType name="s0:webServiceFlickrHttpGet"/>
    </plnk:role>
    </plnk:partnerLinkType>
    <plnk:partnerLinkType name="webServiceFlickrSoap_PL">
    <plnk:role name="webServiceFlickrSoap_Role">
    <plnk:portType name="s0:webServiceFlickrSoap"/>
    </plnk:role>
    </plnk:partnerLinkType>
    <plnk:partnerLinkType name="webServiceFlickrHttpPost_PL">
    <plnk:role name="webServiceFlickrHttpPost_Role">
    <plnk:portType name="s0:webServiceFlickrHttpPost"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>
    and this is the beginning of wsdl a - the one I want to import the type into :
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="process10"
    targetNamespace="http://xmlns.oracle.com/process10"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:client="http://xmlns.oracle.com/process10"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
         <types>
              <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/process10"
                   xmlns="http://www.w3.org/2001/XMLSchema">
    I undestand I need to import the namespace of wsdl b , but can't figure out how,
    What do I define instead of XXX ?
    xmlns:n1="XXX">
    <import namespace="XXX" schemaLocation="XXX"/>
    Thank you !!

  • How to define complex type with table per record?

    Hi,
    for one of my tasks I'm dealing with XML export. After short investigation of the postings in the forum I found an acceptable solution:
    Re: Convert ABAP to XML and Vice versa
    The issue is that I need an XML file like this:
    <plant>
      <material>
        <purchases>data</purchases>
        <purchases>data</purchases>
        <purchases>data</purchases>
        <sales>data</sales>
        <sales>data</sales>
        <sales>data</sales>
      </material>
      <next material>
      </next material>
    </plant>
    So here are the questions:
    1. Is it possible (and how) to define such deep structured type where for each record (means material) there is at least 1 internal table connected to that record? That would let me use a record-2-DOM conversion and a standard DOM-2-XML renderer.
    2. Could anyone please provide a very simple and short example?
    Of course, I could write my own XML renderer and achieve what I need (without using DOM, simply write to file all the desired XML tags while looping at my *nested* tables), but if there is a way to define such a structured type and further to fill it with data, it would help me learn a little bit more about abap opportunities and would save me a bit more time to create a renderer.
    Many thanks in advance.
    Regards,
    Ivaylo Mutafchiev

    Hi,
    You can declare deep structure as below
    TYPES : BEGIN OF ty_address,
              house(10) TYPE c,
              street(10) TYPE c,
            END OF ty_address.
    TYPES : BEGIN OF ty_itab,
             name(10) TYPE c,
             age      TYPE i,
             address  TYPE ty_address OCCURS 0,
            END OF ty_itab.
    DATA : i_address TYPE STANDARD TABLE OF ty_address,
           i_itab    TYPE STANDARD TABLE OF ty_itab.
    DATA : wa_address TYPE  ty_address,
           wa_itab TYPE  ty_itab.
    CLEAR :  wa_address,
             wa_itab.
    wa_address-house = 'House1'.
    wa_address-street = 'Street1'.
    APPEND wa_address TO i_address.
    wa_address-house = 'House2'.
    wa_address-street = 'Street2'.
    APPEND wa_address TO i_address.
    wa_itab-name = 'Test'.
    wa_itab-age  = 10.
    wa_itab-address[] = i_address[].
    APPEND wa_itab TO i_itab.
    Also check structure BSPL_GRID_FIELDCAT field CELL_COLOR

  • Problem building schema in JDeveloper with  user defined complex type.

    Hi,
    I am facing proble in JDeveloper while assigning input.
    1. Used Oracle BPEL Database Adaper to access the procedure in Oracle DB which accepts input in the form of record typ in database.
    2. XSD file is automatically created.
    3. BPEL process WSDL's, input and output parameter elements are modified as
    per the auto generated XSD file.
    4. Trying to assign the input from BPEL console to the input variable of
    procedure.
    5. Getting error message "Invalid reference:
    xmlns="http://www.w3.org/2001/XMLSchema:XX_QTE_LINE_REC_TYPE" in the Oracle
    BPEL designer when, drilled down at input variable.
    Generated code:
    1. XX_RAC_CREATE_QUOTE_1.XSD --> generated by Oracle BPEL below:
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/BOLINF/XX_RAC_CREATE_QUOTE_1/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/BOLINF/XX_RAC_CREATE_QUOTE_1/">
    <element name="InputParameters">
    <complexType>
    <sequence>
    <element name="P_QTE_HEADER_REC" type="db:XX_RAC_QTE_HEADER_REC_TYPE" db:index="1" db:type="Struct" minOccurs="0" nillable="true"/>
    <element name="P_QTE_LINE_REC" type="db:XX_QTE_LINE_REC_TYPE" db:index="2" db:type="Struct" minOccurs="0" nillable="true"/>
    <element name="P_CIELING_LIMIT" type="decimal" db:index="3" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="P_EXCESS" type="decimal" db:index="4" db:type="NUMBER" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="X_QUOTE_NUMBER" type="string" db:index="5" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="X_RETURN_STATUS" type="string" db:index="6" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="XX_QTE_LINE_REC_TYPE">
    <sequence>
    <element name="QUOTE_HEADER_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="QUOTE_LINE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="INVENTORY_ORG_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="INVENTORY_ITEM_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="PRICE_LIST" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="BILL_TO_ACCOUNT" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="BILL_TO_SITE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="SHIP_TO_ACCOUNT" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="SHIP_TO_SITE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="QUANTITY" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="ORGANIZATION_ID" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="20"/>
    </restriction>
    </simpleType>
    </element>
    <element name="LINE_CATERORY_CODE" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="100"/>
    </restriction>
    </simpleType>
    </element>
    <element name="OPERATION_CODE" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="20"/>
    </restriction>
    </simpleType>
    </element>
    <element name="CREATED_BY" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="100"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    <complexType name="XX_RAC_QTE_HEADER_REC_TYPE">
    <sequence>
    <element name="SR_NUMBER" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="100"/>
    </restriction>
    </simpleType>
    </element>
    <element name="VRN" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="INS_ACCT_NBR" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="INS_ACCT_SITE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="CUST_ACCT_NBR" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="CUST_SITE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="CREATED_BY" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    <element name="ORGANIZATION_ID" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="50"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    </schema>
    2. Update QuoteCreationTest.wsdl as per the above generated XSD file below:
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="QuoteCreationTest"
    targetNamespace="http://xmlns.oracle.com/QuoteCreationTest"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:client="http://xmlns.oracle.com/QuoteCreationTest"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         TYPE DEFINITION - List of services participating in this BPEL process
         The default output of the BPEL designer uses strings as input and
         output to the BPEL Process. But you can define or import any XML
         Schema type and us them as part of the message types.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <types>
              <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/QuoteCreationTest"
                   xmlns="http://www.w3.org/2001/XMLSchema">
                   <element name="QuoteCreationTestProcessRequest">
                        <complexType>
                             <sequence>
    <element name="P_QTE_HEADER_REC" type="XX_RAC_QTE_HEADER_REC_TYPE" minOccurs="0" nillable="true"/>
    <element name="P_QTE_LINE_REC" type="XX_QTE_LINE_REC_TYPE" minOccurs="0" nillable="true"/>
    <element name="P_CIELING_LIMIT" type="decimal" minOccurs="0" nillable="true"/>
    <element name="P_EXCESS" type="decimal" minOccurs="0" nillable="true"/>
                             </sequence>
                        </complexType>
                   </element>
                   <element name="QuoteCreationTestProcessResponse">
                        <complexType>
                             <sequence>
    <element name="X_QUOTE_NUMBER" type="string" minOccurs="0" nillable="true"/>
    <element name="X_RETURN_STATUS" type="string" minOccurs="0" nillable="true"/>
                             </sequence>
                        </complexType>
                   </element>
    <complexType name="XX_QTE_LINE_REC_TYPE">
    <sequence>
    <element name="QUOTE_HEADER_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="QUOTE_LINE_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="INVENTORY_ORG_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="INVENTORY_ITEM_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="PRICE_LIST" type="string" minOccurs="0" nillable="true" />
    <element name="BILL_TO_ACCOUNT" type="string" minOccurs="0" nillable="true"/>
    <element name="BILL_TO_SITE_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="SHIP_TO_ACCOUNT" type="string" minOccurs="0" nillable="true"/>
    <element name="SHIP_TO_SITE_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="QUANTITY" type="decimal" minOccurs="0" nillable="true"/>
    <element name="ORGANIZATION_ID" type="string" minOccurs="0" nillable="true"/>
    <element name="LINE_CATERORY_CODE" type="string" minOccurs="0" nillable="true"/>
    <element name="OPERATION_CODE" type="string" minOccurs="0" nillable="true"/>
    <element name="CREATED_BY" type="string" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="XX_RAC_QTE_HEADER_REC_TYPE">
    <sequence>
    <element name="SR_NUMBER" type="string" minOccurs="0" nillable="true"/>
    <element name="VRN" type="string" minOccurs="0" nillable="true"/>
    <element name="INS_ACCT_NBR" type="string" minOccurs="0" nillable="true"/>
    <element name="INS_ACCT_SITE_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="CUST_ACCT_NBR" type="string" minOccurs="0" nillable="true"/>
    <element name="CUST_SITE_ID" type="decimal" minOccurs="0" nillable="true"/>
    <element name="CREATED_BY" type="string" minOccurs="0" nillable="true"/>
    <element name="ORGANIZATION_ID" type="string" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </schema>
         </types>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         MESSAGE TYPE DEFINITION - Definition of the message types used as
         part of the port type defintions
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <message name="QuoteCreationTestRequestMessage">
              <part name="payload" element="client:QuoteCreationTestProcessRequest"/>
         </message>
         <message name="QuoteCreationTestResponseMessage">
              <part name="payload" element="client:QuoteCreationTestProcessResponse"/>
         </message>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PORT TYPE DEFINITION - A port type groups a set of operations into
         a logical service unit.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <!-- portType implemented by the QuoteCreationTest BPEL process -->
         <portType name="QuoteCreationTest">
              <operation name="process">
                   <input message="client:QuoteCreationTestRequestMessage" />
                   <output message="client:QuoteCreationTestResponseMessage"/>
              </operation>
         </portType>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PARTNER LINK TYPE DEFINITION
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <plnk:partnerLinkType name="QuoteCreationTest">
              <plnk:role name="QuoteCreationTestProvider">
                   <plnk:portType name="client:QuoteCreationTest"/>
              </plnk:role>
         </plnk:partnerLinkType>
    </definitions>
    3. Error message when accessing assign from JDeveloper below:
    Invalid reference:
    xmlns='http://www.w3.org/2001/XMLSchema:XX_QTE_LINE_REC_TYPE'
    Can any one please, let me know the reason for the above error generated.
    Thanks and Regards
    Raj

    clemens,
    Now, i have problem with the input variable data type of my client and the input variable type of my receive activity.
    Currenty, my input variable of receive activity is same as the data type of my procedure input parameter, but my client input variable is still string.
    Please, find my client WSDL below:
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="QuoteCreation"
    targetNamespace="http://xmlns.oracle.com/QuoteCreation"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:client="http://xmlns.oracle.com/QuoteCreation"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         TYPE DEFINITION - List of services participating in this BPEL process
         The default output of the BPEL designer uses strings as input and
         output to the BPEL Process. But you can define or import any XML
         Schema type and us them as part of the message types.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <types>
              <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/QuoteCreation"
                   xmlns="http://www.w3.org/2001/XMLSchema">
                   <element name="QuoteCreationProcessRequest">
                        <complexType>
                             <sequence>
                                  <element name="input" type="string"/>
                             </sequence>
                        </complexType>
                   </element>
                   <element name="QuoteCreationProcessResponse">
                        <complexType>
                             <sequence>
                                  <element name="result" type="string"/>
                             </sequence>
                        </complexType>
                   </element>
              </schema>
         </types>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         MESSAGE TYPE DEFINITION - Definition of the message types used as
         part of the port type defintions
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <message name="QuoteCreationRequestMessage">
              <part name="payload" element="client:QuoteCreationProcessRequest"/>
         </message>
         <message name="QuoteCreationResponseMessage">
              <part name="payload" element="client:QuoteCreationProcessResponse"/>
         </message>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PORT TYPE DEFINITION - A port type groups a set of operations into
         a logical service unit.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <!-- portType implemented by the QuoteCreation BPEL process -->
         <portType name="QuoteCreation">
              <operation name="process">
                   <input message="client:QuoteCreationRequestMessage" />
                   <output message="client:QuoteCreationResponseMessage"/>
              </operation>
         </portType>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PARTNER LINK TYPE DEFINITION
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <plnk:partnerLinkType name="QuoteCreation">
              <plnk:role name="QuoteCreationProvider">
                   <plnk:portType name="client:QuoteCreation"/>
              </plnk:role>
         </plnk:partnerLinkType>
    </definitions>
    Cheers
    Raj

  • Complex Type as prameter

    I am exposing session beans as web services. My question is how can I use a
    user defined object as a parameter in the client.
    The scenario is like this.
    I invoke a method on an EJB through Webservice A and and it returns me an
    object of type let's say MYType
    On the client it will be packageA.generated.MYType (originally on server it
    is packageA.MYType)
    I want to call another EJB through Web Service B with MYType as parameter.
    But it expects the pramaeter type to be
    packageB.generated.MyType on the client
    Is there way Ican do this automatically rather than me doing a manul
    tranlation?
    I looked at faq on webservice.bea.com for "How do you use user-defined
    complex datatypes as parameters of the method?". It says the following:
    A) You need to register your "custom" data types with the typemapper. Your
    Main.java class should have some lines in it that look something like these:
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(
    SOAPConstants.URI_NS_SOAP_ENCODING );
    mapping.register( SOAPElement.class,
    new
    QName("http://localhost:7001/CVCProxy/CVCProxy/WSDL/eVisharad.BEMEE.Client.E
    EService.CVCProxy",
    "CVCRequestToken" ),
    new SOAPElementCodec(),
    new SOAPElementCodec()
    But is is not clear what to do after that (to map the retunred type to it's
    original server side type or another client type). Please help.
    Thanks,
    Vish

    Hi Vish,
    I'd say the easiest way to go about this, is to create a "ReuseableTypes" web
    service that contains "echo" operations for each reuseable complex type. For
    example:
    package com.acme.webservices.datatypes;
    public MyTypeOne echoMyTypeOn(MyTypeOne mto)
    return mto;
    public MyTypeTwo echoMyTypeTwo(MyTypeTwo mtt)
    return mtt;
    The "service implementation" can just be a POJO (plain old Java object). Then
    use the <servicegen><service> and <servicegen><client> Ant tasks to do all the
    "hard stuff" (i.e. generating type mappings, serializers, deserializers) for you.
    Make sure you make the targetNamespace equal to the Java package you want all
    the reuseable types to be in. It can start with "http://", but the next part should
    match the Java package name you want (i.e. com.acme.webservices, etc). Afterwards,
    you can just unzip the client jar that's created to see what the client-side type
    mapping needs to looks like. There will be a MyService.xml file in the client
    jar that contains this.
    Regards,
    Mike Wooten
    "Vish Magapu" <vm> wrote:
    Hi Michael,
    Thanks for your response. That is what I want to do: "reuse user-defined
    complex types across web services"
    I was hoping to use my EJB knowledge and use web services as a transport
    in
    place of RMI and wanted to avoid lerning about JAX-RPC. It seems I have
    to
    take a plunge. I will work on you pointer about defining XSD schema.
    Please
    let me know if you know resources about that.
    Vish
    "Michael Wooten" <[email protected]> wrote in message
    news:[email protected]...
    Hi Vish,
    If you want to reuse "user-defined" complex types across web services,you
    probably
    want to define then in a seperate XSD schema, and include this in theweb-services.xml.
    Thay way the WSDL will be generated using the same complex types forboth.
    I'm
    not sure if there is a way to do this without manually editing theweb-services.xml
    (the Web Service Deployment Descriptor).
    Knowing a little about how to code XML schema from scratch, is a goodand
    powerful
    thing :-)
    Regards,
    Mike Wooten
    "Vish Magapu" <vm> wrote:
    I am exposing session beans as web services. My question is how can
    I
    use a
    user defined object as a parameter in the client.
    The scenario is like this.
    I invoke a method on an EJB through Webservice A and and it returns
    me an
    object of type let's say MYType
    On the client it will be packageA.generated.MYType (originally onserver
    it
    is packageA.MYType)
    I want to call another EJB through Web Service B with MYType asparameter.
    But it expects the pramaeter type to be
    packageB.generated.MyType on the client
    Is there way Ican do this automatically rather than me doing a manul
    tranlation?
    I looked at faq on webservice.bea.com for "How do you use user-defined
    complex datatypes as parameters of the method?". It says the following:
    A) You need to register your "custom" data types with the typemapper.
    Your
    Main.java class should have some lines in it that look something like
    these:
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(
    SOAPConstants.URI_NS_SOAP_ENCODING );
    mapping.register( SOAPElement.class,
    new
    QName("http://localhost:7001/CVCProxy/CVCProxy/WSDL/eVisharad.BEMEE.Client.
    E
    EService.CVCProxy",
    "CVCRequestToken" ),
    new SOAPElementCodec(),
    new SOAPElementCodec()
    But is is not clear what to do after that (to map the retunred typeto
    it's
    original server side type or another client type). Please help.
    Thanks,
    Vish

  • Problem in calling a WS with complex type

    Hi all...
    I have to invoke a WS that has as input type a complex type defined in the wsdl...
    <complexType name="LoginInfo">
    - <sequence>
      <element name="appCode" nillable="true" type="string" />
      <element name="login" nillable="true" type="string" />
      <element name="passwd" nillable="true" type="string" />
      </sequence>
      </complexType>the soapui request looks like this:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://com.susan/SusanWS/types">
       <soapenv:Header/>
       <soapenv:Body>
          <typ:LoginWebService>
             <LoginInfo_1>
                <appCode>WEB_SERVICES</appCode>
                <login>root</login>
                <passwd>root</passwd>
             </LoginInfo_1>
          </typ:LoginWebService>
       </soapenv:Body>
    </soapenv:Envelope>in my java code I'm trying to call it with:
    Service service = new Service();
                Call call = (Call)service.createCall();
                call.setTargetEndpointAddress( new URL( wsEndpoint ) );
    //            call.setOperationName( wsMethod );
                call.setOperationName( new QName("http://com.susan/SusanWS/types",wsMethod));
                call.addParameter( "LoginInfo_1", Constants.XSD_ANYTYPE, ParameterMode.IN );
    //            call.addParameter( "appCode", Constants.XSD_STRING, ParameterMode.IN );
    //            call.addParameter( "login", Constants.XSD_STRING, ParameterMode.IN );
    //            call.addParameter( "passwd", Constants.XSD_STRING, ParameterMode.IN );
                String[] params={appCode, login, passwd};
    //            call.setReturnType( Constants.XSD_INT );
    //            Object retval = call.invoke( new String[] {appCode, login, passwd} );
                Object retval = call.invoke( new Object[] { params } );doing so..it doesn't work...the first problem I can see...is that I don't assign a parameter name to the 3 strings I pass in the param array...
    anybody has a tip to give me on how to solve this problem?

    solved...
    I imported the wsdl into Intellij idea...which created all the needed classes, interfaces,...and used service locator and endpoint binding stubs...

  • Cannot assign value to a Variable of Complex Type beyond index 1

    Hello:
    I have a variable defined as a complex type as followed. I tried to assign a value to each of the two elements but it only allows me to assign to the 'element#1.
    This statement that tries to assign a value into element#2 will not work, if I assign with '[1]' for the first element it will work:
    <copy> <---- THIS WORKS
    <from expression="'John'"/>
    <to variable="My_Variable"
    part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item[1]/ns9:pname"/>
    </copy>
    <copy> <---- THIS DOES NOT WORK
    <from expression="'John'"/>
    <to variable="My_Variable"
    part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item[2]/ns9:pname"/>
    </copy>
    Is there something wrong with my definition below that allows only element#1 to be refererenced but not element#2???? Am I missing some kind of initialization that is needed to initialize both elements????
    Here are my message and Complex Type definitions:
    <variable name="My_Variable" messageType="ns8:args_out_msg"/>
    <message name="args_out_msg">
    <part name="My_Collection" element="db:My_Collection"/>
    </message>
    <element name="My_Collection">
    <complexType>
    <sequence>
    <element name="Collection" type="db:Collection_Type" db:index="2" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="Ret" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="Collection_Type">
    <sequence>
    <element name="Collection_Item" type="db:Collection_Type_Struct" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="Collection_Type_Struct">
    <sequence>
    <element name="pname" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="25"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    The error msg it gives me is as followed:
    [2010/09/04 00:47:59] Error in <assign> expression: <to> value is empty at line "254". The XPath expression : "" returns zero node, when applied to document shown below:less
    oracle.xml.parser.v2.XMLElement@1fa7874
    [2010/09/04 00:47:59] "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.less
    -<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    -<part name="summary">
    <summary>
    XPath query string returns zero node.
    According to BPEL4WS spec 1.1 section 14.3, The assign activity &lt;to&gt; part query should not return zero node.
    Please check the BPEL source at line number "254" and verify the &lt;to&gt; part xpath query.
    </summary>
    </part>
    </selectionFailure>
    Thanks
    Newbie

    Hello:
    Base on the suggestion to use 'append' instead of 'copy', I tried to define a 'singleNode' which is of type 'Collection_Type_Struct' so I can append this individual 'struct' into my array (i.e. as the 2nd. element of my array "/ns9:My_Collection/ns9:Collection/ns9:Collection_Item"), but I am getting an error in defining this variable as:
    <variable name="singleNode" element="Collection_Type_Struct"/> <--- error
    Can someone tell me how should I define "singleNode" so I can put a value in it and then append this 'singleNode' into the array:
    <variable name="singleNode" element=" how to define this????"/>
    <assign>
    <copy>
    <frem expression="'Element2Value'"/>
    <to variable="singleNode"
    part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item/ns9:pname"/>
    </copy>
    </assign>
    <bpelx:assign>
    <bpelx:append>
    <from variable="singleNode" query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item"/>
    <to variable="My_Variable"
    "part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection"/>
    </bpelx:append>
    </bpelx:assign>
    Again here is my definition in my .xsd file:
    <element name="My_Collection">
    <complexType>
    <sequence>
    <element name="Collection" type="db:Collection_Type" db:index="2" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="Ret" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="Collection_Type">
    <sequence>
    <element name="Collection_Item" type="db:Collection_Type_Struct" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="Collection_Type_Struct">
    <sequence>
    <element name="pname" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="25"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    Thanks for any help!!!!

  • Human tasks, complex types and variable assignment.

    Hi folks,
    I encountered a problem while working with 10.1.3.1 which I haven't managed to solve yet and would be grateful for assistance. I have defined a complex data type (just a sequence of strings) and want to fill that data type by going through a flow of screens, e.g. through several human tasks. I have defined that type as a variable to the BPEL process and have managed to assign simple expressions to the variable and pass that into a Human Task. In the task I see now a simple input form for all attributes of the type.
    Now the problem. After I fill out the form and complete the human task, I have
    The global variable:
    <outputVariable>
         <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
              <MyProcessResponse xmlns="http://xmlns.oracle.com/VacationRequest">
                   <vorname/>
                   <nachname/>
                   <strasse/>
                   <nummer/>
                   <postleitzahl/>
                   <stadt/>
                   <maximaleDauer/>
                   <minimaleDauer/>
              </MyProcessResponse>
         </part>
    </outputVariable>
    and the return value from the human task:
    <task>
         <title>CaptureData</title>-
              <payload>
                   <MyProcessResponse>
                        <vorname>David</vorname>
                        <nachname>Beckham</nachname>
                        <strasse>HighStreet</strasse>
                        <nummer/>
                        <postleitzahl/>
                        <stadt/>
                        <maximaleDauer/>
                        <minimaleDauer/>
                   </MyProcessResponse>
              </payload>
    </task>
    Now the only thing I would like to do is to replace the original values in the variable with the new values that have been returned from the task, this should be performed in an extra assign step. Sounds simple. JDeveloper wouldn't even let me klick through the return value from the HumanTask, so it seems as if I have to do things manually.
    These are my tries:
    Command 1:
    <copy>
         <from variable="CaptureData_1_globalVariable"
    part="payload" query="/task:task/task:payload" />
    <to variable="outputVariable" part="payload"
    query="/ns1:MyProcessResponse"/>
    </copy>
    Result 1:
    <outputVariable>
         <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
              <ns0:MyProcessResponse xmlns="http://xmlns.oracle.com/bpel/workflow/task"     xmlns:ns0="http://xmlns.oracle.com/VacationRequest">
                   <MyProcessResponse xmlns="http://xmlns.oracle.com/VacationRequest">
                        <vorname>David</vorname>
                        <nachname>Beckham</nachname>
                        <strasse>HighStreet</strasse>
                        <nummer/>
                        <postleitzahl/>
                        <stadt/>
                        <maximaleDauer/>
                        <minimaleDauer/>
                   </MyProcessResponse>
              </ns0:MyProcessResponse>
         </part>
    </outputVariable>
    --> There is one MyProcessResponse element too many
    Command 2:
    <copy>
         <from variable="CaptureData_1_globalVariable"
    part="payload" query="/task:task/task:payload"/>
    <to variable="outputVariable" part="payload"
    query="/ns1:MyProcessResponse/ns1:vorname"/>
    </copy>
    Result 2:
    <outputVariable>
         <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
              <MyProcessResponse xmlns="http://xmlns.oracle.com/VacationRequest">
                   <ns0:vorname xmlns="http://xmlns.oracle.com/bpel/workflow/task"                     xmlns:ns0="http://xmlns.oracle.com/VacationRequest">
                        <MyProcessResponse xmlns="http://xmlns.oracle.com/VacationRequest">
                             <vorname>David</vorname>
                             <nachname>Beckham</nachname>
                             <strasse>HighStreet</strasse>
                             <nummer/>
                             <postleitzahl/>
                             <stadt/>
                             <maximaleDauer/>
                             <minimaleDauer/>
                        </MyProcessResponse>
                   </ns0:vorname>
                   <nachname/>
                   <strasse/>
                   <nummer/>
                   <postleitzahl/>
                   <stadt/>
                   <maximaleDauer/>
                   <minimaleDauer/>
              </MyProcessResponse>
         </part>
    </outputVariable>
    --> This was moreless expected, since I tried to copy the stuff to some wrong place.
    Command 3:
    <copy>
         <from variable="CaptureData_1_globalVariable"
    part="payload" query="/task:task/task:payload/ns0:MyProcessResponse"/>
    <to variable="outputVariable" part="payload"
    query="/ns1:MyProcessResponse"/>
    </copy>
    Result 3:
    --> Task does't return (!!!). In the BPEL Worklist, the task is completed, however in the BPEL console it still apears as "waiting to return from Human task".
    Does anyone have a hint on how to copy the values so that I get exactly the structure that I printed at the very top?
    Thanks for help. Rock On !

    Hello everyone,
    It seems that we are talking about different things, I am afraid. Let me describe the scenario once again:
    - I want to have a BPEL process with more than one role involved
    - This process should be used to gather some complex data.
    - All data gathering should be done through HumanTasks.
    So I defined an xsd complex type, that contains a sequence of fields. This complex type should be part of the process payload.
    Now before HumanTask 1 is called, I copy the contents of this variable into the input for tasks1. This works fine and I see the appropriate values, when opening the Human Task in the BPEL worklist application.
    Now after HumanTask1 is completed, the values I entered inside that tasks are returned as a variable from the HumanTask. My problem is, that I cannot copy the contents of the task back into the main process. With simpleTypes this is relatively ok, since Jdev supports the assembling of the copy operation, however for complex tasks it fails.
    A typical scenario for this would be where e.g. a customer fills a shipping address and afterwards a store staff fills product details in the same order. In Java this could be solved via "pass by reference". Who can provide an example?

  • How to invoke a Web Service from PL/SQL with Complex Type as  input.

    Hello,
    I am trying to invoke a web service from PL/SQL using the UTL_DBWS package.
    The web service expects a complex type as input (defined below):
    <xs:complexType name="MsgType">
    <xs:sequence>
    <xs:element name="sender" type="xs:string"/>
    <xs:element name="messageId" type="xs:string"/>
    <xs:element name="messageType" type="xs:string"/>
    <xs:element name="dateSent" type="xs:date"/>
    </xs:sequence>
    </xs:complexType>
    How to construct input to this in PL/SQL Procedure?
    Has any body tried this before?
    An exmaple will be helpful.
    Thanks

    Dear,
    I have read your article, it is useful for me. But I cannot Apply to my case. Please kindly help me. Thank you.
    When running, the error occurs:
    1:39:31 Execution failed: ORA-20000: soapenv:Server.userException - org.xml.sax.SAXParseException: Attribute name &quot;password&quot; associated with an element type &quot;user&quot; must be followed by the &apos; = &apos; character.
    My webservice Url: http://abc.com.vn:81/axis/ABC_WS_TEST.jws?wsdl
    I make PL/SQL (similiar as your example)
    FUNCTION INVOKESENDMT
    RETURN VARCHAR2
    AS
    l_request soap_api.t_request;
    l_response soap_api.t_response;
    l_return VARCHAR2(32767);
    l_url VARCHAR2(32767);
    l_namespace VARCHAR2(32767);
    l_method VARCHAR2(32767);
    l_soap_action VARCHAR2(32767);
    l_result_name VARCHAR2(32767);
    p_zipcode VARCHAR2(160);
    BEGIN
    --p_zipcode:='''TEST'' ; ''TEST'';''84912187098'';''84912187098'';''0'';''8118'';''1'';''000001'';''ThuNghiem'';''''';
    p_zipcode:='TEST';
    -- Set proxy details if no direct net connection.
    --UTL_HTTP.set_proxy('myproxy:4480', NULL);
    --UTL_HTTP.set_persistent_conn_support(TRUE);
    -- Set proxy authentication if necessary.
    --soap_api.set_proxy_authentication(p_username => 'TEST',
    -- p_password => 'TEST');
    l_url := 'http://abc.com.vn:81/axis/ABC_WS_TEST.jws';
    l_namespace := 'xmlns="' || l_url || '"';
    l_method := 'sendMT';
    l_soap_action := l_url || '#sendMT';
    l_result_name := 'sendMTResponse';
    l_request := soap_api.new_request(p_method => l_method,
    p_namespace => l_namespace);
    soap_api.add_parameter(p_request => l_request,
    p_name => 'user password sender receiver chargedflag servicenumber messagetype messageid textcontent binarycontent',
    p_type => 'xsd:string',
    p_value => p_zipcode);
    l_response := soap_api.invoke(p_request => l_request,
    p_url => l_url,
    p_action => l_soap_action);
    l_return := soap_api.get_return_value(p_response => l_response,
    p_name => l_result_name,
    p_namespace => l_namespace);
    RETURN l_return;
    END;

  • Syntax error - Field is defined differently in screen (ABAP Dictionary)

    Hi
    I get a syntax error after decoupling a dynpro field from its original DDIC type (Disabling checkbox "Frm Dict"). The error message is
    [DE]  Feld ... ist im Dynpro unterschiedlich definiert (ABAP-Feld, DDIC-Feld).
    [EN]  Field ... is defined differently in screen (ABAP/4 field, Dictionary field).
    The error occurs on PLM 600/700 but not on PLM 500.
    Thanks in advance for your help.
    Regards,
    Michael

    hi Praneeth,
    what is the program name,screen number you are trying to modify..,and after appending the field <b>ZZKVGR6 to KNVV</b> , now go to table and choose menu <b>Utilities->Data base Utility-></b> now click on  <b>Activate and Adjust the Data base</b>, then try to add the field.
    and are you adding the field from Dictionary (i.e you have option Get From Dictionary in that give KNVV table name it will list the fields, choose zzkvgr6 from it, and place it in your screen.)
    the exit which you are adding should be appropriate one
    or else you won't get the desired results. what is the exit..
    Regards
    vijay

  • Mapping problem Moving Complex Type to field

    Dear all,
    I am making a message using from RFC(ECC 6.0) to SOAP
    Some fields of the structure of RFC are:
    STRUCTURE_VALUE -> Complex Type
          END    - NUMC 20
          ID        - NUMC 3
          COST  - NUMC  5
          RATE  - NUMC  6
    The structure of Data Type to SOAP is:
    DATA_VALUE - STRING
    I need to concatenate the first structure in the second structure but I have too many fields in the STRUCTURE_VALUE and I don't want to use the function CONCATENATE in the MAPPING EDITOR. I would like to move the complex type STRUCTURE_VALUE to structure DATA_VALUE.
    Does anybody know if it's possible?
    Best regards,
    Fernando

    Hi,
    First of all what needs to be concatenated ? Each fields of the Source segment ?
    If so write a user defined function, which reads all the fields and retruns one concatenated field as an output.
    To know about this , you can go thru these- to understand the way how it works-and for e.g
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd
    Rgds,
    Moorthy

  • DATA TYPE IN ABAP CORRESPONDING TO TYPE REAL IN MDM

    Hi all,
    I am working on a code to fetch data from MDM, using the  *MDM ABAP APIs*_._ I could retrieve almost all the Fields except for one, which has data type REAL in MDM. I need to find the type in ABAP, corresponding to the type REAL in MDM. I need to define this field in the structure but I am not sure as to which data type to put against it. I have already tried float, decimal, string, char... nothing works!!
    Kindly let me know if anybody has come across the same issue and resolved it.
    Thanks and regards,
    Aastha

    Hello,
    We're getting the same problem too.
    Have you deleted your Real fields and u've created them as a measurement field?
    Is it really necessary to create the fields with type 'measurement'?
    Or do you maintain in MDM your field with type Real and you treat it as type 'mesurement' into your ABAP API with measure 'none', while in SAP ECC it's created as a numeric with decimals.
    Thanks for your feedback!
    Carlos Santamaría.

  • How to create a reference instead of complex type for record in data structure type in BizTalk schema

    I have created the record in BizTalk schema but i will give to Data Structure Type as reference For eg:Recordname(Reference) instead of recordname(Complex type).
    Please help me to sort this out
     

    You can add a reference to an existing type only.
    You might have to manually edit the XSD file to change the xmlns definiton to xmlns:tns and then after you define the record type, set the datatype to tns:.... this creates the XML Type. Then later in your schema you can instantiate this with a name and
    then set type to tns:.... (Reference)
    Regards.

  • WCF Service as Data source in SSRS report with Complex Types

    Hi All,
    I have a requirement where we are suppose to use WCF service as datasource in SSRS. I was able to do that when the WCF response type was simple.
    Now the requirement have changed where the response type is complex . I couldn't figure out a way of accessing WCF with complex types.
    Any pointer will be of great help as I couldn't find any related articles for this kind of scenario.
    Raj

    Hi Raj,
    WCF uses a serialization engine called the Data Contract Serializer by default to serialize and deserialize data (convert it to and from XML). All .NET Framework primitive types, such as integers and strings, as well as certain types
    treated as primitives, such as DateTime and XmlElement,
    can be serialized with no other preparation and are considered as having default data contracts. Many .NET Framework types also have existing data contracts. For a full list of serializable types, see Types
    Supported by the Data Contract Serializer.
    New complex types that you create must have a data contract defined
    for them to be serializable. You can explicitly create a data contract by using DataContractAttribute and DataMemberAttribute attributes.
    This is normally done by applying the DataContractAttribute attribute
    to the type.
    You can refer to :
    http://msdn.microsoft.com/en-us/library/ms733811(v=vs.110).aspxhttp://www.codeproject.com/Articles/738844/Using-WCF-Data-Contract-Known-Types-by-Example
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Complex types in fault messages - is this possible in WLS8.1?

    Hi all,
    I'm writing a standard WSDL and want to return a complex type (or at least, a customised simple type) in a fault. This has been previously discussed here: http://forums.bea.com/bea/thread.jspa?threadID=600004053&tstart=15. I've given full details below, but the short story is that if a <fault> message if a complex type, then wsdl2service fails with odd errors. If on the same WSDL/schema I change the exception type to a builtin type (like xsd:string), it all works fine.
    Google yields nothing, but if anyone has some pointers on how to do it or where to read, I'd be grateful.
    Cheers,
    -Tim West
    Details:
    I have a message and operation:
      <message name="AirlineException">
        <part name="AirlineException" element="tns:AirlineException"/>
      </message>
      <portType name="AirlinePort">
        <operation name="getCustomer">
          <input message="tns:getCustomerIn"/>
          <output message="tns:getCustomerOut"/>
          <fault name="AirlineException" message="tns:AirlineException"/>
        </operation>
      </portType>Where AirlineException is defined thus:
          <complexType name="AException">
            <sequence>
              <element name="message" type="string" nillable="true"/>
            </sequence>
          </complexType>
          <element name="AirlineException" type="tns:AException"/>(If I can get this to work, I will flesh out the complexType with some more information).
    When I attempt to generate bindings with autotype and wsdl2service, autotype works but wsdl2service fails like this:
    generate-server-binding-jar:
    [autotype] Autotyping for wsdl Deploy/airline/airline-ws-server_war/WEB-INF/airline.wsdl
    [wsdl2service] Generating web service from wsdl Deploy/airline/airline-ws-server_war/WEB-INF/airline.wsdl
    [wsdl2service] C:\...\org\jacksonwest\airline\binding\AirlineException.java:13:
           package org.jacksonwest.airline.binding.types does not exist
    [wsdl2service] private org.jacksonwest.airline.binding.types.AException info;
    [wsdl2service] ^
    [wsdl2service] C:\...\org\jacksonwest\airline\binding\AirlineException.java:15:
          package org.jacksonwest.airline.binding.types does not exist
    [wsdl2service] public AirlineException(org.jacksonwest.airline.binding.types.AException t) {
    [wsdl2service] ^
    [wsdl2service] C:\...\org\jacksonwest\airline\binding\AirlineException.java:19:
          package org.jacksonwest.airline.binding.types does not exist
    [wsdl2service] public org.jacksonwest.airline.binding.types.AException getAirlineException() {
    [wsdl2service] ^
    [wsdl2service] C:\...\org\jacksonwest\airline\binding\AirlineException.java:23:
          package org.jacksonwest.airline.binding.types does not exist
    [wsdl2service] public void setAirlineException(org.jacksonwest.airline.binding.types.AException t) {
    [wsdl2service] ^
    [wsdl2service] 4 errors
    [wsdl2service] java.io.IOException: Compiler failed executable.execNow, if I change the type of element 'AirlineException' to a built-in type like 'string', it all works fine. Also, I can use the generated 'AException' type in an <input> or <output> message - it's the combination of complexType and <fault> that causes the problem.
    My service was originally document/literal, and I've since rewritten it as rpc/literal, as I've had more success with rpc than document on Java platforms. The problem exists in both WSDL styles.
    I've read at http://e-docs.bea.com/wls/docs81/notes/new.html that WLS8.1 should be now able to handle complexTypes in faults, but for the life of me I can't do it!

    I got it :)
    The bizarre compile errors were being caused by the old version of the classes being present on the classpath that I supplied to wsdl2service. When I removed them (leaving only weblogic.jar and webservices.jar on the classpath), it worked fine first time.
    So, my guess is that the ones on the classpath (the old ones) were taking precedence over the newly-generated ones, and these were obviously not compatible!
    Cheers,
    -Tim

Maybe you are looking for

  • Font in a PNG

    hi! i'm currently developing a game in J2ME .... i wanted to use my own font, so i created a PNG file with all my characters. after, i wrote my "BitmapFont"-class here it is: * Created on 23.12.2004 package sokodeluxe.util.bitmapfont; import javax.mi

  • I cannot use Sync Feature in my computer

    I have created a account to sync my Firefox settings in my computer. But i didn't complete the whole process earlier. Now i am trying to use my account to sync. But i cannot create a sync key with my earlier account. And also i tried to create a new

  • 10g Graphs - How to customize the default color of a Bar Graph

    Hi, I've posted this thread in Reports section, have received no reply yet. Maybe no one has ever tried this before!! I am porting a couple of 6i OGD's to 10g graphics. Basically I am invoking reports from a form. The reports contains embedded Graph.

  • UnitOfWork doesn't release pessimistic row lock???

    I have an application that polls a DB table for new "submissions", then forwards them to another server to handle them asynchronously. When the asynchronous response comes back, my application verifies that all response have been received from the se

  • Frustration with Address Book - Not Allowing Copy/Paste of Contact Card

    Has anyone found a work-around for copy/paste of an entire contact card in Address Book? Address Book used to allow you highlight and copy all of the content of a contact v-card. Since Snow Leopard released (including the 10.6.2 update), it only allo