• Please
  • NEWBIE
  • 25 Points
  • Member since 2009

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

 

I get aresult but that is not usable:

I see 2 columns and 3 rows but the values are something like: 

 "core.apexpages.el.adapters.ApexObjectValueELAdapter@1083cd2"

 

 It must be because i put {!c} as value for the columns.

I want to put {!c.k} and {!c.n} in as values but then i get the error "MyCompanies.k does not exist"

 

- what do i have to do to display the elements "k" and "n" in the columns?

- is my construction for the "companies" OK?

 


This is my Controller

 

public class myController { public class myCompanies{ string k; string n; } public List<myCompanies> companies {get;set;} myCompanies mc; // fired when the search button is clicked public PageReference search() { if (companies == null) { companies = new List<myCompanies>(); // init the list if it is null } else { companies.clear(); // clear out the current results if they exist } string mykey; string myname; for (integer i = 0; i < 3; fragment++){ mykey=string.valueof(i); myname='name'+string.valueof(i); mc=null; myCompanies mc = new myCompanies(); mc.k = mykey; mc.n = myname; companies.add(mc); //system.debug('TEST: ' + companies[i].k); } return null; } }

 

and this is the VF-page

 

<apex:page controller="myController" tabStyle="Account"> <apex:form > <apex:pageBlock mode="edit" id="block"> <apex:pageBlockSection > <apex:pageBlockSectionItem > <apex:panelGroup > <apex:commandButton value="Search" action="{!search}" rerender="block" status="status"/><p /> <apex:actionStatus id="status" startText="Searching... please wait..."/> </apex:panelGroup> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Search Results" id="resultsBlock" columns="1"> <apex:pageBlockTable value="{!companies}" var="c" rendered="{!NOT(ISNULL(companies))}"> <apex:column value="{!c}" headerValue="Key" /> <apex:column value="{!c}" headerValue="Name" /> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 

 

Hi,

 

I can't figure out what is the cause of this error when i am trying to do a callout to a external webservice,

 

Whatever i try i keep getting this error....

 

I used wsdl2apex for a "Wrapped documet/literal" wsdl.

 

I'd like to know what is possible and what is not possible for use of the wsdl2apex feature...

 

The "unable to parse" problem.... is it something I can do something about or is salesforce unable to parse the response anyhow...???

 

Please tell me.... i am getting a bit frustrated on this matter because ist described as an easy to use feature.... 

 

 

This is the WSDL

 

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions targetNamespace="http://soapserver.jsm.marktselect.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapserver.jsm.marktselect.com" xmlns:intf="http://soapserver.jsm.marktselect.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <!--WSDL created by LANSA Integrator SOAP Wizard and Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)-->

 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://soapserver.jsm.marktselect.com" xmlns="http://www.w3.org/2001/XMLSchema">

   <element name="getAddress1">
    <complexType>
     <sequence>
      <element name="username" type="xsd:string"/>
      <element name="password" type="xsd:string"/>
      <element name="profileid" type="xsd:string"/>
      <element name="postal_code" type="xsd:string"/>
      <element name="house_number" type="xsd:string"/>
      <element name="country_code" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getAddress1Response">
    <complexType>
     <sequence>
      <element name="getAddress1Return" type="impl:GetAddress1_response"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="GetAddress1_response">
    <sequence>
     <element name="address_city" nillable="true" type="xsd:string"/>
     <element name="address_house_number" nillable="true" type="xsd:string"/>
     <element name="address_postalcode" nillable="true" type="xsd:string"/>
     <element name="address_street" nillable="true" type="xsd:string"/>
     <element name="resultCode" nillable="true" type="xsd:string"/>
     <element name="resultMessage" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

 <wsdl:message name="getAddress1Request">
  <wsdl:part element="impl:getAddress1" name="parameters"/>
 </wsdl:message>

 <wsdl:message name="getAddress1Response">
  <wsdl:part element="impl:getAddress1Response" name="parameters"/>
 </wsdl:message>

 <wsdl:portType name="AddressDirectServer2ServicePortType">
  <wsdl:operation name="getAddress1">
   <wsdl:input message="impl:getAddress1Request" name="getAddress1Request"/>
   <wsdl:output message="impl:getAddress1Response" name="getAddress1Response"/>
  </wsdl:operation>
 </wsdl:portType>

