Hi,
I'm trying to get an Axis2/Java server to interoperate with a gSoap
client.
It works for built-in types (both primitive and derived), but I'm
getting Unsupported Type errors when I try to use arrays.
The schema is based on Microsoft's echo server on
http://mssoapinterop.org/stk/Interop.wsdl. I believe that the import
directives are required for wsdl2java to know about arrays.
The gsoap client works against Microsoft's server, so it seems likely
that there is an error in the schema that Microsoft is tolerant of,
but Axis2 isn't.
According to
http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc10.11.4
gSoap is sending the array in the correct format,
but my reading of ExtensionMapper.java implies that
<inputStringArray xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[6]">
should be
<inputStringArray xsi:type="SOAP-ENC:ArrayOfstring"
SOAP-ENC:arrayType="xsd:string[6]">
Is the wsdl2Java diagnostic message
"[WARN] Could not find any schema type associated with the
Element'{http://schemas.xmlsoap.org/soap/encoding/}anyType'"
relevant?
Could anyone give me a few pointers to what I've done wrong?
I've appended all relevant files and logs; apologies for the length
of this post.
TIA,
Colin S. Miller
*** Schema ***
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="InteropDerived"
targetNamespace="http://tempuri.org/wsdl/"
xmlns:wsdlns="http://tempuri.org/wsdl/"
xmlns:typens="http://soapinterop.org/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-extension"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"
location="http://schemas.xmlsoap.org/soap/encoding/"/>
<types>
<schema targetNamespace="http://soapinterop.org/xsd"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
elementFormDefault="qualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="ArrayOfstring">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="string[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</types>
<message name="Server.echoStringArray">
<part name="inputStringArray" type="typens:ArrayOfstring"/>
</message>
<message name="Server.echoStringArrayResponse">
<part name="Result" type="typens:ArrayOfstring"/>
</message>
<portType name="SoapPort">
<operation name="echoStringArray" parameterOrder="inputStringArray">
<input message="wsdlns:Server.echoStringArray"/>
<output message="wsdlns:Server.echoStringArrayResponse"/>
</operation>
</portType>
<binding name="SoapBinding" type="wsdlns:SoapPort">
<stk:binding preferredEncoding="UTF-8"/>
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoStringArray">
<soap:operation soapAction="urn:soapinterop"/>
<input>
<soap:body use="encoded" namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="InteropDerived">
<port name="SoapPort" binding="wsdlns:SoapBinding">
<soap:address
location="http://cmiller-linux.picsel.com:8080/axis2/services/InteropDerived"
/>
</port>
</service>
</definitions>
*** InteropDerivedSkeleton.java ***
/**
* InteropDerivedSkeleton.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: 1.4.1 Built on : Aug 13, 2008 (05:03:35
LKT)
*/
package internalechoadb;
/**
* InteropDerivedSkeleton java skeleton for the axisService
*/
public class InteropDerivedSkeleton implements
InteropDerivedSkeletonInterface{
/**
* Auto generated method signature
*
* @param echoStringArray
*/
public org.soapinterop.EchoStringArrayResponse
echoStringArray(org.soapinterop.EchoStringArray echoStringArray)
{
org.soapinterop.EchoStringArrayResponse ret;
ret = new org.soapinterop.EchoStringArrayResponse();
ret.setResult(echoStringArray.getInputStringArray());
return ret;
}
}
*** ExtensionMapper.java ***
/**
* ExtensionMapper.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: 1.4.1 Built on : Aug 13, 2008 (05:03:41
LKT)
*/
package org.soapinterop.xsd;
/**
* ExtensionMapper class
*/
public class ExtensionMapper{
public static java.lang.Object getTypeObject(java.lang.String
namespaceURI,
java.lang.String
typeName,
javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
if (
"http://soapinterop.org/xsd".equals(namespaceURI) &&
"ArrayOfstring".equals(typeName)){
return
org.soapinterop.xsd.ArrayOfstring.Factory.parse(reader);
}
throw new org.apache.axis2.databinding.ADBException("Unsupported
type " + namespaceURI + " " + typeName);
}
}
*** Building ***
[cmiller-linux] echo-array 536$
/local/home/cmiller/work/axis2/axis2-1.4.1/bin/wsdl2java.sh -uri
/local/home/cmiller/work/echo-array/interop.wsdl -p internalechoadb -d
adb -s -ss -sd -ssi -o /local/home/cmiller/work/echo-array/
Using AXIS2_HOME: /local/home/cmiller/work/axis2/axis2-1.4.1
Using JAVA_HOME: /usr/lib/jvm/java-6-sun
Retrieving document at '/local/home/cmiller/work/echo-array/interop.wsdl'.
Retrieving schema wsdl:imported from
'http://schemas.xmlsoap.org/soap/encoding/', relative to
'file:/local/home/cmiller/work/echo-array/interop.wsdl'.
Retrieving document at '/local/home/cmiller/work/echo-array/interop.wsdl'.
Retrieving schema wsdl:imported from
'http://schemas.xmlsoap.org/soap/encoding/', relative to
'file:/local/home/cmiller/work/echo-array/interop.wsdl'.
[WARN] Could not find any schema type associated with the Element
'{http://schemas.xmlsoap.org/soap/encoding/}anyType'
[cmiller-linux] echo-array 537$
[cmiller-linux] echo-array 537$ ant
Buildfile: build.xml
init:
[mkdir] Created dir: /local/home/cmiller/work/echo-array/build
[mkdir] Created dir: /local/home/cmiller/work/echo-array/build/classes
[mkdir] Created dir: /local/home/cmiller/work/echo-array/build/lib
pre.compile.test:
[echo] Stax Availability= true
[echo] Axis2 Availability= true
compile.src:
[javac] Compiling 54 source files to
/local/home/cmiller/work/echo-array/build/classes
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
echo.classpath.problem:
jar.server:
[copy] Copying 3 files to
/local/home/cmiller/work/echo-array/build/classes/META-INF
[jar] Building jar:
/local/home/cmiller/work/echo-array/build/lib/InteropDerived.aar
BUILD SUCCESSFUL
Total time: 8 seconds
[cmiller-linux] echo-array 538$ cp build/lib/InteropDerived.aar
/local/home/cmiller/work/axis2/axis2-1.4.1/repository/services/
[cmiller-linux] echo-array 539$
[cmiller-linux] echo-array 539$
[cmiller-linux] echo-array 539$
*** Wireshark log ***
POST /axis2/services/InteropDerived HTTP/1.0
Host: cmiller-linux.picsel.com:8080
User-Agent: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 883
SOAPAction: "urn:soapinterop"
Via: 1.1 webproxy.picsel.com:3128 (squid/2.6.STABLE5)
X-Forwarded-For: 10.3.18.22
Cache-Control: max-age=259200
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://soapinterop.org/xsd"
xmlns:ns3="http://soapinterop.org/">
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ns3:echoStringArray>
<inputStringArray xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[6]">
<item>O, what a tangled web we weave,</item>
<item>When first we practise to deceive!</item>
<item>A Palmer too!-no wonder why</item>
<item>I felt rebuked beneath his eye:</item>
<item>I might have known there was but one,</item>
<item>Whose look could quell Lord Marmion.</item>
</inputStringArray>
</ns3:echoStringArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
HTTP/1.0 500 org.apache.axis2.databinding.ADBException: Unsupported type
http://schemas.xmlsoap.org/soap/encoding/ Array
Date: Mon, 13 Oct 2008 09:59:35 GMT
Server: Simple-Server/1.1
Content-Type: text/xml; charset=utf-8
Connection: Close
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>org.apache.axis2.databinding.ADBException:
Unsupported type http://schemas.xmlsoap.org/soap/encoding/
Array</faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
*** Server log ***
$ /local/home/colinsm/work/axis2/axis2-1.4.1/bin/axis2server.sh
Using AXIS2_HOME: /local/home/colinsm/work/axis2/axis2-1.4.1
Using JAVA_HOME: /usr/lib/jvm/java-6-sun
[INFO] [SimpleAxisServer] Starting
[INFO] [SimpleAxisServer] Using the Axis2
Repository/local/home/colinsm/work/axis2/axis2-1.4.1/repository
[SimpleAxisServer] Using the Axis2
Repository/local/home/colinsm/work/axis2/axis2-1.4.1/repository
[SimpleAxisServer] Using the Axis2 Configuration
File/local/home/colinsm/work/axis2/axis2-1.4.1/conf/axis2.xml
[INFO] Deploying module: addressing-1.41 -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/modules/addressing-1.41.mar
[INFO] Deploying module: metadataExchange-1.41 -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/modules/mex-1.41.mar
[INFO] Deploying module: smtpfault -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/modules/smtpfault.mar
[INFO] Deploying module: script-1.41 -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/modules/scripting-1.41.mar
[INFO] Deploying module: soapmonitor-1.41 -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/modules/soapmonitor-1.41.mar
[INFO] Deploying module: ping-1.41 -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/modules/ping-1.41.mar
[INFO] Deploying module: metadataExchange -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/lib/mex-1.4.1.jar
[INFO] Deploying Web service: version.aar -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/services/version.aar
[INFO] Deploying Web service: Interop.aar -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/services/Interop.aar
[INFO] Trouble processing wsdl file :No service was not found in the
WSDL at META-INF/wsdl0.wsdl with targetnamespace null
[INFO] Deploying Web service: InteropDerived.aar -
file:/local/home/colinsm/work/axis2/axis2-1.4.1/repository/services/InteropDerived.aar
[INFO] [SimpleAxisServer] Started
[SimpleAxisServer] Started
[INFO] Listening on port 8080
[ERROR] org.apache.axis2.databinding.ADBException: Unsupported type
http://schemas.xmlsoap.org/soap/encoding/ Array
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException:
Unsupported type http://schemas.xmlsoap.org/soap/encoding/ Array
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
internalechoadb.InteropDerivedMessageReceiverInOut.fromOM(InteropDerivedMessageReceiverInOut.java:149)
at
internalechoadb.InteropDerivedMessageReceiverInOut.invokeBusinessLogic(InteropDerivedMessageReceiverInOut.java:42)
at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at
org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:278)
at
org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
at
org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
at
org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.Exception:
org.apache.axis2.databinding.ADBException: Unsupported type
http://schemas.xmlsoap.org/soap/encoding/ Array
at
org.soapinterop.xsd.ArrayOfstring$Factory.parse(ArrayOfstring.java:433)
at
org.soapinterop.EchoStringArray$Factory.parse(EchoStringArray.java:419)
at
internalechoadb.InteropDerivedMessageReceiverInOut.fromOM(InteropDerivedMessageReceiverInOut.java:136)
... 12 more
Caused by: org.apache.axis2.databinding.ADBException: Unsupported type
http://schemas.xmlsoap.org/soap/encoding/ Array
at
org.soapinterop.xsd.ExtensionMapper.getTypeObject(ExtensionMapper.java:31)
at
org.soapinterop.xsd.ArrayOfstring$Factory.parse(ArrayOfstring.java:391)
... 14 more
*** end of logs ***
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]