node.js soap connection for apache cxf with custom object

125 views
Skip to first unread message

pratik bakshi

unread,
Jun 11, 2014, 8:44:02 AM6/11/14
to nod...@googlegroups.com
Hi , 

Trying to integrate with a apache cxf webservice .
wsdl : 

<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ev.com" xmlns:intf="http://ev.com"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"targetNamespace="http://ev.com">
<!--
WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://ev.com">
<element name="test">
<complexType>
<sequence>
<element name="testDTO" type="impl:TestDTO"/>
<element name="again" type="impl:TestAgain"/>
<element name="time" type="xsd:string"/>
</sequence>
</complexType>
</element>
<complexType name="TestDTO">
<sequence>
<element name="age" nillable="true" type="xsd:string"/>
<element name="name" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="TestAgain">
<sequence>
<element name="company" nillable="true" type="xsd:string"/>
<element name="place" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="testResponse">
<complexType>
<sequence>
<element name="testReturn" type="impl:TestDTO"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="testResponse">
<wsdl:part element="impl:testResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="testRequest">
<wsdl:part element="impl:test" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="TestWeb">
<wsdl:operation name="test">
<wsdl:input message="impl:testRequest" name="testRequest"></wsdl:input>
<wsdl:output message="impl:testResponse" name="testResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestWebSoapBinding" type="impl:TestWeb">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="test">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="testRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="testResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestWebService">
<wsdl:port binding="impl:TestWebSoapBinding" name="TestWeb">
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


node file : 


 var soap = require('soap');
 var jsn ={testDTO:{name:"pratik",age:"24"},again:{company:"infy",place:"chn"},time:"5.02"};

  soap.createClient(url, function(err, checkResponse) {
  
      checkResponse.test(jsn, function(err, result) {
         console.log(result);
      });
  });


error : Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ev.com/", local:"testDTO"). Expected elements are <{}arg2>,<{}arg1>,<{}arg0>
... 42 more




Same is working for apache axis web service.

Need help.
Urgent.
Thanks,
Pratik
Reply all
Reply to author
Forward
0 new messages