Hi All,
I am using below code to marshall an instance of java bean 'Dog' which
is there in the form of 'value' object.
StringWriter swriter = new StringWriter();
IBindingFactory ifact = BindingDirectory.getFactory(value.getClass());
IMarshallingContext mctx = ifact.createMarshallingContext();
mctx.setOutput(swriter);
((IMarshallable)value).marshal(mctx);
Now at the last line of above code I am getting below exception. Can
anyone please let me know what is it that I am missing here ....
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
at animaldog.JiBX_AnimalDogDemo_bindingPuppy_access.marshal()
at animaldog.Dog.JiBX_AnimalDogDemo_binding_marshal_2_0(Dog.java)
at animaldog.JiBX_AnimalDogDemo_bindingDog_access.marshal()
at animaldog.Dog.marshal(Dog.java)
The wsdl I am using is
----------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://localhost:88/axis/services/UseAnimalDog"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:88/axis/services/UseAnimalDog"
xmlns:intf="http://localhost:88/axis/services/UseAnimalDog"
xmlns:tns1="http://DefaultNamespace"
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.2RC2 Built on Nov 16, 2004
(12:19:44 EST)-->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="isDog">
<complexType>
<sequence>
<element name="tns1:in0"
type="tns1:Dog"/>
</sequence>
</complexType>
</element>
<complexType name="Animal">
<sequence>
<element name="laysEggs"
type="xsd:boolean"/>
</sequence>
</complexType>
<complexType name="Puppy">
<sequence>
<element name="dummyPup"
type="xsd:boolean"/>
</sequence>
</complexType>
<complexType name="Dog">
<complexContent>
<extension base="tns1:Animal">
<sequence>
<element
name="has4Legs" type="xsd:boolean"/>
<element name="puppy"
nillable="true" type="tns1:Puppy"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="isDogResponse">
<complexType>
<sequence>
<element name="isDogReturn"
type="tns1:Dog"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="isDogRequest">
<wsdl:part element="tns1:isDog" name="parameters"/>
</wsdl:message>
<wsdl:message name="isDogResponse">
<wsdl:part element="tns1:isDogResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="UseAnimalDog">
<wsdl:operation name="isDog">
<wsdl:input message="impl:isDogRequest"
name="isDogRequest"/>
<wsdl:output message="impl:isDogResponse"
name="isDogResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UseAnimalDogSoapBinding" type="impl:UseAnimalDog">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="isDog">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="isDogRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="isDogResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UseAnimalDogService">
<wsdl:port binding="impl:UseAnimalDogSoapBinding"
name="UseAnimalDog">
<wsdlsoap:address
location="http://localhost:9999/axis/services/UseAnimalDog"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
----------------------------------------------------------------------------------------------------------
Thanks & Regards,
Kumar.
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users