• dfry1.3891503769969382E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

The in-line schemas of the enterprise.wsdl I generated contains no elements for the salesforce objects I need to manipulate.  Originally, I just got around the problem by simply adding an element inside the in-schema like so:

 

<element name="Contact" type="ens:Contact"/>

 

That allowed me to assign values to an instance of the Contact object via direct assignments or xsl transformations in my BPEL orchestration.  But I don't want to modify this wsdl since it may be frequently re-generated.  So in my composite (this is Oracle SOA 11g - uses SCA), I added a wsdl that imports the enterprise wsdl and includes an in-line schema for the Salesforce object(s) I need to instantiate, like so:

 

<definitions
    
     targetNamespace="urn:enterprise.soap.sforce.com"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
     xmlns:tns="urn:enterprise.soap.sforce.com"
     xmlns:ns1="http://schemas.xmlsoap.org/ws/2003/03/addressing"
     xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
     xmlns:ens="urn:sobject.enterprise.soap.sforce.com"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >
    <import namespace="urn:enterprise.soap.sforce.com" location="http://localhost:8001/soa-infra/services/default/UDDI/simplebpel_client_ep?WSDL=enterprise.wsdl"/>
    <types>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing" schemaLocation="http://localhost:8001/soa-infra/services/default/UDDI/simplebpel_client_ep?XSD=xsd/addressing.xsd"/>
        </xsd:schema>
        <xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:sobject.enterprise.soap.sforce.com">
          <xsd:import namespace="urn:enterprise.soap.sforce.com"/>
          <xsd:element name="Contact" type="ens:Contact"/>
        </xsd:schema>
    </types>
    <plnk:partnerLinkType name="Soap_PL">
        <plnk:role name="Soap_Role">
            <plnk:portType name="tns:Soap"/>
        </plnk:role>
    </plnk:partnerLinkType>
</definitions>

 

Note that the enterprise.wsdl is external to the composite since it may be called by a number of composites.  This tactic does appear to allow me to instantiate and use the Contact object in BPEL.  The composite deploys and runs OK so far.  But during the build in JDeveloper, I get  warnings of the following type:

 

[scac] [WARNING]  Line [311]Trying to assign incompatible types
     [scac] <from> value type "{urn:sobject.enterprise.soap.sforce.com}Contact" is not compatible with <to> value type "{urn:sobject.enterprise.soap.sforce.com}sObject"
     [scac] Make sure that the return value of from-spec query is compatible with the to-spec query

 

The 'offending' code is as follows:

 

 <assign name="AssignInsert">
                      <copy>
                        <from variable="ContactInput" query="/ns2:Contact"/>
                        <to variable="InvokeInsert_create_InputVariable"
                            part="parameters" query="/ns1:create/ns1:sObjects"/>
                      </copy>
                    </assign>

 

where the namespaces are:

 

xmlns:ns1="urn:enterprise.soap.sforce.com"
xmlns:ns2="urn:sobject.enterprise.soap.sforce.com"

 

I don't want to ignore this warning.  Any idea how I can construct my code to make the warnings go away?

 

Thanks in advance for any and all help.

 

- Cris