Hello,

I'm seeing some client-side serialisation errors when I try to access my
Axis 1.2 rpc/encoded service using a VB .NET client. This same combination
worked in Axis 1.1, but fails with Axis 1.2. I am using the Axis 1.2 beta
from June 14th - I plan to test with the July 15th release as well.

Attached is a complete trace of what I did and what the error is. I've shown
- the signature of the Java service
- the java2wsdl Ant task I used to generate the WSDL
- the wsdl2java Ant task I used to generate deploy.wsdd, which I deployed
- the VB .NET client
- the SOAP request generated by the .NET client
- the SOAP response when my service was deployed under Axis 1.1
- the SOAP response when my service was deployed under Axis 1.2

The only difference between the two scenarios (1.1 vs. 1.2) is that I
changed the Axis libraries (axis*.jar, commons*.jar, saaj.jar, wsdl4j.jar,
jaxrpc.jar) and re-ran the procedure right from compiling the service and
running java2wsdl and so on.

I realise that the attachment is somewhat long and intense, but I'd really
appreciate it if someone gave it a look and told me either what I was doing
wrong or what has changed between Axis 1.1 and 1.2 in this respect.

I plan to enter a bug regarding this issue shortly.

Thank you!

Anand Natrajan
<!-- Java signature of service -->

import com.abc.api.common.MyPrincipal;

public class MyAPIRpcEnc

{

    public String[] whoami(MyPrincipal principal)

        throws RemoteException

        {

                ...

        }

}



<!-- java2wsdl task -->

        <axis-java2wsdl

            classname="com.abc.ws.server.MyAPIRpcEnc"

            style="rpc"

            use="encoded"

            namespace="urn:${apiName}"

                        location="http://LOCAL_HOST:8080/axis/services/MyAPIRpcEnc";

                        output="${basedir}/${wsdl.build.dir}/MyAPIRpcEnc.wsdl">

            <classpath refid="classpath"/>

            <mapping package="com.abc.api.common"

                namespace="urn:MyAPICommon"/>

                </axis-java2wsdl>



<!-- wsdl2java task -->

        <axis-wsdl2java

            output="${outDir}"

            url="${basedir}/${wsdl.build.dir}/MyAPIRpcEnc.wsdl"

            serverside="true">

            <mapping namespace="urn:MyAPIRpcEnc"

                package="com.abc.ws.stubs"/>

            <mapping namespace="urn:MyAPICommon"

                package="com.abc.api.common"/>

        </axis-wsdl2java>

                <!-- Paste deploy.wsdd into server-config.wsdd -->





<!-- VB .NET client call -->

...

Private Sub actualTests()

        Dim principal As New MyAPIRpcEnc.MyPrincipal

        principal.name = "Administrator"

        principal.password = "Administrator"

        principal.authService = "DefaultAuthService"

        principal.authServiceType = "Grid"

        principal.domain = "mydomain.abc.com"

        Dim asdn As New MyAPIRpcEnc.MyAPIRpcEncService

        asdn.whoami(principal)

End Sub

...



<!-- VB .NET request -->

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope

        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";

        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";

        xmlns:tns="urn:MyAPIRpcEnc"

        xmlns:types="urn:MyAPIRpcEnc/encodedTypes"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

        xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

        <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>

                <tns:whoami>

                        <principal href="#id1" />

                </tns:whoami>

                <q1:MyPrincipal id="id1"

                        xsi:type="q1:MyPrincipal"

                        xmlns:q1="urn:MyAPICommon">

                        <authService 
xsi:type="xsd:string">DefaultAuthService</authService>

                        <authServiceType xsi:type="xsd:string">Grid</authServiceType>

                        <domain xsi:type="xsd:string">mydomain.abc.com</domain>

                        <name xsi:type="xsd:string">Administrator</name>

                        <password xsi:type="xsd:string">Administrator</password>

                </q1:MyPrincipal>

        </soap:Body>

</soap:Envelope>



<!-- Axis 1.1 response -->

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";

        xmlns:xsd="http://www.w3.org/2001/XMLSchema";

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

        <soapenv:Body>

                <ns1:whoamiResponse

                        
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";

                        xmlns:ns1="urn:MyAPIRpcEnc">

                        <whoamiReturn soapenc:arrayType="xsd:string[9]"

                                xsi:type="soapenc:Array"

                                
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                                <item>...</item>

                        </whoamiReturn>

                </ns1:whoamiResponse>

        </soapenv:Body>

</soapenv:Envelope>



<!-- Axis 1.2 response -->

<?xml version="1.0" encoding="utf-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";

        xmlns:xsd="http://www.w3.org/2001/XMLSchema";

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

        <soapenv:Body>

                <ns1:whoamiResponse

                        
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";

                        xmlns:ns1="urn:MyAPIRpcEnc">

                        <whoamiReturn soapenc:arrayType="soapenc:string[9]"

                                xsi:type="ns1:ArrayOf_xsd_string"

                                
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                                <item xsi:type="soapenc:string">...</item>

                        </whoamiReturn>

                </ns1:whoamiResponse>

        </soapenv:Body>

</soapenv:Envelope>



<!-- VB .NET error -->

Unhandled Exception: System.InvalidOperationException: There is an error in XML

document (1, 308). ---> System.InvalidOperationException: The specified type was

 not recognized: name='string', namespace='http://schemas.xmlsoap.org/soap/encoding/', 
at <whoamiReturn xmlns=''>.

   at 
System.Xml.Serialization.XmlSerializationReader.GetPrimitiveType(XmlQualifiedName 
typeName, Boolean throwOnUnknown)

   at System.Xml.Serialization.XmlSerializationReader.ReadArray(String typeName, 
String typeNs)

   at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String 
name, String ns, Boolean elementCanBeType, String& fixupReference)

   at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String 
name, String ns, String& fixupReference)

   at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read70_whoamiResponse()

   --- End of inner exception stack trace ---

   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String 
encodingStyle)

   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)

   at 
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage 
message, WebResponse response, Stream responseStream, Boolean asyncCall)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, 
Object[] parameters)

   at DotNetWSAPITest.MyAPIRpcEnc.MyAPIRpcEncService.whoami(MyPrincipal principal)

   at DotNetWSAPITest.DotNetWSAPITest.actualTests(MyPrincipal principal)

   at DotNetWSAPITest.DotNetWSAPITest.testMyWSAPI()

   at DotNetWSAPITest.DotNetWSAPITest.Main()

Reply via email to