users@jax-ws.java.net

error: uniqueness constraint violation

From: Michael Kaegi <kam_at_brainware.ch>
Date: Wed, 5 Apr 2006 13:01:56 +0200

Hi All

I just start to play with JWSDP 2.0 (JAX-WS)

I need help by following problem:

I try to generate the "server" from wsdl...


build.xml:

    <wsimport
        debug="true"
        keep="true"
        destdir="build/classes"
        wsdl="asap.wsdl">
    </wsimport>


asap.wsdl:

    <?xml version="1.0"?>
    <definitions name="ASAP"
         targetNamespace="http://docs.oasis-open.org/asap/0.9/definitions"
         xmlns:asdl="http://docs.oasis-open.org/asap/0.9/definitions"
         xmlns:asap="http://www.oasis-open.org/asap/0.9/schemas"
         xmlns="http://schemas.xmlsoap.org/wsdl/"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
        <import namespace="http://www.oasis-open.org/asap/0.9/schemas"
location="asap2.wsdl"/>
 
        <!-- Messages =========== -->
 
        <message name="createInstanceRequest">
          <part name="head" element="asap:Request"/>
          <part name="body" element="asap:CreateInstanceRq"/>
        </message>
 
        <message name="createInstanceResponse">
          <part name="head" element="asap:Response"/>
          <part name="body" element="asap:CreateInstanceRs"/>
        </message>
 
        <!-- Port types ============== -->
 
        <portType name="FactoryPortType">
          <operation name="CreateInstance">
            <input message="asdl:createInstanceRequest"/>
            <output message="asdl:createInstanceResponse"/>
          </operation>
        </portType>
 
        <!-- Bindings ============== -->
 
        <binding name="AsapFactoryBinding" type="asdl:FactoryPortType">
           <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
           <operation name="CreateInstance">
              <soap:operation
 
soapAction="http://www.oasis-open.org/asap/0.9/asap/factory/CreateInstance"/>
              <input message="asdl:createInstanceRequest">
                 <soap:header message="asdl:createInstanceRequest"
part="head" use="literal"/>
                 <soap:body parts="body" use="literal"/>
              </input>
              <output message="asdl:createInstanceResponse">
                 <soap:header message="asdl:createInstanceResponse"
part="head" use="literal"/>
                 <soap:body parts="body" use="literal"/>
              </output>
           </operation>
        </binding>
 
        <!-- Services ============== -->
 
        <service name="ASAPFactoryService">
            <port name="ASAPFactoryPort"
binding="asdl:AsapFactoryBinding">
                <soap:address location="REPLACE_WITH_ACTUAL_URL" />
            </port>
        </service>
 
    </definitions>


asap2.wsdl:

    <definitions name="ASAP2" xmlns="http://schemas.xmlsoap.org/wsdl/">
        <types>
            <schema
targetNamespace="http://www.oasis-open.org/asap/0.9/schemas"
xmlns="http://www.w3.org/2001/XMLSchema">
 
                <!-- headers ============ -->
 
                <element name="Request">
                        <complexType>
                                <sequence>
                                        <element name="SenderKey"
type="string" minOccurs="1" />
                                </sequence>
                        </complexType>
                </element>
 
                <element name="Response">
                        <complexType>
                                <sequence>
                                        <element name="SenderKey"
type="string" minOccurs="1" />
                                </sequence>
                        </complexType>
                </element>
 
                <!-- messages =================== -->
 
                <element name="CreateInstanceRq">
                        <complexType>
                                <sequence>
                                        <element name="Subject"
type="string" minOccurs="1" />
                                </sequence>
                        </complexType>
                </element>
 
                <element name="CreateInstanceRs">
                        <complexType>
                                <sequence>
                                        <element name="InstanceKey"
type="string" minOccurs="1" />
                                </sequence>
                        </complexType>
                </element>
 
            </schema>
        </types>
    </definitions>
 

Unfortunately I get the following error: "uniqueness constraint violation"

I try to isolate the problem and found out that if I uncomment following
two lines...

asap.wsdl (modified):

    <?xml version="1.0"?>
    <definitions name="ASAP"
 targetNamespace="http://docs.oasis-open.org/asap/0.9/definitions"
 xmlns:asdl="http://docs.oasis-open.org/asap/0.9/definitions"
 xmlns:asap="http://www.oasis-open.org/asap/0.9/schemas"
                     xmlns="http://schemas.xmlsoap.org/wsdl/"
                     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
        <import namespace="http://www.oasis-open.org/asap/0.9/schemas"
location="asap2.wsdl"/>
 
        <!-- Messages =========== -->
 
        <message name="createInstanceRequest">
          <part name="head" element="asap:Request"/>
          <part name="body" element="asap:CreateInstanceRq"/>
        </message>
 
        <message name="createInstanceResponse">
<!--<part name="head" element="asap:Response"/>-->
          <part name="body" element="asap:CreateInstanceRs"/>
        </message>
 
        <!-- Port types ============== -->
 
        <portType name="FactoryPortType">
          <operation name="CreateInstance">
            <input message="asdl:createInstanceRequest"/>
            <output message="asdl:createInstanceResponse"/>
          </operation>
        </portType>
 
        <!-- Bindings ============== -->
 
        <binding name="AsapFactoryBinding" type="asdl:FactoryPortType">
           <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
           <operation name="CreateInstance">
              <soap:operation
 
soapAction="http://www.oasis-open.org/asap/0.9/asap/factory/CreateInstance"/>
              <input message="asdl:createInstanceRequest">
                 <soap:header message="asdl:createInstanceRequest"
part="head" use="literal"/>
                 <soap:body parts="body" use="literal"/>
              </input>
              <output message="asdl:createInstanceResponse">
<!--<soap:header message="asdl:createInstanceResponse" part="head"
use="literal"/>-->
                 <soap:body parts="body" use="literal"/>
              </output>
           </operation>
        </binding>
 
        <!-- Services ============== -->
 
        <service name="ASAPFactoryService">
            <port name="ASAPFactoryPort"
binding="asdl:AsapFactoryBinding">
                <soap:address location="REPLACE_WITH_ACTUAL_URL" />
            </port>
        </service>
 
    </definitions>


... It generates the server without an error. But I assume the server
isn't complete.

I have no idea how to solve this. Any help would be greate.


Thanks



Michael Kaegi

 
Tel: +41 41 748 22 00, Fax: +41 41 748 22 01, kam_at_brainware.ch
Brainware Solutions AG, Sumpfstrasse 15, CH-6300 Zug, www.brainware.ch
 




picture
(image/gif attachment: 01-part)

picture
(image/gif attachment: 02-part)