Issue Details (XML | Word | Printable)

Key: AXIS-2473
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: John Busfield
Votes: 4
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Axis

Server reponse does not match WSDL

Created: 09/May/06 12:50 AM   Updated: 25/Apr/07 10:17 PM
Return to search
Component/s: WSDL processing
Affects Version/s: 1.2.1, 1.3
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works axis-patch.txt 2006-07-03 03:57 PM Per Salomonsson 7 kB
Java Archive File Licensed for inclusion in ASF works axis-patched.jar 2006-07-03 03:58 PM Per Salomonsson 1.50 MB
XML File deploy.wsdd 2006-05-10 12:16 AM John Busfield 2 kB
XML File server-config.wsdd 2006-05-10 12:16 AM John Busfield 4 kB
Environment: Win2K, Axis running under Tomcat 4.31


 Description  « Hide
Below I have included the WSDL for a simple test service, followed by the Axis response to a request for this service. As ou can see, the WSDL claims the paramInt & paramStr elements
are in the http://util.services.mycompany.com namespace, but in the
generated response, they're in the http://services.mycompany.com namespace. I am using Axis 1.2.1 but have also also confirmed this behavior in 1.3.
 
The class structure behind the service looks like this

/^*** Info.java ***/
package com.mycompany.services.util;
public class Info
{
private String paramStr;
private int paramInt;
public int getParamInt() {
return paramInt;
}
public void setParamInt(int paramInt) {
this.paramInt = paramInt;
}
public String getParamStr() {
return paramStr;
}
public void setParamStr(String paramStr) {
this.paramStr = paramStr;
}
}

/^*** MyService.java ***/
package com.mycompany.services;
import com.mycompany.services.util.Info;
public class MyService
{
public Info getInfo()
{
Info i = new Info();
i.setParamInt(14);
i.setParamStr("hello");

return i;
}

}


----------------------------------------WSDL----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://services.mycompany.com"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://services.mycompany.com"
xmlns:intf="http://services.mycompany.com"
xmlns:tns1="http://util.services.mycompany.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.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->
  <wsdl:types>
   <schema elementFormDefault="qualified"
targetNamespace="http://services.mycompany.com"
xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://util.services.mycompany.com"/>
    <element name="getInfo">
     <complexType/>
    </element>
    <element name="getInfoResponse">
     <complexType>
      <sequence>
       <element name="getInfoReturn" type="tns1:Info"/>
      </sequence>
     </complexType>
    </element>
   </schema>
   <schema elementFormDefault="qualified"
targetNamespace="http://util.services.mycompany.com"
xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="Info">
     <sequence>
      <element name="paramInt" type="xsd:int"/>
      <element name="paramStr" nillable="true" type="xsd:string"/>
     </sequence>
    </complexType>
   </schema>
  </wsdl:types>

    <wsdl:message name="getInfoRequest">

       <wsdl:part element="impl:getInfo" name="parameters"/>

    </wsdl:message>

    <wsdl:message name="getInfoResponse">

       <wsdl:part element="impl:getInfoResponse" name="parameters"/>

    </wsdl:message>

    <wsdl:portType name="MyService">

       <wsdl:operation name="getInfo">

          <wsdl:input message="impl:getInfoRequest"
name="getInfoRequest"/>

          <wsdl:output message="impl:getInfoResponse"
name="getInfoResponse"/>

       </wsdl:operation>

    </wsdl:portType>

    <wsdl:binding name="MyServiceSoapBinding" type="impl:MyService">

       <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

       <wsdl:operation name="getInfo">

          <wsdlsoap:operation soapAction=""/>

          <wsdl:input name="getInfoRequest">

             <wsdlsoap:body use="literal"/>

          </wsdl:input>

          <wsdl:output name="getInfoResponse">

             <wsdlsoap:body use="literal"/>

          </wsdl:output>

       </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="MyServiceService">

       <wsdl:port binding="impl:MyServiceSoapBinding" name="MyService">

          <wsdlsoap:address
location="http://localhost/test/services/MyService"/>

       </wsdl:port>

    </wsdl:service>

</wsdl:definitions>




HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Mon, 01 May 2006 16:03:16 GMT
Server: Apache-Coyote/1.1

19e
<?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><getInfoResponse
xmlns="http://services.mycompany.com"><getInfoReturn><paramInt>14</par
amInt><paramStr>hello</paramStr></getInfoReturn></getInfoResponse></so
apenv:Body></soapenv:Envelope>
0


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Bjorn Townsend added a comment - 09/May/06 11:29 PM
John,

Can you post a copy of the .wsdd file you used to deploy the service? I can't say for sure without it, but my guess is you need to use the <beanmapping> tag to define the namespace properly:

http://www.oio.de/axis-wsdd/beanMapping.htm

Thanks,
Bjorn

John Busfield added a comment - 10/May/06 12:16 AM
Not sure which you wanted to see so I included both server-config.wsdd and deploy.wsdd for the MyService service

Per Bondesson added a comment - 29/May/06 07:02 PM
I have experienced the exact same problem. I've tried both 1.3 and 1.4 with beanmapping, but with no success. Have you solved the problem? If so, can you please tell me how.

thx
/Per

Per Bondesson added a comment - 30/May/06 01:39 PM
There are two other reports with the same problem (AXIS-1529, AXIS-2449). They are not resolved yet either.

John Busfield added a comment - 30/May/06 09:18 PM
No, there is no solution to this problem yet and yes, AXIS-1529 and AXIS-2449 are definitely the same issues. The inability to use multiple packages in a service seems like a pretty fundamental flaw in the architecture. I'm very surprised that no one is looking into it.

Per Bondesson added a comment - 31/May/06 09:03 PM
I have tried using XFire with a similar simple service and here is the response.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<printGreetingResponse xmlns="http://main.com/HelloWorld">
<out>
<greeting xmlns="http://hej.com">Heffaklump!</greeting>
</out>
</printGreetingResponse>
</soap:Body>
</soap:Envelope>

The namespace is specified for greeting. This is how it is supposed to look like!

/Per

Per Salomonsson added a comment - 03/Jul/06 03:57 PM
I have attached a patch (and a patched lib) compatible with Axis 1.4.0 release/branch.
The problem we had was when using document/literal wrapped complex types were not serialized correctly (missing namespaces). I have also included a fix for using arrays. them "item" tag is now used (to match the xml schema in the WSDL file), and with the correct namespace. The array-fix is taken more or less from another bugreport that was reported here at JIRA.

Please let me know if it works for you to.
Here is how we have used it:

1. Write the java classes that should represent the web service interface - including your java beans.
2. generate deploy/undeploy wsdd's using ant task "axis-wsdl2java" (DOCUMENT/LITERAL WRAPPED)
3. startup the server and publish the services.

The patch has only been used/tested with axis on the serverside, on the client side we have used 2 other client implementations to test/verify.


Per Salomonsson added a comment - 03/Jul/06 03:58 PM
And a patched lib if you want to try it directly (replace the axis.jar in 1.4 release).

John Busfield added a comment - 07/Jul/06 04:08 AM
Per's patch does fix this issue. Can someone from the Axis team please add this patch to the codebase

Bjorn Townsend added a comment - 25/Apr/07 10:17 PM
Per,

I tried adding your patch to 1.4 and running the Axis test suite. It seems to be causing some tests to fail. Can you run the all-tests target and confirm this?

Thanks,
Bjorn