hi,all.
i had write a simple webservice using jibx databind.
this is my code listed below:
====================================
package net.asd.test.mockservice.service;

import net.asd.test.mockservice.service.vo.Credit;

public interface Authorize {

        public boolean authorize(Credit credit);

}

=====================================
package net.asd.test.mockservice.service;

public class MockAuthorize implements Authorize {

        public boolean authorize(Credit credit) {
                if (null == credit)
                        return false;
                if (credit.getId() == null)
                        return false;
                if (credit.getName() == null)
                        return false;
                if (credit.getPasswd() == null)
                        return false;
                if (credit.getType() == null)
                        return false;

                return true;
        }

}
===========================================
package net.asd.test.mockservice.service.vo;

public class Credit {
        
        private String id;
        private String name;
        private String passwd;
        private String type;
        private String descript;
        private String greeting;
        private boolean passed;
        
        public String getId() {
                return id;
        }
        public void setId(String id) {
                this.id = id;
        }
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        public String getPasswd() {
                return passwd;
        }
        public void setPasswd(String passwd) {
                this.passwd = passwd;
        }
        public String getType() {
                return type;
        }
        public void setType(String type) {
                this.type = type;
        }
        public String getDescript() {
                return descript;
        }
        public void setDescript(String descript) {
                this.descript = descript;
        }
        public boolean isPassed() {
                return passed;
        }
        public void setPassed(boolean passed) {
                this.passed = passed;
        }
        public String getGreeting() {
                return greeting;
        }
        public void setGreeting(String greeting) {
                this.greeting = greeting;
        }
        
}
============================================
as you saw,all is very simpl.
then i ran cmd as belw:
=======================================
%AXIS2_HOME%/bin/java2wsdl -cp . -cn
net.asd.test.mockservice.service.impl.MockAuthorize -of
MockAuthorize.wsdl
========================================
it is ok.
then i create a databing file named aaa.xml as blow:
========================================
<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <namespace uri="http://vo.service.mockservice.test.asd.net/xsd";
default="element"/>
        
  <mapping name="Credit"   class="net.asd.test.mockservice.service.vo.Credit">
    <value name="descript" field="descript"/>
    <value name="greeting" field="greeting"/>
    <value name="id" field="id"/>
    <value name="name" field="name"/>
    <value name="passed" field="passed"/>
    <value name="passwd" field="passwd"/>
    <value name="type" field="type"/>
  </mapping>
</binding>
======================================
then,i ran :
=====================================
%AXIS2_HOME%/bin/wsdl2java -uri MockAuthorize.wsdl -p
net.asd.test.mockservice.service.impl.stub -d jibx -s -ss -sd -ssi -uw
-o ..\src  -Ebindingfile .\aaa.xml
=======================================
some exception occure:
===================================
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeE
xception: Cannot unwrap element
{http://impl.service.mockservice.test.asd.net}authorize: no abstract
 mapping definition found for type
{http://vo.service.mockservice.test.asd.net/xsd}Credit (used by e
lement {http://impl.service.mockservice.test.asd.net}credit)
===================================

i traced this exception,i fund when:
==================================pseudocode=========
bindingElement = BindingElement.engage();
=====================pseudocode=======
=================================
bindingElement.childset().size()==0!!!!!
==============================
i searched  within jibx.sourceforge.net,i can not found the source
code about org.jibx.binding.model.JiBX_bindingFactory.
the trace was interrupted.


i am an newbie to jibx,i don`t found what wrong with my aaa.xml which
take the bindelement`s children is empty set.

who could help me?any advice will be appreciated!.

best
regards.

                     murphy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to