 <wsdl:binding name="AddressDirectServer2ServiceBinding" type="impl:AddressDirectServer2ServicePortType">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="getAddress1">
   <wsdlsoap:operation soapAction="getAddress1"/>
   <wsdl:input name="getAddress1Request">
    <wsdlsoap:body use="literal"/>
   </wsdl:input>
   <wsdl:output name="getAddress1Response">
    <wsdlsoap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
 </wsdl:binding>

 <wsdl:service name="AddressDirectServer2ServiceService">
  <wsdl:port binding="impl:AddressDirectServer2ServiceBinding" name="AddressDirectServer2ServicePort">
   <wsdlsoap:address location="http://ccc.marktselect.nl/cgi-bin/jsmdirect?MSAddressDirect2"/>
  </wsdl:port>
 </wsdl:service>

</wsdl:definitions>

 

 

This is the "with succes and without any errors" created apex class from the wsdl

 

//Generated by wsdl2apex

public class AddressDirect {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://ccc.marktselect.nl/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'AddressDirect'};
        public AddressDirect.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            AddressDirect.getAddress1_element request_x = new AddressDirect.getAddress1_element();
            AddressDirect.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, AddressDirect.getAddress1Response_element> response_map_x = new Map<String, AddressDirect.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'AddressDirect.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public AddressDirect.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}

 

and this is the prototype

 

  • public class AddressDirect {
    • public class getAddress1Response_element {
      • public AddressDirect.GetAddress1_response getAddress1Return;
    • }
    • public class GetAddress1_response {
      • public String address_city;
      • public String address_house_number;
      • public String address_postalcode;
      • public String address_street;
      • public String resultCode;
      • public String resultMessage;
    • }
    • public class getAddress1_element {
      • public String country_code;
      • public String house_number;
      • public String password;
      • public String postal_code;
      • public String profileid;
      • public String username;
    • }
    • public class AddressDirectServer2ServicePort {
      • public String clientCert_x;
      • public String clientCertPasswd_x;
      • public String endpoint_x;
      • public MAP:String,String inputHttpHeaders_x;
      • public MAP:String,String outputHttpHeaders_x;
      • public Integer timeout_x;
      • public AddressDirect.GetAddress1_response getAddress1(String, String, String, String, String, String){};
    • }
  • }

 

 

who can tell me if i must continue my quest to get this working ??? Or am i trying the impossible?

 

 

Message Edited by Please on 05-06-2009 06:35 AM

Hi,

 

I get the following error: Return type of global method must also be global: MSAddressDirect2.GetAddress1_response op regel 2 kolom 62

 

 

does anybody know what todo i tried a few things but can't get it right!? 

 

global class TestCallOut2 {
     webservice static MSAddressDirect2.getAddress1_response getAddress1(String username, string password, string profileid, string postalcode, string housenumber, string countrycode) {
        MSAddressDirect2.AddressDirectServer2ServicePort stub = new MSAddressDirect2.AddressDirectServer2ServicePort();
        MSAddressDirect2.getAddress1_response adresje = stub.getAddress1(username, password, profileid, postalcode, housenumber, countrycode);
        return adresje;
    }
}

 

 

Apexclass (generated via WSDL):

//Generated by wsdl2apex

public class MSAddressDirect2 {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://xxx.xx.xx.xx/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'MSAddressDirect2'};
        public MSAddressDirect2.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            MSAddressDirect2.getAddress1_element request_x = new MSAddressDirect2.getAddress1_element();
            MSAddressDirect2.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, MSAddressDirect2.getAddress1Response_element> response_map_x = new Map<String, MSAddressDirect2.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'MSAddressDirect2.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public MSAddressDirect2.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}

Via a s-control i call a apexcode to call a external webservice, I used the code from the platform_cookbook
(www.webservicex.net Stock Quote example) and changed it for using my own webservice...

i am getting the error "Fout: uncaught exception: {faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/TestCallOut2}getAddress1, please check the WSDL for the service.', }"

 

can somebody help me to solve this problem?

 

these are my codes:

s-control:

<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/10.0/connection.js"></script>
<script src="/soap/ajax/10.0/apex.js"></script>
<script>
function getAddress() { 
var result = sforce.apex.execute("TestCallOut2","getAddress1",{username:"xx", password:"xx", profileid:"123",       postalcode:"1111AB", housenumber:"123", countrycode:"AB"});
document.getElementById('userNameArea').innerHTML = 'Adres: '+result;
}
</script>
</head>
<body onload=getAddress()>
<div id=userNameArea>
</div>
</body>
</html>

 

Apexclass:

global class TestCallOut2 {
     public static MSAddressDirect2.getAddress1_response  getAddress1(String username, string password, string profileid, string postalcode, string housenumber, string countrycode) {
        MSAddressDirect2.AddressDirectServer2ServicePort stub = new MSAddressDirect2.AddressDirectServer2ServicePort();
        MSAddressDirect2.getAddress1_response adresje = stub.getAddress1(username, password, profileid, postalcode, housenumber, countrycode);
        return adresje;
    }
}

 

Apexclass (generated via WSDL):

//Generated by wsdl2apex

public class MSAddressDirect2 {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://193.67.5.194/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'MSAddressDirect2'};
        public MSAddressDirect2.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            MSAddressDirect2.getAddress1_element request_x = new MSAddressDirect2.getAddress1_element();
            MSAddressDirect2.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, MSAddressDirect2.getAddress1Response_element> response_map_x = new Map<String, MSAddressDirect2.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'MSAddressDirect2.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public MSAddressDirect2.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}
  • April 29, 2009
  • Like
  • 0

 

I get aresult but that is not usable:

I see 2 columns and 3 rows but the values are something like: 

