• SherryA
  • NEWBIE
  • 0 Points
  • Member since 2008

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

Hello,

 

I am generating two  from a WSDL file, the code seems ok but when I create a message and send that message to the end point the "Lead" node does not have a namespace associated with it. If I get an instance of that WSDL using XML-spy I get a different xml instance, one that has the "Lead" node with the proper namespace and that one gets validated correctly.

Does anybody know why the message created from the APEX classes does not tag the "lead"node with a namespace? Do I need to alter a value from the class generated by APEX? Or Do I need to modify something in WSDL file before generating the classes?

 

Thanks,

Eduardo

 

Apex message send (fails):

<?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">
 <env:Header/>
 <env:Body>
  <ScoreLeadBiztalk xmlns="http://tempuri.org/">
   <Lead>
    <Id xmlns="http://ApexService.Lead">00Q3000000Tat8f</Id>
   </Lead>
  </ScoreLeadBiztalk>
 </env:Body>
</env:Envelope>

XML-Spy instance (works):

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://ApexService.Lead">
 <SOAP-ENV:Body>
  <m:ScoreLeadBiztalk xmlns:m="http://tempuri.org/">
   <m0:Lead>
    <m0:Id>123</m0:Id>
   </m0:Lead>
  </m:ScoreLeadBiztalk>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

WSDL file:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s1="http://ApexService.Lead" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
 <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">BizTalk assembly "ApexService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5962b974ab64847c" published web service.</wsdl:documentation>
 <wsdl:types>
  <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
   <s:import namespace="http://ApexService.Lead"/>
   <s:element name="ScoreLeadBiztalk">
    <s:complexType>
     <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" ref="s1:Lead"/>
     </s:sequence>
    </s:complexType>
   </s:element>
   <s:element name="ScoreLeadBiztalkResponse">
    <s:complexType>
     <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" ref="s1:Lead"/>
     </s:sequence>
    </s:complexType>
   </s:element>
  </s:schema>
  <s:schema elementFormDefault="qualified" targetNamespace="http://ApexService.Lead">
   <s:element name="Lead">
    <s:complexType>
     <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Id" type="s:string"/>
     </s:sequence>
    </s:complexType>
   </s:element>
  </s:schema>
 </wsdl:types>
 <wsdl:message name="ScoreLeadBiztalkSoapIn">
  <wsdl:part name="parameters" element="tns:ScoreLeadBiztalk"/>
 </wsdl:message>
 <wsdl:message name="ScoreLeadBiztalkSoapOut">
  <wsdl:part name="parameters" element="tns:ScoreLeadBiztalkResponse"/>
 </wsdl:message>
 <wsdl:portType name="WebService_ApexServiceSoap">
  <wsdl:operation name="ScoreLeadBiztalk">
   <wsdl:input message="tns:ScoreLeadBiztalkSoapIn"/>
   <wsdl:output message="tns:ScoreLeadBiztalkSoapOut"/>
  </wsdl:operation>
 </wsdl:portType>
 <wsdl:binding name="WebService_ApexServiceSoap" type="tns:WebService_ApexServiceSoap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="ScoreLeadBiztalk">
   <soap:operation soapAction="http://tempuri.org/WebService_ApexService/ScoreLeadBiztalk" 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="WebService_ApexService">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">BizTalk assembly "ApexService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5962b974ab64847c" published web service.</wsdl:documentation>
  <wsdl:port name="WebService_ApexServiceSoap" binding="tns:WebService_ApexServiceSoap">
   <soap:address location="/ApexService/WebService_ApexService.asmx"/>
  </wsdl:port>
 </wsdl:service>
</wsdl:definitions>

 

Two APEX classes :

 

//Generated by wsdl2apex

