You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Donnie Hale (JIRA)" <ax...@ws.apache.org> on 2005/01/05 00:28:16 UTC

[jira] Created: (AXIS-1751) WSDL generated for "wrapped" style invalid, breaking .NET's wsdl.exe

WSDL generated for "wrapped" style invalid, breaking .NET's wsdl.exe
--------------------------------------------------------------------

         Key: AXIS-1751
         URL: http://issues.apache.org/jira/browse/AXIS-1751
     Project: Axis
        Type: Bug
    Versions: 1.2RC2    
 Environment: Axis 1.2RC2 under Jetty via JDK 1.5.
    Reporter: Donnie Hale


I posted this issue on axis-user and got a couple of responses that it is a bug in Axis. I didn't find an existing issue - my apologies if this is a dupe.

Using 1.2RC2, I have a service deployed with style="wrapped". When I use .NET's wsdl.exe to try to generate client proxies, I get the following output:

Schema validation warning: Invalid 'name' attribute value: The ':' character, hexadecimal value 0x3A, cannot be included in a name..
Schema validation warning: Invalid 'name' attribute value: The ':' character, hexadecimal value 0x3A, cannot be included in a name..

Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.

Error: Unable to import binding 'prototypeSoapBinding' from namespace ...
  - Unable to import operation 'startTransaction'.
  - Schema with targetNamespace='http://proto.wsapp.phileosoftware.com' has invalid syntax.
  - Invalid 'name' attribute value: The ':' character, hexadecimal value 0x3A, cannot be included in a name..

In the wsdl:types element (see end of message), notice the 2 elements of the form: <element name="tns1:in0" type="xsd:string"/>. WSDL.exe doesn't like those prefixes, and I believe they in fact invalid for an <element> name attribute. If I hand-edit the WSDL, taking out the 2 appearances of the "tns1:" prefixes from those elements, then wsdl.exe doesn't complain and generates the proxies.

The interface which the web service implements is:

public interface IWSSQLService
{
    public String startTransaction(String dbID);
    public byte[] getFile(String filename) throws java.io.IOException;
}

The deployment file is:

<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    <service name="prototype" style="wrapped" use="literal" provider="Handler">
        <parameter name="handlerClass" value="com.phileosoftware.wsapp.infra.ProxyProvider"/>
        <parameter name="className" value="com.phileosoftware.wsapp.proto.IWSSQLService"/>
        <parameter name="allowedMethods" value="*"/>
        <parameter name="scope" value="Application"/>
    </service>
</deployment>

Note that my handler class just extends RPCProvider, overriding only the makeNewServiceObject method to return an object that implements the above interface. I don't do any WSDL-generation handling - just implement the 2 methods in that interface.

Here's the WSDL Axis returns for a "?wsdl" URL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
    targetnamespace="http://localhost:8088/myapp/services/prototype"
    xmlns:apachesoap="http://xml.apache.org/xml-soap"
    xmlns:impl="http://localhost:8088/myapp/services/prototype"
    xmlns:intf="http://localhost:8088/myapp/services/prototype"
    xmlns:tns1="http://proto.wsapp.phileosoftware.com"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by Apache Axis version: 1.2RC2
    Built on Nov 16, 2004 (12:19:44 EST)-->
    <wsdl:types>
        <schema elementformdefault="qualified"
            targetnamespace="http://proto.wsapp.phileosoftware.com"
            xmlns="http://www.w3.org/2001/XMLSchema">
            <element name="startTransaction">
                <complextype>
                    <sequence>
                        <element name="tns1:in0" type="xsd:string"/>
                    </sequence>
                </complextype>
            </element>
            <element name="startTransactionResponse">
                <complextype>
                    <sequence>
                        <element name="startTransactionReturn" type="xsd:string"/>
                    </sequence>
                </complextype>
            </element>
            <element name="getFile">
                <complextype>
                    <sequence>
                        <element name="tns1:in0" type="xsd:string"/>
                    </sequence>
                </complextype>
            </element>
            <element name="getFileResponse">
                <complextype>
                    <sequence>
                        <element name="getFileReturn" type="xsd:base64Binary"/>
                    </sequence>
                </complextype>
            </element>
        </schema>
    </wsdl:types>

    <wsdl:message name="startTransactionRequest">
        <wsdl:part element="tns1:startTransaction" name="parameters"/>
    </wsdl:message>

    <wsdl:message name="startTransactionResponse">
        <wsdl:part element="tns1:startTransactionResponse" name="parameters"/>
    </wsdl:message>

    <wsdl:message name="getFileRequest">
        <wsdl:part element="tns1:getFile" name="parameters"/>
    </wsdl:message>

    <wsdl:message name="getFileResponse">
        <wsdl:part element="tns1:getFileResponse" name="parameters"/>
    </wsdl:message>

    <wsdl:porttype name="IWSSQLService">
        <wsdl:operation name="startTransaction">
            <wsdl:input message="impl:startTransactionRequest" name="startTransactionRequest"/>
            <wsdl:output message="impl:startTransactionResponse" name="startTransactionResponse"/>
        </wsdl:operation>
        <wsdl:operation name="getFile">
            <wsdl:input message="impl:getFileRequest" name="getFileRequest"/>
            <wsdl:output message="impl:getFileResponse" name="getFileResponse"/>
        </wsdl:operation>
    </wsdl:porttype>

    <wsdl:binding name="prototypeSoapBinding" type="impl:IWSSQLService">
        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="startTransaction">
            <wsdlsoap:operation soapaction=""/>
            <wsdl:input name="startTransactionRequest">
                <wsdlsoap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="startTransactionResponse">
                <wsdlsoap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getFile">
            <wsdlsoap:operation soapaction=""/>
            <wsdl:input name="getFileRequest">
                <wsdlsoap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="getFileResponse">
                <wsdlsoap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

    <wsdl:service name="IWSSQLServiceService">
        <wsdl:port binding="impl:prototypeSoapBinding" name="prototype">
            <wsdlsoap:address location="http://localhost:8088/myapp/services/prototype"/>
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Question on TypeMappingImpl of axis client on a multi-threaded env

Posted by Shantanu Sen <ss...@pacbell.net>.
We have a set of generated stubs talking to multiple web services. Our env is multithreaded and we are running on a multi cpu system. When a call comes in to each of our client (axis client stub) we are configuring the client so that each client uses a custom EngineConfiguration (basically a subclass of org.apache.axis.AxisEngine.SimpleProvider) which uses a custom transport handler to push the call to the service.

We were using a static class for the EngineConfiguration implementation. This worked fine on a multi-threaded env on a single CPU system, but on a multi cpu system we faced the following error.

At random, the types registered in the TypemappingRegistry would lose the mapping of a XML to Java type. This would typically occur when the client is trying to find a deserializer to deserialize a response. 

We are attributing it to the fact that TypeMappingImpl stores the mappings in HashMaps (qName2Pair, class2Pair etc), and hashmap is not thread safe. So it seems that TypeMappingImpl is designed to be used in a thread safe env which has to be ensured by the client.

Any pointers on this? Does the AXIS architecture warrant that when each thread instantiates a client, a new instance of EngineConfiguration is required so that the type mapping registry is thread safe? 

Thanks,

Shantanu Sen