 "core.apexpages.el.adapters.ApexObjectValueELAdapter@1083cd2"

 

 It must be because i put {!c} as value for the columns.

I want to put {!c.k} and {!c.n} in as values but then i get the error "MyCompanies.k does not exist"

 

- what do i have to do to display the elements "k" and "n" in the columns?

- is my construction for the "companies" OK?

 


This is my Controller

 

public class myController { public class myCompanies{ string k; string n; } public List<myCompanies> companies {get;set;} myCompanies mc; // fired when the search button is clicked public PageReference search() { if (companies == null) { companies = new List<myCompanies>(); // init the list if it is null } else { companies.clear(); // clear out the current results if they exist } string mykey; string myname; for (integer i = 0; i < 3; fragment++){ mykey=string.valueof(i); myname='name'+string.valueof(i); mc=null; myCompanies mc = new myCompanies(); mc.k = mykey; mc.n = myname; companies.add(mc); //system.debug('TEST: ' + companies[i].k); } return null; } }

 

and this is the VF-page

 

<apex:page controller="myController" tabStyle="Account"> <apex:form > <apex:pageBlock mode="edit" id="block"> <apex:pageBlockSection > <apex:pageBlockSectionItem > <apex:panelGroup > <apex:commandButton value="Search" action="{!search}" rerender="block" status="status"/><p /> <apex:actionStatus id="status" startText="Searching... please wait..."/> </apex:panelGroup> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Search Results" id="resultsBlock" columns="1"> <apex:pageBlockTable value="{!companies}" var="c" rendered="{!NOT(ISNULL(companies))}"> <apex:column value="{!c}" headerValue="Key" /> <apex:column value="{!c}" headerValue="Name" /> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 

 

Hi,

 

I can't figure out what is the cause of this error when i am trying to do a callout to a external webservice,

 

Whatever i try i keep getting this error....

 

I used wsdl2apex for a "Wrapped documet/literal" wsdl.

 

I'd like to know what is possible and what is not possible for use of the wsdl2apex feature...

 

The "unable to parse" problem.... is it something I can do something about or is salesforce unable to parse the response anyhow...???

 

Please tell me.... i am getting a bit frustrated on this matter because ist described as an easy to use feature.... 

 

 

This is the WSDL

 

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions targetNamespace="http://soapserver.jsm.marktselect.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapserver.jsm.marktselect.com" xmlns:intf="http://soapserver.jsm.marktselect.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <!--WSDL created by LANSA Integrator SOAP Wizard and Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)-->

 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://soapserver.jsm.marktselect.com" xmlns="http://www.w3.org/2001/XMLSchema">

   <element name="getAddress1">
    <complexType>
     <sequence>
      <element name="username" type="xsd:string"/>
      <element name="password" type="xsd:string"/>
      <element name="profileid" type="xsd:string"/>
      <element name="postal_code" type="xsd:string"/>
      <element name="house_number" type="xsd:string"/>
      <element name="country_code" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getAddress1Response">
    <complexType>
     <sequence>
      <element name="getAddress1Return" type="impl:GetAddress1_response"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="GetAddress1_response">
    <sequence>
     <element name="address_city" nillable="true" type="xsd:string"/>
     <element name="address_house_number" nillable="true" type="xsd:string"/>
     <element name="address_postalcode" nillable="true" type="xsd:string"/>
     <element name="address_street" nillable="true" type="xsd:string"/>
     <element name="resultCode" nillable="true" type="xsd:string"/>
     <element name="resultMessage" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

