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
kkr.devkkr.dev 

Error: Failed to parse wsdl: attribute name can not be null

Hi,

 

   I am getting "Error: Failed to parse wsdl: attribute name can not be null at 484:53"  when i am trying to parse wsdl using Wsdl2Apex.The line where it seems to complain is in bold in the snippit below.

 

<s:complexType name="AssessmentResult">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ClientId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="1" name="ProviderId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="1" name="ClientOrderId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="1" name="ReceiptId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="unbounded" name="Results" type="s1:Results"/>
          <s:element minOccurs="0" maxOccurs="1" name="AssessmentStatus" type="s1:AssessmentStatus"/>
          <s:element minOccurs="0" maxOccurs="1" name="UserArea" type="s1:UserArea"/>
        </s:sequence>
        <s:attribute ref="xml:lang" use="optional"/>
        <s:attribute name="validFrom" type="s:string"/>
        <s:attribute name="validTo" type="s:string"/>
      </s:complexType>

 

 

Any Idea?

 

Thanks

OyeCodeOyeCode

As this seems parse error mean you are missing some tag or attribute properties

 

Clearly the error says

 

: attribute name can not be null at 484:53"

 so here you have to add attribute 'name'

 

Henceforth, something like this should work 

 

<s:attribute ref="xml:lang" name="salesforce"  use="optional"/>    (add name Attribute) 

 

<s:attribute ref="xml:lang" name="salesforce"  use="optional"/>   

 

kkr.devkkr.dev

Thanks ForceLabs, I fixed the error by giving name and type of the attribute.But now i am getting another Error   "Error: Failed to parse wsdl: Found more than one wsdl:portType. WSDL with multiple portType not supported ". Any Idea?

 

Thanks

OyeCodeOyeCode

It would be great help, if you can paste here the exact xml you are trying to implement

OyeCodeOyeCode

But before you jump, I recommend you to read this to find the exact idea behind the xml and its attributes. This will be good refrence to keep on your right page.

 

 

http://www.w3.org/TR/wsdl

 

 

Please tag, reply as 'solution' if anyone of solution worked for you - this will help other to find.  Your action would highly be appreciated.

 

 

Raghu_devRaghu_dev

I had similar problem few months back when I was trying to import wsdl from a .net application and ended up doing the following - 

 

1. Wrote a java webservice wrapper on top of our .net webservice using Axis 1.0. This will eliminate the hassles around importing multiple port wsdls. Also, the other workaround to avoid this error is remove the additional port from xml editor tools like Altova (if you are xml expert you can use regular text pad to remove ports)

 

2. Though I could pretty much use the above workaround for all my other webservices, we thought its too cumbersome and took the following approach for the rest of the webservices.

 

Used http class and posted outbound messages to the endpoint. here is the quick example. You can find tons of information on salesforce.com wiki.

public HttpRequest req= new HttpRequest(); 
req.setMethod('POST'); 
req.setHeader('content-type', 'text/xml; charset=utf-8');  
req.setHeader('SOAPAction', endPoint); 
req.setTimeout(60000);
req.setBody(request.replace('&', '&amp;') );
HttpResponse resObj = new HttpResponse();
resObj = http.send(req); 

 

kkr.devkkr.dev

Thanks Raghu.

 

ForceLabs,

 

         Here is the link to wsdl .http://integration.services.7-5.identifythebest.com/service.asmx?wsdl