0

I am attempting to use IBM cast iron with the softlayer SOAP services. out of the gate, i get a validation error with the softlayer wsdl that is downloadable here. the validation fails in oxygen v18 as well. in both cases, the error occurs on this include spec in the wsdl:

<xsd:schema targetNamespace="http://api.service.softlayer.com/soap/v3/">
  <xsd:include namespace="http://api.service.softlayer.com/soap/v3/"
    schemaLocation="https://api.softlayer.com/soap/v3/SoftLayer_Account?xsd"/>
</xsd:schema>

and this is the error.

cvc-complex-type.3.2.2: Attribute 'namespace' is not allowed to appear in element 'xsd:include'.

ok, namespace is not a valid attribute for the include spec. hard to believe that softlayer's wsdl used by the whole world uses successfully (except for me) is not valid. i remove the namespace attribute and then i see that the type definition cannot be resolved on the element spec reference to tns:SoftLayer_Account.

<xsd:schema targetNamespace="http://api.service.softlayer.com/soap/v3/">
  <xsd:complexType name="SoftLayer_AccountObjectMask">
    <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1" name="mask" type="tns:SoftLayer_Account"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

and a whole slew of errors like this in the context of the wsdl operation specs.

The namespace for the SOAP header is not specified. When the use is encoded a namespace URI must be defined.

here is one of the operations where the error occurs.

<operation name="addReferralPartnerPaymentOption">
  <soap:operation soapAction="http://api.service.softlayer.com/soap/v3/SoftLayer_AccountAction"/>
  <input>
    <soap:header message="tns:authenticateHeader" part="authenticate" use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
...

For context, here are the beginning lines of the wsdl.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://api.service.softlayer.com/soap/v3/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="slApi"
  targetNamespace="http://api.service.softlayer.com/soap/v3/">
  <types>
    <xsd:schema targetNamespace="http://api.service.softlayer.com/soap/v3/">
      <xsd:include namespace="http://api.service.softlayer.com/soap/v3/"
        schemaLocation="https://api.softlayer.com/soap/v3/SoftLayer_Account?xsd"/>
    </xsd:schema>
    <xsd:schema targetNamespace="http://api.service.softlayer.com/soap/v3/">
      <xsd:complexType name="SoftLayer_AccountObjectMask">
        <xsd:sequence>
          <xsd:element minOccurs="1" maxOccurs="1" name="mask" type="tns:SoftLayer_Account"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>
  </types>
  <message name="activatePartner">
    <part name="accountId" type="xsd:string"/>
    <part name="hashCode" type="xsd:string"/>
  </message>
...

And the head of the included schema, SoftLayer_Account.xsd.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://api.service.softlayer.com/soap/v3/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="slApi"
  targetNamespace="http://api.service.softlayer.com/soap/v3/">
  <types>
    <xsd:schema targetNamespace="http://api.service.softlayer.com/soap/v3/">
      <xsd:include namespace="http://api.service.softlayer.com/soap/v3/"
        schemaLocation="https://api.softlayer.com/soap/v3/SoftLayer_Account?xsd"/>
    </xsd:schema>
    <xsd:schema targetNamespace="http://api.service.softlayer.com/soap/v3/">
      <xsd:complexType name="SoftLayer_AccountObjectMask">
        <xsd:sequence>
          <xsd:element minOccurs="1" maxOccurs="1" name="mask" type="tns:SoftLayer_Account"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>
  </types>
  <message name="activatePartner">
    <part name="accountId" type="xsd:string"/>
    <part name="hashCode" type="xsd:string"/>
  </message>
...

I was expecting a well-formed WSDL from softlayer, and it probably is. it's just that I am an idiot on the topic of wsdl and xml, so any help out there is appreciated!

Thanks, Parke

Blaarfengard
  • 17
  • 1
  • 3

2 Answers2

0

this is strange, the softlayer WSDL works fine with tools such as SOAP UI or WSDL.exe from Visual Studio. You cannot remove the XSD reference from the WSDL otherwise you will come across issues like you decribed in your post.

You can try change the tag by and see if that works, take a look at this post XSD with elements from other namespace

Anyway, I think the issue you are facing is due to the tools you are using and not due to a wrong WSLD from softlayer.

Community
  • 1
  • 1
  • to be clear, i only removed the namespace attribute so the include looked like this. and the error goes away on just that line when i do that. but then i get the failure to resolve the type definitions. Could it be that the latest specification for xsd:include do not allow for the namespace attribute with an include because that namespace is implicit? i.e., include implies the same namespace as opposed to import. – Blaarfengard Jun 29 '16 at 14:39
  • The other interesting thing about this is that when i use code-assist, oxygen shows tns:SoftLayer_Account as a defined type. Again, oxygen and cast iron both fail to validate for the same reasons. i will try other methods like SOAPUI, but i suspect that both oxygen and cast iron use the same xml support jars which are very recent. at any rate, i can't make cast iron work unless i can recode the wsdl and/or xsds. I'll keep hacking, and i'll take any suggestions! – Blaarfengard Jun 29 '16 at 14:40
  • I gave up on trying to use the SOAP API. I hacked at that wsdl for quite a while and came to the conclusion that whomever is using softlayer SOAP services are using programs or tools that don't care that the WSDL fails to validate. You can't tell Cast Iron not to validate a wsdl, so the out-of-the-box WSDL is a non-starter with that tool. I am using REST with Cast Iron, successfully, so that's a work-around, at least. I am not sure that this should be an answer rather than a comment? – Blaarfengard Jul 13 '16 at 15:36
  • I think better to add an answer, that could help other people who are working with Cast Iron – Nelson Raul Cabero Mendoza Jul 13 '16 at 15:47
0

Well it's not much of an answer but at least it's a workaround. My solution is to use the REST APIs for dealing with the softlayer services using cast iron as opposed to SOAP.

Blaarfengard
  • 17
  • 1
  • 3