 <wsdl:message name="getAddress1Request">
  <wsdl:part element="impl:getAddress1" name="parameters"/>
 </wsdl:message>

 <wsdl:message name="getAddress1Response">
  <wsdl:part element="impl:getAddress1Response" name="parameters"/>
 </wsdl:message>

 <wsdl:portType name="AddressDirectServer2ServicePortType">
  <wsdl:operation name="getAddress1">
   <wsdl:input message="impl:getAddress1Request" name="getAddress1Request"/>
   <wsdl:output message="impl:getAddress1Response" name="getAddress1Response"/>
  </wsdl:operation>
 </wsdl:portType>

 <wsdl:binding name="AddressDirectServer2ServiceBinding" type="impl:AddressDirectServer2ServicePortType">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="getAddress1">
   <wsdlsoap:operation soapAction="getAddress1"/>
   <wsdl:input name="getAddress1Request">
    <wsdlsoap:body use="literal"/>
   </wsdl:input>
   <wsdl:output name="getAddress1Response">
    <wsdlsoap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
 </wsdl:binding>

 <wsdl:service name="AddressDirectServer2ServiceService">
  <wsdl:port binding="impl:AddressDirectServer2ServiceBinding" name="AddressDirectServer2ServicePort">
   <wsdlsoap:address location="http://ccc.marktselect.nl/cgi-bin/jsmdirect?MSAddressDirect2"/>
  </wsdl:port>
 </wsdl:service>

</wsdl:definitions>

 

 

This is the "with succes and without any errors" created apex class from the wsdl

 

//Generated by wsdl2apex

public class AddressDirect {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://ccc.marktselect.nl/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'AddressDirect'};
        public AddressDirect.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            AddressDirect.getAddress1_element request_x = new AddressDirect.getAddress1_element();
            AddressDirect.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, AddressDirect.getAddress1Response_element> response_map_x = new Map<String, AddressDirect.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'AddressDirect.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public AddressDirect.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}

 

and this is the prototype

 

  • public class AddressDirect {
    • public class getAddress1Response_element {
      • public AddressDirect.GetAddress1_response getAddress1Return;
    • }
    • public class GetAddress1_response {
      • public String address_city;
      • public String address_house_number;
      • public String address_postalcode;
      • public String address_street;
      • public String resultCode;
      • public String resultMessage;
    • }
    • public class getAddress1_element {
      • public String country_code;
      • public String house_number;
      • public String password;
      • public String postal_code;
      • public String profileid;
      • public String username;
    • }
    • public class AddressDirectServer2ServicePort {
      • public String clientCert_x;
      • public String clientCertPasswd_x;
      • public String endpoint_x;
      • public MAP:String,String inputHttpHeaders_x;
      • public MAP:String,String outputHttpHeaders_x;
      • public Integer timeout_x;
      • public AddressDirect.GetAddress1_response getAddress1(String, String, String, String, String, String){};
    • }
  • }

 

 

who can tell me if i must continue my quest to get this working ??? Or am i trying the impossible?

 

 

Message Edited by Please on 05-06-2009 06:35 AM

Hi,

 

I get the following error: Return type of global method must also be global: MSAddressDirect2.GetAddress1_response op regel 2 kolom 62

 

 

does anybody know what todo i tried a few things but can't get it right!? 

 

global class TestCallOut2 {
     webservice static MSAddressDirect2.getAddress1_response getAddress1(String username, string password, string profileid, string postalcode, string housenumber, string countrycode) {
        MSAddressDirect2.AddressDirectServer2ServicePort stub = new MSAddressDirect2.AddressDirectServer2ServicePort();
        MSAddressDirect2.getAddress1_response adresje = stub.getAddress1(username, password, profileid, postalcode, housenumber, countrycode);
        return adresje;
    }
}

 

 

Apexclass (generated via WSDL):

//Generated by wsdl2apex

public class MSAddressDirect2 {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://xxx.xx.xx.xx/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'MSAddressDirect2'};
        public MSAddressDirect2.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            MSAddressDirect2.getAddress1_element request_x = new MSAddressDirect2.getAddress1_element();
            MSAddressDirect2.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, MSAddressDirect2.getAddress1Response_element> response_map_x = new Map<String, MSAddressDirect2.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'MSAddressDirect2.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public MSAddressDirect2.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}