views:

29

answers:

1

I'm new in web services. I have faced some problem. At the server side i'm using spring-ws. At the client side i'm using jax-ws. With wsimport tool i have generated java classes according to my wsdl.

Everything works fine, but for some reason jax-ws does not parse arrays and list correctly, all lists are empty

I'm absolutely sure, that response is form correctly, tested it with soapui, also i'm using logging interceptor to log outcomming responses.

Below is the snippets of response

response looks like

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <firstElementResponse>
         <name>hello world text</name>
         <name>hello world text</name>
         <name>hello world text</name>
      </firstElementResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

and the snippets of wsdl

<xs:complexType name="sayHelloResponseType">
  <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="name" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

To generate client code i use wsimport.

SayHelloResponseType resp = serv.sayHello(r);
List<String> name = resp.getName();
System.out.println(name.size());

Thank you. Any help will be highly appreciated.

+1  A: 

Seems it's just an invalid body of response, that does not math wsdl shema. Neither spring-ws neither jax-ws throws exception. It simply parse invalid data to empty list without any warrnings.

org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor saved my day

probably i have to tweak logging for jax-ws to avoid it next time

aauser