Mapping Complex Types in a UDF

Hi,
I have a big text file that is very messed up that I need to clean up. I'm doing this clean up in a UDF. When doing the mapping, i would like to cater for the whole complex type and not just the individual nodes. Is this possible, and if so how?
Thank you

Hi,
I would not recommend this doing in udf because it would be tedious. Also how will you read the whole complex file into one field when you also have other fields? May be if you can give the file here and tell us what you are trying to do then somebody can tell a design or an approach. Else if you feel that you cannot handle it in udf then you can try other mappings.
Regards,
---Satish

Similar Messages

  • 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

  • Mapping List Complex Types in BPM (unbounded)

    Hello,
      I need help in how can I map a list of complex types in BPM.
      I have a list of products that brings a web service that I have to map to the process context. Both types have the same elements, but the process context BPM shows me an error because it is different of the web service.
      Please, any documentation or advice.
    Regards
    SU

    Hi,
    For mapping the complex types, you need to follow the below:
    Start by mapping the outermost node first and then mapping the attributes inside the node. Intially it will show the (types do not match) error and when you are done with all the mapping the error would vanish.
    Cheers,
    Arafat

  • How to map XSD complex type nodes

    Hello In my XSD I have complex type like this:
    How to map this node to Target filed, I can not see PostalCode node my graphical editor:
    <xs:element name="InternationalAddress" nillable="true" type="tns:InternationalAddress" />
      <xs:complexType name="CanadianAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Province" nillable="true" type="tns:ProvinceCodes" />
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>

    How to handle this in my graphical mapping:
    <xs:complexType name="Address">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="City" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Country" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line1" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line2" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line3" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line4" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Address" nillable="true" type="tns:Address" />
      <xs:complexType name="InternationalAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="Region" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="InternationalAddress" nillable="true" type="tns:InternationalAddress" />
      <xs:complexType name="CanadianAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Province" nillable="true" type="tns:ProvinceCodes" />
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="CanadianAddress" nillable="true" type="tns:CanadianAddress" />
      <xs:complexType name="AmericanAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="State" nillable="true" type="tns:StateCodes">
              </xs:element>
              <xs:element minOccurs="0" name="ZipCode" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="AmericanAddress" nillable="true" type="tns:AmericanAddress" />

  • Map xsd complex type to existing java class without adding JAXB annotations

    Hello
    I've got a case where I should map an xsd complex type to an existing Java class without modifying that class, i.e. without adding JAXB annotations to that class.
    Is this possible somehow?
    As far as I've understood, the <javaType> declaration (adapter, parse/print methods) can only be used for xsd simple types.
    Thanks, Tom

    It should be possible to implement an XmlAdapter<...,...> which performs the required conversion between the original type and a JAXB-annotated type. Then, at the places where the original type is used, the @XmlJavaTypeAdapter annotation would be used.
    The xjc compiler supports this for xsd simple types (xjc:javaType annotation), but not for complex types.
    Any idea why this is restricted to simple types?
    Would it be possible to implement a xjc plugin which does this for complex types?
    Thanks Tom.

  • Soap encoded array of complex type, impossible to map?

    Hello,
    can anyone please tell me if the XI has problems (or is unable) to read from soap-encoded arrays of a complex type.
    As far as I know this is conform to SOAP 1.1
    We developed this webservice for a client, who says, he cannot map this kind of array in his XI.
    Would it be better to do it this way ?
    <complexType name="ActivityList">
      <sequence>
        <element name="ActivityEl" maxOccurs="unbounded" type="Activity"/>
      </sequence>
    </complexType>
    Excerpt of the WSDL:
        <wsdl:message name="getDataForPbnrResponse">
            <wsdl:part name="getDataForPbnrReturn" type="impl:ArrayOf_tns1_Activity"/>
        </wsdl:message>
            <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ipslsv01vm02:9080/axis/services/QEC-Service">
                <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
                <complexType name="ArrayOf_tns1_Activity">
                    <complexContent>
                        <restriction base="soapenc:Array">
                            <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Activity[]"/>
                        </restriction>
                    </complexContent>
                </complexType>
                <complexType name="ArrayOf_tns1_ActivityFeedback">
                    <complexContent>
                        <restriction base="soapenc:Array">
                            <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ActivityFeedback[]"/>
                        </restriction>
                    </complexContent>
                </complexType>
            </schema>
    Part ot the response:
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <ns1:getDataForPbnrResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://ipslsv01vm02:9080/axis/services/QEC-Service">
       <getDataForPbnrReturn xsi:type="soapenc:Array" soapenc:arrayType="ns3:Activity[7]" xmlns:ns2="http://www.w3.org/2002/12/soap-encoding" xmlns:ns3="urn:BeanService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
        <item href="#id0"/>
        <item href="#id1"/>
        <item href="#id2"/>
        <item href="#id3"/>
        <item href="#id4"/>
        <item href="#id5"/>
        <item href="#id6"/>
       </getDataForPbnrReturn>
      </ns1:getDataForPbnrResponse>
      <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Activity" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:BeanService">
       <FIN xsi:type="xsd:string">---</FIN>
       <VIN xsi:type="xsd:string"></VIN>
    cut -
       <ursache xsi:type="xsd:string"></ursache>
      </multiRef>
    </soapenv:Body>
    </soapenv:Envelope>
    Thanks in advance!

    I am having this issue as well.
    From:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/ce993b45cb0a85e10000000a1553f6/frameset.htm
    I see that:
    The WSDL document in rpc-style format must also not use any soapenc:Array types; these are often used in SOAP code in documents with this format. soapenc:Array uses the tag <xsd:any>, which the Integration Builder editors or proxy generation either ignore or do not support.
    You can replace soapenc:Array types with an equivalent <sequence>; see the WS-I  example under http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16556272.
    They give an example of what to use instead.
    Of course I have been given a WSDL that has a message I need to map to that uses the enc:Array.
    Has anyone else had this issue?  I need to map to a SOAP message to send to an external party.  I don't know what they are willing to change to support what I can do.  I changed the WSDL to use a sequence as below just to pull it in for now.
    Thanks,
    Eric

  • Web service Complex type

    hello i want to ask if i can make a complex type that is composed of many other classes and witch databinding framework should i use to do do the mapping from xml to my one classes not the auto generated classes thanks for your help.

    Hi Ray,
    I just had you set your "per" object to its constructor out of habit. Don't know about you, but I spend too much time chasing null pointer exceptions.
    Try this. It's easy and quick.
    1) Hold your mouse over the ObtenerPersonaActivaDadoCI() method in the Project Navigator tab. By doing this, I'm guessing you'll see it's not returning a Persona object.
    or
    2) Simply drag the ObtenerPersonaActivaDadoCI() method from the Project Navigator tab into your logic. By doing this, you'll notice that it has a value in front of the "=" sign. Again, I'm guessing you'll see it's not returning a Persona object.
    Even though the Persona object and the object that ObtenerPersonaActivaDadoCI() returns both have the same list of attributes, I believe that you'll continue to get the error you're seeing if you try to set per (since it's an Persona object) to the value returned form ObtenerPersonaActivaDadoCI().
    To get around the problem, let's say you instead have the ObtenerPersonaActivaDadoCI() method return it's value to an "opadCI" object (the type of object you found out that the method returns by doing 1 or 2 above). You might want to fix your problem by doing something like this:
    per.firstAttr = opadCI.firstAttr
    per.sedondAttr = opadCI.sedondAttr
    per.thirdAttr = opadCI.thirdAttr
    Hope this helps,
    Dan

  • Parsing xml for complex type using sax

    I have an xsd of below type:
    <xs:complexType name="itemInfo">
        <xs:sequence>
          <xs:element name="displayLineNumber" type="xs:string" minOccurs="0"/>
          <xs:element name="lineNumber" type="xs:integer" minOccurs="0"/>
          <xs:element name="parentLineNumber" type="xs:integer" minOccurs="0"/>
       <xs:element name="service" type="serviceInfo" minOccurs="0" maxOccurs="unbounded"/>
       </xs:sequence>
    </xs:complexType>
    <xs:complexType name="serviceInfo">
        <xs:sequence>
          <xs:element name="displayLineNumber" type="xs:string" minOccurs="0"/>
          <xs:element name="lineNumber" type="xs:integer" minOccurs="0"/>
          <xs:element name="serviceName" type="xs:string" minOccurs="0"/>
          <xs:element name="serviceDescription" type="xs:string" minOccurs="0"/>
          <xs:element name="subscriptionBand" type="subscriptionBandInfo" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="subscriptionBandInfo">
        <xs:sequence>
          <xs:element name="min" type="xs:long"/>
          <xs:element name="max" type="xs:long"/>
          <xs:element name="duration" type="xs:string" minOccurs="0"/>
          <xs:element name="price" type="xs:decimal"/>
        </xs:sequence>
      </xs:complexType>
    I have written a handler and able to handle simple type but how I can handle serviceInfo and subscriptionBandInfo as itemInfo is my root element.
    My handler class is:
    public class ProductHandler
      extends DefaultHandler
      //List to hold ProductInfo object
      private List<ProductInfo> productList = null;
      private ProductInfo product = null;
      public List<ProductInfo> getProductList()
        return productList;
      boolean bDisplayLineNumber = false;
      boolean bLineNumber = false;
      boolean bParentLineNumber = false;
      @Override
      public void startElement(String uri, String localName, String qName, Attributes attributes)
        throws SAXException
        if (qName.equalsIgnoreCase("item"))
        { //create a new ProductInfo and put it in Map
          //initialize ProductInfo object and set id attribute
          product = new ProductInfo();
          //initialize list
          if (productList == null)
            productList = new ArrayList<ProductInfo>();
        else if (qName.equalsIgnoreCase("name"))
          //set boolean values for fields, will be used in setting ProductInfo variables
          bName = true;
        else if (qName.equalsIgnoreCase("displayLineNumber"))
          bDisplayLineNumber = true;
        else if (qName.equalsIgnoreCase("lineNumber"))
          bLineNumber = true;
        else if (qName.equalsIgnoreCase("parentLineNumber"))
          bParentNumber = true;
      @Override
      public void endElement(String uri, String localName, String qName)
        throws SAXException
        if (qName.equalsIgnoreCase("item"))
          //add ProductInfo object to list
          productList.add(product);
      @Override
      public void characters(char ch[], int start, int length)
        throws SAXException
       if (bDisplayLineNumber)
          product.setDisplayLineNumber(Integer.parseInt(new String(ch, start, length)));
          bDisplayLineNumber = false;
       else if (bLineNumber)
          product.setLineNumber(Integer.parseInt(new String(ch, start, length)));
          bLineNumber = false;
        else if (bParentNumber)
          product.setParentNumber(Integer.parseInt(new String(ch, start, length)));
          bParentNumber = false;
      @Override
      public void endElement(String uri, String localName, String qName)
        throws SAXException
        if (qName.equalsIgnoreCase("item"))
          //add ProductInfo object to list
          productList.add(product);
    My ProductInfo class is:
    import com.vpc.schema.ServiceInfo;
    import java.util.ArrayList;
    import java.util.List;
    public class ProductInfo
      private String category, family, subGroup, size, productType, availability;
      private String displayLineNumber;
      private int lineNumber;
      private int parentNumber;
    private List<ServiceInfo> serviceInfo;
      public int getLineNumber()
        return lineNumber;
      public int getParentNumber()
        return parentNumber;
      public List<ServiceInfo> getServiceInfo()
        if (serviceInfo == null)
          serviceInfo = new ArrayList<ServiceInfo>();
        return serviceInfo;
      public void setServiceInfo(List<ServiceInfo> serviceInfo)
        this.serviceInfo = serviceInfo;
    I am able to do parsing for my simple type but when a complex type comes I am not able to do it. So please suggest how I can add complex type

    I suppose the posting of xsd is to show the structure of the xml...
    In any case, I can suggest a couple of things to do for the purpose.
    [1] If you still follow the same line of reasoning using some boolean like bDisplayLineNumber etc to identify the position of the parser traversing the document, you can complete the logic adding bItem (which you did not need under simplified consideration) and bService and bSubscriptionBand to identify at the parent or the grandparent in the case of the "complexType" serviceInfo and even the great-grand-parent in the case of arriving to the complexType subscriptionBandInfo...
    [1.1] With those boolean value, you determine bDisplayLineNumber etc under item directly, and then as well say bDisplayLineNumber_Service under the service etc and then bMin_SubscriptionBand etc under subscriptionBand etc. You just expand the number of those variables to trigger the setting of those fields in the object product, service in the serviceList and subscriptionBand in the subscriptionBandList etc etc.
    [1.2] All the reset of those booleans should be done in the endElement() method rather than in characters() method. That is logically more satisfactory and has a bearing in case there is a mixed content type.
    [1.3] Then when arriving at startElement of service, you make sure you initiate the serviceList, same for subscriptionBand the subscriptionList...
    [1.4] Then when arriving at endElement of service, you use setServiceInfo() setter to pass the serviceList to product and the same when arriving at endElement of serviceBand, you use setSubscriptionBand() setter to pass the subscriptionBand to service.
    ... and then basically that's is it, somewhat laborious and repetitive but the logical layout is clear. (As a side-note, you shouldn't use equalsIgnoreCase(), why should you? xml is case sensitive.)
    [2] Actually, I would suggest a much neater approach, especially when you probe many more levels of complexType. It would be even appear cleaner when you have two levels of depth already...
    [2.1] You maintain a Stack (or an implementation class of Deque, but Stack is largely sufficient here) of element name to guide the parser identifying its whereabout. By such doing, you get ride of all those bXXX's.
    This is a rewrite of the content handler using this approach and I only write the code of capturing service. Adding serviceBand is a matter of repetition of how it is done on service. And it is already clear it appears a lot neater as far as I'm concerned.
    public class ProductHandler extends DefaultHandler {
    Stack<String> tagstack=new Stack<String>();
    private List<ProductInfo> productList = null;
    private ProductInfo product = null;
    private List<ServiceInfo> serviceList=null;
    private ServiceInfo service=null;
    public List<ProductInfo> getProductList() {
      return productList;
    public List<ServiceInfo> getServiceList() {
      return serviceList;
    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) {
      if (qName.equals("item")) {
       product = new ProductInfo();
       //initialize list
       if (productList == null) {
        productList = new ArrayList<ProductInfo>();
      } else if (qName.equals("service") && tagstack.peek().equals("item")) {
       service=new ServiceInfo();
       if (serviceList==null) {
        serviceList=new ArrayList<ServiceInfo>();
      tagstack.push(qName);
    @Override
    public void endElement(String uri, String localName, String qName) {
      if (tagstack.peek().equals("item")) {
       //add ProductInfo object to list
       productList.add(product);
      } else if (tagstack.peek().equals("service") && tagstack.search("item")==2) {
       serviceList.add(service);
       product.setServiceInfo(serviceList);
      tagstack.pop();
    @Override
    public void characters(char ch[], int start, int length) throws SAXException {
      String currentName=tagstack.peek();
      int itemPos=tagstack.search("item");
      int servicePos=tagstack.search("service");
      if (currentName.equals("name") && itemPos==2)  {
       product.setName(new String(ch, start, length));
      } else if (currentName.equals("displayLineNumber") && itemPos==2) {
       product.setDisplayLineNumber(Integer.parseInt(new String(ch, start, length)));
      } else if (currentName.equals("lineNumber") && itemPos==2) {
       product.setLineNumber(Integer.parseInt(new String(ch, start, length)));
      } else if (currentName.equals("parentLineNumber") && itemPos==2) {
       product.setParentLineNumber(Integer.parseInt(new String(ch, start, length)));
      } else if (currentName.equals("displayLineNumber") && servicePos==2 && itemPos==3) {
       service.setDisplayLineNumber(Integer.parseInt(new String(ch, start, length)));
      } else if (currentName.equals("lineNumber") && servicePos==2 && itemPos==3) {
       service.setLineNumber(Integer.parseInt(new String(ch, start, length)));
      } else if (currentName.equals("serviceName") && servicePos==2 && itemPos==3) {
       service.setServiceName(new String(ch, start, length));
      } else if (currentName.equals("serviceDescription") && servicePos==2 && itemPos==3) {
       service.setServiceDescription(new String(ch, start, length));

  • 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

  • Returning complex types with arrays (Java / EJB via WSIF)

    Hi all,
    I'm writing some WSIF bindings for existing EJBs, and I've struck a bit of a problem. Basically I've got complex types that contain arrays, and while instances of these types can be passed to the EJBs, return variables typed similarly cause the following fault:
    org.collaxa.thirdparty.apache.wsif.WSIFException: com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB@1a372e0 : Could not invoke 'concatString'; nested exception is:
         org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'ejbinterfacetest.StringReturnArray' is not compatible; nested exception is:
         oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
         at com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB.executeRequestResponseOperation(WSIFOperation_EJB.java:1305)
         at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:431)
         at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:416)
    The Java class StringReturnArray is a serializable JavaBean with one property, a String[] called strings. The corresponding complexType (that works when used as a method parameter type) is stringReturnArrayType:
    <complexType name="stringArrayType">
    <sequence>
    <element name="str" type="string" maxOccurs="unbounded" />
    </sequence>
    </complexType>
    <complexType name="stringReturnArrayType">
    <sequence>
    <element name="strings" type="tns:stringArrayType" />
    </sequence>
    </complexType>
    and I've type mapped in the binding with
    <format:typeMap typeName="typens:stringReturnArrayType" formatType="ejbinterfacetest.StringReturnArray" />
    Anyone know why this would be? Is there any way I can get more information out of BPEL or OC4J regarding the fault? (I've already turned the BPEL domain logging to All)
    Cheers,
    Chris.

    Any luck with this? I am running into the same error. Apparently, this is not an issue with Java binding, but when invoking remote EJBs, we run into this. I am running 10.1.3.1 and the error is:
    <fault>
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="summary">
    <summary>
    com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB@e26dbf : Could not invoke 'getIdentityInfo'; nested exception is:
         org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'ca.bc.gov.pssg.c3.webservices.identitymanagement.Identity' is not compatible; nested exception is:
         oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    </summary>
    </part>
    <part name="detail">
    <detail>
    org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'ca.bc.gov.pssg.c3.webservices.identitymanagement.Identity' is not compatible; nested exception is:
         oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    </detail>
    </part>
    </bindingFault>
    </fault

  • Using a complex type as my input parameter

    I have defined a complex type that I want to use as my input parameter for one of my operations. I create the operation and add the complex type to my signature. When I go to the 'Query Map' dialog and try and map the complex type to one of my physical data sources the physical data source is deleted from the picutre.
    Here is what my complex type looks like:
    <xs:complexType name="FinancialContractRequestType">
    <xs:complexContent>
    <xs:extension base="srvcfwork:BaseRequestType">
         <xs:sequence>
         <xs:element name="ContractId" type="nylbt:TextType"/>
         <xs:element name="ContractIssueCd" type="nylbt:TextType" minOccurs="0"/>
         </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    When I cut and pasted the xml I didn't put that part in but I do have it. Here is what my whole schema looks like:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:srvcfwork="http://newyorklife.com/schemas/framework" xmlns:nylbt="http://newyorklife.com/schemas/cim/common/nylcorebusinesstypes" xmlns:tns="http://newyorklife.com/services/data/financialcontract" targetNamespace="http://newyorklife.com/services/data/financialcontract" elementFormDefault="qualified" version="0.1">
    <xs:import namespace="http://newyorklife.com/schemas/cim/common/nylcorebusinesstypes"
    schemaLocation="../../../schemas/cim/common/NYLCoreBusinessTypes_0_1.xsd"/>
    <xs:import namespace="http://newyorklife.com/schemas/framework"
    schemaLocation="../../../schemas/framework/ServiceFramework_0_1.xsd"/>
    <xs:element name="FinancialContractRequest" type="tns:FinancialContractRequestType"></xs:element>
    <xs:complexType name="FinancialContractRequestType">
    <xs:complexContent>
    <xs:extension base="srvcfwork:BaseRequestType">
         <xs:sequence>
         <xs:element name="ContractId" type="nylbt:TextType"/>
         <xs:element name="ContractIssueCd" type="nylbt:TextType" minOccurs="0"/>
         </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    </xs:schema>

  • Cannot send complex type as method parameter

    Cannot send complex type as method parameter
    Hi!
    I'm using a kSOAP 1.2 client and i'm having trouble executing a method that takes an object
    of complex type as parameter:
    method:
    public void addSquareDetail(SquareDetail sd){/stuff}
    -SquareDetail is a java bean class that implements KvmSerializable
    - a mapping was added to classmap
    -legacy namespace is not an issue (i AM able to execute the following methods successfully
    over kSOAP):
    -getting one SquareDetail object
    -getting a vector of squareDetail objects
    Here's how i'm trying to call the 'send' method:
         ClassMap classMap = new ClassMap();
    classMap.addMapping("urn:SquareWebService/types", "SquareDetail", (new
    SquareDetail()).getClass());
    System.out.println("add one SquareDetail");
    request = new SoapObject(serviceURN, "addSquareDetail");
    sd = new SquareDetail();
    request.addProperty("SquareDetail_1", sd);
    tx = new HttpTransport(this.endPointURL, "addSquareDetail");
    tx.debug = true;
    tx.setClassMap(classMap);
    tx.call(request); //exception here
    (above:)
    private String endPointURL = "http://localhost:8080/SquareWebService/SquareWebService";
    protected static final String serviceURN = "urn:SquareWebService/wsdl";
    Error(from server, Sun ONE App Server7):
    SoapFault - faultcode: 'env:Server' faultstring: 'Internal Server Error (deserialization
    error: unexpected XML reader state. expected: END but found: START: someInt)' faultactor:
    'null' detail: null
    Here are request/response dumps:
    -request---------
    <SOAP-ENV:Envelope xmlns:n0="urn:SquareWebService/types"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <addSquareDetail xmlns="urn:SquareWebService/wsdl" id="o0" SOAP-ENC:root="1">
    <SquareDetail_1 xmlns="" xsi:type="n0:SquareDetail">
    <someFloat xsi:type="SOAP-ENC:float">1.5</someFloat>
    <someInt xsi:type="xsd:int">-1</someInt>
    <someString xsi:type="xsd:string">someString from SquareDetail</someString>
    <propertyCount xsi:type="xsd:int">4</propertyCount>
    </SquareDetail_1>
    </addSquareDetail>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    response------------
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:SquareWebService/types"
    xmlns:ns1="http://java.sun.com/jax-rpc-ri/internal"
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><env:Fault><faultcod
    e>env:Server</faultcode><faultstring>Internal Server Error (deserialization error:
    unexpected XML reader state. expected: END but found: START:
    someInt)</faultstring></env:Fault></env:Body></env:Envelope>
    So, apparently, the request message is not understood by the server. what exactly is it
    missing, and how can i add/correct that? (my guess in SquareDetail_1 xmlns="" should be
    "urn:SquareWebService/types", although it's just a guess AND i don't know how to make kSOAP
    get it in there)
    I'm not sure what kind of SOAP parser my app server utilizes, but i'm guessing it's an
    apache product (how can i tell?). I also have a WSDL file available, should anyone be
    willing to look at it, please let me know
    thanks
    -nikita

    Don't know if it will help but Can you check if the serializable object has a public empty no args constructor with an empty call to super()
    Also make sure that a type mapping registry is added with a reference to the serializable object in it.
    Please paste The WSDL as well

  • How to generate wsdl for complex type using wscompile?

    Hi
    Since couple of days I am trying to generate the the wsdl for following classes
    abstract class Key implements serializable{
    class sikeKey extends Key{
    int siteKey;
    class AddressKey extends siteKey{
    int addressId;
    class Model{
    AddressKey key = new AddressKey();
    }I am using following ant script for wscompile
          <wscompile
              fork= "true"
              base="${dest.dir}/war/WEB-INF/classes"
              server="true"   
              features="wsi"
              mapping="${dest.dir}/war/WEB-INF/Address_Mapping.xml"
              sourceBase="${war.dir}/WEB-INF/classes"
              optimize="false"
              debug="true"
              keep="false"
              verbose="true"
              xPrintStackTrace="true"
              config="${acws-config-dir}/Address_Config.xml">
              <classpath>
                            <pathelement path="${acws.classpath}"/>
                            <pathelement path="${war.dir}/WEB-INF/classes"/>
                   </classpath>
          </wscompile>
    <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
        <classpath path="${acws.classpath}"/>
    </taskdef>It generates the wsdl but without all complex type.
    <complexType name="AddressWebServiceModel">
    <sequence>
    <element name="addKey" type="tns:AddressKey" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="AddressKey">
    <sequence>
    <element name="siteID" type="string" nillable="true"/>
    <element name="addressID" type="int"/>
    </sequence>
    </complexType>Here it should create the right mapping for classes siteKey so that the webservice call can be mapped with the response of this Model.
    Any one know how to configure the above script for proper mapping of complex type?

    Add the concrete subclasses of Key in an <AddtionalType> element in your config.xm. file.

  • ASMX webservice with Complex type argument consuming in Biztalk

    There is a requirement to consume asmx webservice in biztalk orch.The asmx webservice ,webmethod is having complex type as a argument
    For Ex:CalculateFDR(Invoice as invoice) Here Invoice is a class.now consumed an asmx webservice using WCF consume wizard in BizTalk.
    In orchestration , when I create the Requestmessage and bind to messagetype with MyFin.CalculateFDRSoapIn.
    Now In expression shape when I want pass invoice values as argument  to Request message i am getting like below
    Msg_ServiceRequest.Parameters. instaed
    Msg_ServiceRequest.Invoice.InvoiceNo etc.
    Even When I check the multi-partmessage type i found that CalculateFDRSoapIn-Parameters and description of multi-part message type is <wsdl:message name="WriteDBEntrySoapIn"/> messagepart description is  <wsdl:part name="parameters"/> 
    Could you please let me know how to pass Invoice values as a argument for this webservice in Orchestration
    Note: We are palnning to use wcf-basichttp adapter.due to this not using webreference option
    Regards BizTalkWorship

    When you consume WCF/Web service using WCF/Web service wizard, it creates multi-part message type representing the contract’s of the parameters exchanged. This multi-part message will have
    message part names as “parameters”. This parameter can be of primitive .NET Types type like System.String, System.Int32 etc or it could be of a schema type.
    If multipart message’s message part type of Primitive .NET Types, then you can construct the message as you say something like..
    Msg_ServiceRequest.InvoiceNo
    Here if InvoiceNo could be of any primitive .NET Types.
    If it’s of any schema type then you got to construct the schema first either using map (Transform) or in message-assignment. In your case it seems to be the multipart message’s message part
    type is that of a schema. So you have to construct the schema using either map (Transform) or in message-assignment.
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • 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...

Maybe you are looking for

  • Vendor payments made year to date

    Hi Friends, I have to show the report to client which can give year to date payments made to all individual vendors. I have around 3000 vendors and I need to pull report for all of them Can you please tell me if there is any standadrd SAP report or s

  • DirSync doesn't work

    Hi, i try to implement test network with Office 365 and AD Domain on-premise. Have created federated trust, it seems works: PS C:\> Get-MsolFederationProperty -DomainName testdomain.maildomain.org Source : ADFS Server ActiveClientSignInUrl : https://

  • Problem in CFL Title

    Hi All, I have a problem in the CFL. 1. I have set an object Type 20 ( oPurchaseDeliveryNotes)  for getting a List of Goods Receipt details in the CFL in that  for status column it shows the heading as Qty how to change Heading as status. 2. I have s

  • GZIP ERROR -

    Hi all, when Trying to audit a running instance on bpel console i got the gzip error below. i click audit==>view raw xml ...any heşp would be appreciated.. reagrds *<exception>* Cannot uncompress data stream. Cannot uncompress data stream with GZIP a

  • Upgrade to iTunes 10 causes loss of tracks

    I needed to upgrade to iTunes 10 as I had just bought a new Nano. However, I now find that quite a few of my library tracks are missing as well as playlists I'd set up for my wife and myself. Grateful for any help.