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
savvyboardersavvyboarder 

wsdl2apex converter

Hi all-

 

I'm trying to convert another WSDL and i'm getting the following error.  What is the supported type for a byte?

 

Error: Unsupported schema type: {http://www.w3.org/2001/XMLSchema}byte

aalbertaalbert

Byte is not a supported schema type. Here is the full list.

 

You could try to manually edit the WDSL to include a supported type - but it really depends on how that changes impacts your web service. 

 

If you ultimately can't use the WSDL2Apex functionality, you could use the HTTP, HTTPRequest, and HTTPResponse classes as an alternative. Those classes are documented here.

savvyboardersavvyboarder
Thanks aalbert.  I looked at the list and "xsd:short" says its supported, but I got the same error on the short.  I read that it's a bug, so you have to change it by hand to int. What would be the equivalent to byte in what's supported through apex ? 
aalbertaalbert

Well, a "short" gets converted into an Apex "int". So you can try "int" I guess....

But an "int" isn't necessarily a "byte" so it really depends on how that field is used and its possible values if this is a valid approach. 

savvyboardersavvyboarder
Ok. Well I think I'm giving up on the wsdl2apex converter. I change one thing and another error pops up.  Thanks for the help.
dgrigsbydgrigsby

savvyboarder,

 

I just went down this journey recently, and yes there are lots of "clean up" items.

 

I have done a large post on the subject. Please review and comment on as appropriate.

 

 
or
 

 

1. WSDL - I would highly suggest using a WSDL/XML tool like Atlova XMLSpy (free trial) to examine the Types that are imported. It will allow you to trim down, and integrate the imported (manually - wish they had a merge - going to post that feature request at Atlova) xsd types, etc. I normally work with Visual Studio or Eclipse and they just couldn't get there. It will show you what is in the namespace and what is imported in the WDSL tab visually by color coding.

 

      a. WSDL Apex Class creation Limitations

          -Size of final Apex Class - 100K characters
        -Size of WSDL input - 1Meg
          - No Imports and no implied types from defined named spaces if they contain definitions (xsd which ws-security does).
           -No Attributes (xsd which ws-security does).
           -No annotations (xsd which ws-security does).

           -No multipe bindings (which most do 1 and 12)

 

2. Be prepared to spend some time (read as parse, fix error, rise and repeat) many times

3. Best SF reference I found was Link:

4. In the end, you may find to get it working that the HTTP request and manual soap xml codeup to be the quickest solution to get it running, Twitter and Facebook integrations work this way. It was really faster in the end for me.

5. The post covers both WSDL2APEX and Direct Soap calls via HTTP Request and examples

 

Best Regards,

 

 

David W. Grigsby
Grigsby Consulting LLC
Intellectual Capital for Your Business
484 East Carmel Drive Suite 390
Carmel, IN 46032