Hi:
I am working on integrating the Sandesha2 module to Tuscany web service to
support conversational web service.
Currently, I met a problem with the wsdl parsing. As the spec said (sca
assembly model 100.pdf line 916), I should add a
sca:requires="conversational" to the port type to declare it as
conversational at the web service side. But the Tuscany always complain the
following exception.
/-------------------------------------------------
Caused by:
org.apache.tuscany.sca.contribution.service.ContributionReadException:
javax.wsdl.WSDLException: WSDLException (at
/wsdl:definitions/wsdl:portType): faultCode=NO_PREFIX_SPECIFIED: Unable to
determine namespace of 'conversational'.
at
org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver.loadDefinition(WSDLModelResolver.java:395)
at
org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver.loadOnDemand(WSDLModelResolver.java:330)
... 27 more
Caused by: javax.wsdl.WSDLException: WSDLException (at
/wsdl:definitions/wsdl:portType): faultCode=NO_PREFIX_SPECIFIED: Unable to
determine namespace of 'conversational'.
at com.ibm.wsdl.util.xml.DOMUtils.getQName(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseExtensibilityAttribute(Unknown
Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseExtensibilityAttributes(Unknown
Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at
org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver.loadDefinition(WSDLModelResolver.java:361)
... 28 more
--------------------------------------------------/
I did an quick investigation here. The exception is reported by WSDLReader
(in package wsdl4j-1.6.2.jar).
Any ideas on this problem? Do I mis-understand the spec or something wrong
here(I am guessing WSDLReader don't understand this kind of policy
extension). My test wsdl file is attached for your reference.
Thanks for your kindly help.
Yang Sun
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->
<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
name="helloworld">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getGreetings">
<complexType>
<sequence>
<element name="name" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getGreetingsResponse">
<complexType>
<sequence>
<element name="getGreetingsReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getGreetingsRequest">
<wsdl:part element="tns:getGreetings" name="parameters"/>
</wsdl:message>
<wsdl:message name="getGreetingsResponse">
<wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="HelloWorld" sca:requires="conversational">
<wsdl:operation name="getGreetings">
<wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
<wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getGreetings">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getGreetingsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getGreetingsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldService">
<wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
<wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>