1

Trying to implement a SOAP Webservice for a client and I need a wsdl file to test the service by soapUI. But as you can see below, this xsd has no Request and Response methods, all requests and responses are defined as a a "type" in a base ServiceProvider element. So when I try to auto generate my wsdl file by spring-ws it does not generate a proper wsdl, because Spring-ws requires all requests and responses element names should end with "Request" "Response".

What can I do?

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   elementFormDefault="qualified" 
      attributeFormDefault="unqualified" targetNamespace="http://myurl" xmlns="http://myurl">

 <xs:element name="ServiceProviderT" nillable="false">
    <xs:annotation>
        <xs:documentation>ServiceProviderT is the message spec for data sent between TechX and service providers or
            vendors</xs:documentation>
                </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="Version" type="xs:string" nillable="false"/>
                            <xs:choice>
                                <xs:element name="Request" type="RequestType" nillable="false"/>
                                <xs:element name="Response" type="ResponseType" nillable="false"/>
                                </xs:choice>
                                    </xs:sequence>
                                        </xs:complexType>
                                            </xs:element> 
                                                 ....

And this how I generate wsdl file

<sws:dynamic-wsdl id="myservice"
    portTypeName="MyService"
    locationUri="/myService"
    targetNamespace="http://myurl">
    <sws:xsd location="/schemas/my.xsd"/>
</sws:dynamic-wsdl>
Spring
  • 11,333
  • 29
  • 116
  • 185
  • 1
    I suggest a read of the docs... Specify the `requestSuffix` and `responseSuffix`, the defaults are indeed `Request` and `Response` but can be whatever you like... – M. Deinum Jun 03 '15 at 13:04

1 Answers1

2

There is no such requirement those are just the defaults. This is explained here in the Spring-WS reference guide. It also explains which properties to set to override those defaults.

The default request suffix is Request; the default response suffix is Response, though these can be changed by setting the requestSuffix and responseSuffix attributes on <dynamic-wsdl />, respectively.

<sws:dynamic-wsdl id="myservice"
    portTypeName="MyService"
    locationUri="/myService"
    requestSuffix="YourRequestSuffixHere"
    responseSuffix="YourResponseSuffixHere"
    targetNamespace="http://myurl">
    <sws:xsd location="/schemas/my.xsd"/>
</sws:dynamic-wsdl>
M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • I would be glad if you could also look at this: http://stackoverflow.com/questions/30666479/spring-ws-how-to-get-and-save-xsd-validation-errors – Spring Jun 08 '15 at 08:19