Announcement Announcement Module
Collapse
No announcement yet.
Issue with Message Exchange Patterns (MEP) in Dynamic WSDL Generation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with Message Exchange Patterns (MEP) in Dynamic WSDL Generation

    Hi, have found the spring-ws 1.50 DefaultWsdl11Definition generates WSDLs that will Not always successfully autogenerate a web service client (in SOAPUI tool for instance), since with SuffixBasedPortTypesProvider i find a strange MEP for a stock-standard Request/Response operation;
    ---
    <wsdlortType name="CreateFolder">
    <wsdl:operation name="repositoryStatus">
    <wsdl:output name="repositoryStatusResponse" message="tns:repositoryStatusResponse" />
    </wsdl:operation>
    <wsdl:operation name="createFolder">
    <wsdl:input name="createFolderRequest" message="tns:createFolderRequest" />
    </wsdl:operation>

    from createOperations() in AbstractPortTypesProvider
    ---
    rather than say (WS-I compliant) in my static wsdl

    <wsdlortType name="createFolderPortType">
    <wsdl:operation name="createFolder">
    <wsdl:input name="createFolderRequest" message="tns:createFolderMessage" />
    <wsdl:output name="createFolderResponse" message="tns:repositoryStatus" />
    </wsdl:operation>
    ---
    <!-- Dynamic WSDL generation -->
    <bean id="createFolder"
    class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl1Definition">
    <property name="serviceName" value="Create Folder" />
    <property name="schema">
    <bean class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="/WEB-INF/schema/createFolder.xsd" />
    </bean>
    </property>
    <property name="portTypeName" value="CreateFolder" />
    <property name="locationUri"
    value="http://${server}:${port}/${serviceContext}/createFolder" />
    <property name="targetNamespace"
    value="http://ab.cde.esb/repository" />
    </bean>
    ---
    Unusually there is no declarative configuration to save the day here in spring-ws 1.5.0, so as recommended, am writing own PortTypesProvider ...
    Curious if anybody else has found and resolved this ?

  • #2
    I am not sure I completely understand the issue here... Are you missing a createFolderRequest input in your operation?

    Comment


    • #3
      Hi Arjen, the issue here is essentially the form of the generated WSDLs requires change in order to successfully generate a web service client from standand tooling, here SOAPUI.
      Spring 2.5 dynamically generated WSDL (simple example):

      Code:
      <xs:element name="createFolderRequest">
      	<xs:complexType>
      		<xs:sequence>
      			<xs:element name="username" type="xs:string"/>
      			<xs:element name="password" type="xs:string"/>
      			<xs:element name="folderName" type="xs:string"/>
      			<xs:element name="parentFolderPath" type="xs:string"/>
      			</xs:sequence>
      		</xs:complexType>
      	</xs:element>
      	<xs:element name="repositoryStatusResponse">
      	   <xs:complexType>
      	     <xs:sequence>
      	     <xs:element name="statusCode" type="xs:string"/>
      	     <xs:element name="statusDescription" type="xs:string"/>
                        <xs:element name="objectIdentifier" minOccurs="0" type="xs:string"/>
      	    </xs:sequence>
      	</xs:complexType>
      	</xs:element>
      	</xs:schema>
      	</wsdl:types>
      	<wsdl:message name="repositoryStatusResponse">
      		<wsdl:part name="repositoryStatusResponse" element="tns:repositoryStatusResponse">
          </wsdl:part>
      	</wsdl:message>
      	<wsdl:message name="createFolderRequest">
      		<wsdl:part name="createFolderRequest" element="tns:createFolderRequest">
          </wsdl:part>
      	</wsdl:message>
      	<wsdl:portType name="CreateFolder">
      		<wsdl:operation name="repositoryStatus">
      			<wsdl:output name="repositoryStatusResponse" message="tns:repositoryStatusResponse">
          </wsdl:output>
      		</wsdl:operation>
      		<wsdl:operation name="createFolder">
      			<wsdl:input name="createFolderRequest" message="tns:createFolderRequest">
          </wsdl:input>
      		</wsdl:operation>
      	</wsdl:portType>
      	<wsdl:binding name="CreateFolderSoap11" type="tns:CreateFolder">
      		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      		<wsdl:operation name="repositoryStatus">
      			<soap:operation/>
      			<wsdl:output name="repositoryStatusResponse">
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      		<wsdl:operation name="createFolder">
      			<soap:operation/>
      			<wsdl:input name="createFolderRequest">
      				<soap:body use="literal"/>
      			</wsdl:input>
      		</wsdl:operation>
      Changes i made to this WSDL to be able to load and generate web service client from tooling (pls see operation definitions):

      Code:
      		<xs:element name="createFolderRequest">
      				<xs:complexType>
      					<xs:sequence>
      						<xs:element name="username" type="xs:string"/>
      						<xs:element name="password" type="xs:string"/>
      						<xs:element name="folderName" type="xs:string"/>
      						<xs:element name="parentFolderPath" type="xs:string"/>
      					</xs:sequence>
      				</xs:complexType>
      			</xs:element>
      			<xs:element name="repositoryStatusResponse">
      				<xs:complexType>
      					<xs:sequence>
      						<xs:element name="statusCode" type="xs:string"/>
      						<xs:element name="statusDescription" type="xs:string"/>
      						<xs:element name="objectIdentifier" minOccurs="0" type="xs:string"/>
      					</xs:sequence>
      				</xs:complexType>
      			</xs:element>
      		</xs:schema>
      	</wsdl:types>
      	<wsdl:message name="repositoryStatusResponse">
      		<wsdl:part name="repositoryStatusResponse" element="tns:repositoryStatusResponse">
          </wsdl:part>
      	</wsdl:message>
      	<wsdl:message name="createFolderRequest">
      		<wsdl:part name="createFolderRequest" element="tns:createFolderRequest">
          </wsdl:part>
      	</wsdl:message>
      	<wsdl:portType name="CreateFolder">
      		<wsdl:operation name="createFolder">
      			<wsdl:input name="createFolderRequest" message="tns:createFolderRequest"/>
      			<wsdl:output name="repositoryStatusResponse" message="tns:repositoryStatusResponse"/>
      		</wsdl:operation>
      	</wsdl:portType>
      	<wsdl:binding name="CreateFolderSoap11" type="tns:CreateFolder">
      		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      		<wsdl:operation name="createFolder">
      			<soap:operation/>
      			<wsdl:input name="createFolderRequest">
      				<soap:body use="literal"/>
      			</wsdl:input>
      			<wsdl:output name="repositoryStatusResponse">
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      	</wsdl:binding>
      only the later successfully loads, final point was think the former is not WS-I compliant (though understand this may be by design) ...
      Last edited by Arjen Poutsma; May 5th, 2008, 06:24 PM. Reason: Added code tags

      Comment


      • #4
        There is nothing wrong with that first WSDL: it describes a port type with two operations: repositoryStatus, which is a so-called notification operation. The second is createFolderRequest, which is a One-Way operation. Granted, the repositoryStatus is a bit hard to execute using HTTP, which is probably why SoapUI chocked on it, but it's perfectly valid.

        The DefaultWsdl11Definition uses suffix conventions to determine WSDL operations. It looks for messages ending with Request or Response, and generates operations based on the names of those message without the suffix.

        In other words, if you rename repositoryStatusResponse to createFolderResponse, all should work as planned.

        PS: I edited your post to add [code] tags, just to make it a bit easier on the eyes. You might want to use them yourself next time.

        Comment


        • #5
          schema element names drive MEP type through convention !

          Ahhhh so the naming convention of the schema element names encompasses control of the type of MEP (e.g. request/repsonse or one-way or notification etc). Here i was actually just after request/response. Changing the element names to this convention is ok in this particular situation and this does now generate Request/Response MEP and load into SOAPUI no probs ...
          In previous lives there has been an SOA Canonical Model (Common Data Model) to define and adhere to, where changing the name of the same xsd element for similar web services would be more problematic, but at some point there is always the Spring support for static wsdls to fall back on (say for 'handcrafted' wsdl's needed to support multiple operations in such scenarios etc).

          Code:
           <wsdl:message name="createFolderResponse">
            <wsdl:part name="createFolderResponse" element="tns:createFolderResponse" /> 
            </wsdl:message>
            <wsdl:message name="createFolderRequest">
            <wsdl:part name="createFolderRequest" element="tns:createFolderRequest" /> 
            </wsdl:message>
            <wsdl:portType name="CreateFolder">
           <wsdl:operation name="createFolder">
            <wsdl:input name="createFolderRequest" message="tns:createFolderRequest" /> 
            <wsdl:output name="createFolderResponse" message="tns:createFolderResponse" /> 
            </wsdl:operation>
            </wsdl:portType>
           <wsdl:binding name="CreateFolderSoap11" type="tns:CreateFolder">
          Thanks for your help & persistence Arjen !

          Comment

          Working...
          X