• aksm
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
Hi,
 
I am new to Apex development.
I am calling an external web service using an Apex controller.
How do I monitor the request-response xml which I am sending and receiving from the external web service from Salesforce.
 
I have tried the System.debug's Callout method but that does not help me.
 
thanks
Sk
 
  • July 09, 2008
  • Like
  • 0
Hi,
 
I am new to Apex Development.
I have generated an Apex class from WSDL and created a controller.
 
I got the following exception when I tried to access the external web service through visualforce page,
 
System.CalloutException: Web service callout failed: WebService returned a Soap Fault: Schema validation failed for request. faultcode=soapenv:Server fault actor=
 
Here is my partial schema definition:
wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://fedex.com/ws/ship/v3" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://fedex.com/ws/ship/v3" name="ShipServiceDefinitions" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
 <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://fedex.com/ws/ship/v3" xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
Thanks in advance.
sk.
 
 
 

 

 


  • July 07, 2008
  • Like
  • 0
Hi,
 
I have created an Apex class (for external web service) from WSDL file. I am planning to use S-Control to invoke that class.
The external web service will return a string and write PDF file to my local machine after the call.
My question is how do I display the PDF file from SalesForce? Is this possible?
 
thanks
sk
  • July 03, 2008
  • Like
  • 0
Hi,
 
I am trying to create an Apex class from WSDL. It parses the WSDL fine.
I got the following error message when I tried to generate the apex class,
 
Apex generation failed,
Error: ShipServiceWS
 
Error: Script too large: //Generated by wsdl2apex
 
Does that mean the WSDL file (193 KB) is too large in size?
How do I generate the class?
 
thanks
Sk
 
 
 
 
  • July 02, 2008
  • Like
  • 0
Hi,
 
I am new to Apex development.
I would like to achieve the following,
1) writing a class to call Fedex web services (passing parameters for shipping adderss to fedex)
2) get the tracking number and print label (as a .pdf file) back from fedex.
and display it under salesforce.
 
Is it possible to do with Apex class?
 
I have tried to parse the Fedex WSDL but I was getting the following error,
Apex generation failed.
Error message:
Error: Unsupported WSDL. Operation 'deleteShipment' has more than one output element.
 
could someone help me to convert the Fedex WSDL to Apex standards so that I can generate Apex classes from that.
 
thanks
Sk
  • June 30, 2008
  • Like
  • 0
Hi,
 
I am a new bee to Apex development.
I am trying to generate Apex class from Fedex shipping WSDL file.
 
After parsing the file, I tried to generate the Apex class but I was getting the following error,
 
Apex generation failed.
Error message:
Error: Unsupported WSDL. Operation 'deleteShipment' has more than one output element.
 
How do I generate the Apex class?
 
please throw some light on it.
 
thanks
sk
  • June 26, 2008
  • Like
  • 0
Hey,

I am finding, when running certain WSDL files thru 'wsdl2apex', that there are empty sub-classes in the resulting Apex code, and I'm not sure what do do with them. 

I have included a stripped-down WSDL sample, and the resulting Apex, below.  Note in particular the element 'SendingCompanyID', embedded in the 'CustomerTransfer' element, which encapsulates a SimpleType.  Pretty basic stuff, I think.  The resulting 'SendingCompanyID_element' class in the Apex code is empty.  Is this correct?  I have to pass an instance of that class into the 'BasicHttpBinding_ITwoWayAsyncVoid.rcv_operation_Intake()' method, and I cannot see how to to actually insert any information into it.

Can someone out there help me understand how to use this Apex class - or, if there's something wrong with it, what to do about it?

Also - I have heard references to wsdl2apex documentation - but it's not apparent where it is - if there's a link to some good technical docs, can someone point me at it?

Thanks

-philbo

WSDL:
<—xml version="1.0" encoding="utf-8"–>
<wsdl:definitions name="BizTalkServiceInstance"
  targetNamespace="http://xyz/2008/05/partnerintake" 
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" . . . xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="CustomerTransfer">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="SequenceID" type="xs:int"/>
        <xs:element name="SendingCompanyID">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:maxLength value="25" />
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="CustomerTransferResponse">
    <xs:complexType>
      <xs:element name="success" type="xs:boolean" minOccurs="0"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
  </wsdl:types>
  <wsdl:message name="InputMessage">
    <wsdl:part name="part" element="tns:CustomerTransfer"/>
  </wsdl:message>
  <wsdl:message name="OutputMessage">
    <wsdl:part name="part" element="tns:CustomerTransferResponse"/>
  </wsdl:message>
  <wsdl:portType name="Intake">
    <wsdl:documentation>service "Intake_Orchestration.Intake" port "Intake_Request"</wsdl:documentation>
    <wsdl:operation name="rcv_operation_Intake">
      <wsdl:documentation>operation "rcv_operation_Intake"</wsdl:documentation>
      <wsdl:input message="tns:InputMessage"/>
      <wsdl:output message="tns:OutputMessage"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="BasicHttpBinding_ITwoWayAsyncVoid" type="tns:Intake">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="rcv_operation_Intake">
      <wsdl:documentation>operation "rcv_operation_Intake"</wsdl:documentation>
      <soap:operation soapAction="rcv_operation_Intake" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Intake">
    <wsdl:port name="BasicHttpBinding_ITwoWayAsyncVoid" binding="tns:BasicHttpBinding_ITwoWayAsyncVoid">
      <soap:address location="http://dev/xyzServer/xyz.svc"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

 

 
APEX code:
//Generated by wsdl2apex

public class aon_Philbo {
    public class CustomerTransferResponse_element {
        private String[] apex_schema_type_info = new String[]{'http://xyz/2008/05/partnerintake','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class SendingCompanyID_element {
    }
    public class CustomerTransfer_element {
        public Integer SequenceID;
        public aon_Philbo.SendingCompanyID_element SendingCompanyID;
        private String[] SequenceID_type_info = new String[]{'SequenceID','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] SendingCompanyID_type_info = new String[]{'SendingCompanyID','http://xyz/2008/05/partnerintake','SendingCompanyID_element','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://xyz/2008/05/partnerintake','false'};
        private String[] field_order_type_info = new String[]{'SequenceID','SendingCompanyID'};
    }
    public class BasicHttpBinding_ITwoWayAsyncVoid {
        public String endpoint_x = 'http://dev/xyzServer/xyz.svc';
        private String[] ns_map_type_info = new String[]{'http://xyz/2008/05/partnerintake', 'aon_Philbo'};
        public void rcv_operation_Intake(Integer SequenceID,aon_Philbo.SendingCompanyID_element SendingCompanyID) {
            aon_Philbo.CustomerTransfer_element request_x = new aon_Philbo.CustomerTransfer_element();
            aon_Philbo.CustomerTransferResponse_element response_x;
            request_x.SequenceID = SequenceID;
            request_x.SendingCompanyID = SendingCompanyID;
            Map<String, aon_Philbo.CustomerTransferResponse_element> response_map_x = new Map<String, aon_Philbo.CustomerTransferResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'rcv_operation_Intake',
              'http://xyz/2008/05/partnerintake',
              'CustomerTransfer',
              'http://xyz/2008/05/partnerintake',
              'CustomerTransferResponse',
              'aon_Philbo.CustomerTransferResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
    }
}