Hi Tony Blair,
Please take a look at the attached classes, WSDD file, request, response etc…
There is nothing wrong with the axis neither any bug. The issue was with your WSDD file. I wrote it little different way. Method signature etc are same just added the package name and serializable interface for your Request class.
The sample request generated by WebServiceTester tool for the WSDL for your service is attached at the end of this email together with the WSDD file and the response received from the web service. I did not use the java client just used WebServiceTester tool to invoke the web service. If you need client code let me know.
Just compile this code and stick those classes in WEB-INF/classes dir. Paste the WSDD entry in your server-config.wsdd. Restart the tomcat.
Good luck. (By any chance, Are you UK Prime Minister, Mr. Tony Blair??)
Shrikant… HPP/eProfile QA Lead. HP
For those who are interested in Web Services testing: ----------------------------------------------------- I found that WebServiceTester from Optimyz software is a very good tool for testing any types of web services, and I'm great fan of this tool. It supports all types of web services, and all simple and complex types and it very usable than any other tool in the market I ever used/evaluated. It automatically generates the SOAP requests and invokes the intended web services. It can perform functional, regression and load testing of web services. Result analysis and status reporting is just wonderful. I'll highly recommend this tool for testing web services, saves lots of time and efforts in testing web services. For more information visit http://www.optimyz.com.
DISCLAIMER ================================================================ THESE ARE MY PERSONAL VIEWS/OPINIONS AND DOES NOT REPRESENT HP, AND THE INFORMATION PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE I/HP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS INFORMATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =================================================================
Request POST /axis/services/PublicService2 HTTP/1.1 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: WST Host: 127.0.0.1 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 814 Connection: close
<?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:ns0="http://localhost:8070/axis/services/PublicService2" xmlns:ns1="http://axis.user.net/PublicService2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <tns:getSingleBusinessLocation xmlns:tns="http://user.axis"> <in0 xsi:type="ns1:Request"> <params xsi:type="ns0:Param"> <name xsi:type="xsd:string">stringData1</name> <value xsi:type="xsd:string"/> </params> </in0> </tns:getSingleBusinessLocation> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
response HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked Date: Fri, 06 Feb 2004 00:23:12 GMT Server: Apache-Coyote/1.1 Connection: close
360 <?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:getSingleBusinessLocationResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://user.axis"> <ns1:getSingleBusinessLocationReturn href="" </ns1:getSingleBusinessLocationResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Param" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://localhost:8070/axis/services/PublicService2"> <name xsi:type="xsd:string">LINE_1</name> <value xsi:type="xsd:string">121 River Street</value> </multiRef> </soapenv:Body> </soapenv:Envelope> 0
WSDD File entry <service name="PublicService2" provider="java:RPC"> <parameter name="allowedMethods" value="*"/> <parameter name="wsdlPortType" value="PublicService2"/> <parameter name="className" value="axis.user.PublicService2"/> <parameter name="wsdlTargetNamespace" value="http://localhost:8070/axis/services/PublicService2"/> <typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns101:Request" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" type="java:axis.user.Request" xmlns:ns101="http://axis.user.net/PublicService2"/> <typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns102:Param" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" type="java:axis.user.Param" xmlns:ns102="http://localhost:8070/axis/services/PublicService2"/> </service>
-----Original Message-----
Hi Venkatesh,
Thanks for the suggestion. I slightly modified my code from yesterday where my bean takes a Collection and my service also returns a Collection. Based on the error I get I am not sure if the ser/deser are the problem. Here is the error and thanks for all the help you can give me.
-----------error msg------------- SEVERE: Exception:
-------------------The first bean------------------ public class Request public class Param implements java.io.Serializable -------------- The service -------------- public class PublicService3 /********Service now is returning
Collection *******/ Collection busLoc = new ArrayList(2); Param
line1= new Param(); Param name=
new Param();
------------Client --------- public class Client
call.registerTypeMapping(Request.class, qn,
call.registerTypeMapping(Param.class, qn, Collection
result=null; } -----------deploy.wsdd---------------- <deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
Thanks, Tony.
Do you Yahoo!? |
Request.java
Description: Request.java
Param.java
Description: Param.java
PublicService2.java
Description: PublicService2.java