function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AcademicHoboAcademicHobo 

Getting - Error: Failed to parse wsdl: output not defined in binding operation ...

I have a web service that I want to call from within an APEX trigger.  I've never done that before.  So this is undiscovered country for me.  My wsdl is as follows:

 

<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
     name="APEXBPEL"
     targetNamespace="http://xmlns.oracle.com/VUAdvanceSF_jws/SFTest/APEXBPEL"
     xmlns:client="http://xmlns.oracle.com/VUAdvanceSF_jws/SFTest/APEXBPEL"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    >
    <wsdl:types>
        <schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema"
             xmlns:client="http://xmlns.oracle.com/VUAdvanceSF_jws/SFTest/APEXBPEL" targetNamespace="http://xmlns.oracle.com/VUAdvanceSF_jws/SFTest/APEXBPEL">
            <element name="process">
                <complexType>
                    <sequence>
                        <element name="UserID" nillable="true" minOccurs="0" type="string"/>
                        <element name="BannerID" nillable="true" minOccurs="0" type="string"/>
                        <element name="BannerLastName" nillable="true" minOccurs="0" type="string"/>
                        <element name="Pidm" nillable="true" minOccurs="0" type="decimal"/>
                        <element name="Subject" nillable="true" minOccurs="0" type="string"/>
                        <element name="Comments" nillable="true" minOccurs="0" type="string"/>
                        <element name="AssignedTo" nillable="true" minOccurs="0" type="string"/>
                        <element name="ModifiedDate" nillable="true" minOccurs="0" type="dateTime"/>
                        <element name="ModifiedUser" nillable="true" minOccurs="0" type="string"/>
                        <element name="DataSource" nillable="true" minOccurs="0" type="string"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
    </wsdl:types>
    <wsdl:message name="APEXBPELRequestMessage">
        <wsdl:part name="payload" element="client:process"/>
    </wsdl:message>
    <wsdl:portType name="APEXBPEL">
        <wsdl:operation name="process">
            <wsdl:input message="client:APEXBPELRequestMessage"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="APEXBPELBinding" type="client:APEXBPEL">
        <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="process">
            <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" soapAction="process"/>
            <wsdl:input>
                <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" namespace="http://xmlns.oracle.com/VUAdvanceSF_jws/SFTest/APEXBPEL"/>
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="apexbpel_client_ep">
        <wsdl:port name="APEXBPEL_pt" binding="client:APEXBPELBinding">
            <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="location of service"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

 

When I try to parse the wsdl into APEX is get:

 

Error: Failed to parse wsdl: output not defined in binding operation '{http://xmlns.oracle.com/VUAdvanceSF_jws/SFTest/APEXBPEL}process'

 

I am using fire and forget because (1) I am not sending data back and (2)  I understand that one cannot call a sync web service from inside trigger code.  This wsdl works fine when I test the web service independently of Salesforce.  Anyone have any idea what is amiss here?  Thanks.

 

- Cris

Best Answer chosen by Admin (Salesforce Developers) 
sdetweilsdetweil

thats what I would suggest..

 

my Eclipse created WSDL worked perfectly..

 

the Eclipse wsdl design editor doesn't show the method causing the problem with the SF parse,

but it is in the source..

so another tool cannot/does not parse it either.

 

Sam

All Answers

sdetweilsdetweil

looks like the SF wsdl support model  requires an output object..

 

I did some creative coding using @future in my wsdl2apex created class to call the web service..

 

I moved the actual callout.invoke to the @future function, and then called that from the wsdl2apex built function

 

caller (trigger calls the method containing this code, my code can go either way.. synch or async)

            else
            {
                myclass.InvokeDefect(CreateFunction,endpoint_x, problem, product, priority, severity, description, summary, author,created);              
                rc='0';
            }

 

the @future code

called

 

@future (callout=true)
    public static void InvokeDefect(Integer calltype,
                                    String Endpoint,
                                    String problem ,
                                    String product_or_status ,
                                    String priority ,
                                    String severity ,
                                    String description ,
                                    String summary ,
                                    String author ,
                                    DateTime created )
    {                         
             myclass.RTCDefect ws = new myclass.RTCDefect();
             if(calltype==CreateFunction)
             {             
                  myclass.CreateItem_element request_x = new wwwCaComRtcdefect.CreateItem_element();
                  myclass.CreateItemResponse_element response_x;
                  request_x.problem = problem;
                  request_x.product = product_or_status;
                  request_x.priority = priority;
                  request_x.severity = severity;
                  request_x.description = description;
                  request_x.summary = summary;
                  request_x.author = author;
                  request_x.created = created;
                  request_x.comments = commentList(problem);                  
                  request_x.attachments = attachmentlist(problem);                
                  Map<String, myclass.CreateItemResponse_element> response_map_x = new Map<String, wwwCaComRtcdefect.CreateItemResponse_element>();
                  response_map_x.put('response_x', response_x);
                  WebServiceCallout.invoke(

AcademicHoboAcademicHobo

sdetweil:

 

I reached that conclusion too, but it seemed inconsistent with the requirement that callouts inside triggers invoke only asynchronous web services.  Would you suggest then, that I code up my wsdl to contain an output?  I can certainly try that.

 

Thanks,

 

Cris

sdetweilsdetweil

thats what I would suggest..

 

my Eclipse created WSDL worked perfectly..

 

the Eclipse wsdl design editor doesn't show the method causing the problem with the SF parse,

but it is in the source..

so another tool cannot/does not parse it either.

 

Sam

This was selected as the best answer
AcademicHoboAcademicHobo

I followed your suggestion and it seems to work.  Thanks.  - Cris