public class apexWrapper {
    public class WebService_ApexServiceSoap {
        public String endpoint_x = '/ApexService/WebService_ApexService.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://ApexService.Lead', 'apexLead', 'http://tempuri.org/', 'apexWrapper'};
        public apexLead.Lead_element ScoreLeadBiztalk(apexLead.Lead_element Lead) {
            apexWrapper.ScoreLeadBiztalk_element request_x = new apexWrapper.ScoreLeadBiztalk_element();
            apexWrapper.ScoreLeadBiztalkResponse_element response_x;
            request_x.Lead = Lead;
            Map<String, apexWrapper.ScoreLeadBiztalkResponse_element> response_map_x = new Map<String, apexWrapper.ScoreLeadBiztalkResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/WebService_ApexService/ScoreLeadBiztalk',
              'http://tempuri.org/',
              'ScoreLeadBiztalk',
              'http://tempuri.org/',
              'ScoreLeadBiztalkResponse',
              'apexWrapper.ScoreLeadBiztalkResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.Lead;
        }
    }
    public class ScoreLeadBiztalk_element {
        public apexLead.Lead_element Lead;
        private String[] Lead_type_info = new String[]{'Lead','http://ApexService.Lead','Lead_element','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'Lead'};
    }
    public class ScoreLeadBiztalkResponse_element {
        public apexLead.Lead_element Lead;
        private String[] Lead_type_info = new String[]{'Lead','http://ApexService.Lead','Lead_element','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'Lead'};
    }
}

 

//Generated by wsdl2apex

public class apexLead {
    public class Lead_element {
        public String Id;
        private String[] Id_type_info = new String[]{'Id','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ApexService.Lead','true','false'};
        private String[] field_order_type_info = new String[]{'Id'};
    }
}

I use the apex explorer all the time.  Unfortunately, someone here installed the echosign product and now whenever I try to expand leads and contacts via the apex explorer, I get the following message:
 
Unexpected error: Item has already been added.  Key in dictionary: 'echosign_dev1__agreements__r' Key being added: 'echosign_dev1__agreements__r'
 
any thoughts on what might be causing this?
I have inherited code that calls the API to create a task on a lead.  This code has been working in production and has not changed.  But, on occasion, it seems to give me an integrity constraint in error that looks something like...
 

field integrity exception: WhoId, WhatId (cannot specify whatID with lead whoID)

I am creating a task on a lead (referenced in the whoId), and the whatId is not populated (its null).

The confusion I'm having is when I call SFDC Tech Support, they seem to have no idea what I'm talking about when I say I'm calling the API.  Any ideas why that is?  Or...even better...has anyone seen this kind of sporadic behavior?

Thanks for any thoughts.

 

 

I'm maintaining some existing code that uses the API to make query calls to the db.  (My background is a web developer using standard SQL).  I have a query that I need to modify that uses a field that is a datatype of 'Picklist'.  I need to get only rows where value in the picklist field starts with a certain value (perfect scenario for a 'like').  I don't want to hardcode a list of 6 values, plus I don't want to be tied to what my users might change later.  It looks like I can't use a 'like' on this type of field?  Can I get to id's of the picklist so I can use that so I don't hard-code values that my user could change?  (I'm guessing I should just give it up and hard-code a list...but it looks like I can't use an 'in' either...correct?)
 
Thanks for any thoughts.
I use the apex explorer all the time.  Unfortunately, someone here installed the echosign product and now whenever I try to expand leads and contacts via the apex explorer, I get the following message:
 
Unexpected error: Item has already been added.  Key in dictionary: 'echosign_dev1__agreements__r' Key being added: 'echosign_dev1__agreements__r'
 
any thoughts on what might be causing this?
I have inherited code that calls the API to create a task on a lead.  This code has been working in production and has not changed.  But, on occasion, it seems to give me an integrity constraint in error that looks something like...
 

field integrity exception: WhoId, WhatId (cannot specify whatID with lead whoID)

I am creating a task on a lead (referenced in the whoId), and the whatId is not populated (its null).

The confusion I'm having is when I call SFDC Tech Support, they seem to have no idea what I'm talking about when I say I'm calling the API.  Any ideas why that is?  Or...even better...has anyone seen this kind of sporadic behavior?

Thanks for any thoughts.