java - Weblogic web service not unmarshalling a base element -


i'm in bind-ing.. it? yeah it's been 4 days ain't laughing @ that.

i'm using inheritance in xsd definitions of types displayed below.

i have webservice has complex type definied in types section of wsdl.

<xsd:import namespace="http://xmlns.mycomp.com/base" schemalocation="base-data-types.xsd"/>  <xsd:element name="enterstateelement">     <xsd:complextype>         <xsd:complexcontent>             <xsd:extension base="base:basecontextrequesttype">               <xsd:sequence>                 <xsd:element name="instatecode" nillable="true" type="string"/>               </xsd:sequence>             </xsd:extension>         </xsd:complexcontent>     </xsd:complextype>   </xsd:element> 

the base:basecontextrequesttype defined in base-data-types.xsd follows

<?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/xmlschema"         xmlns="http://xmlns.mycomp.com/base"         xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"         jaxb:version="2.1"         targetnamespace="http://xmlns.mycomp.com/base"         elementformdefault="qualified">  <xsd:complextype name="basecontextrequesttype">     <xsd:annotation>         <xsd:appinfo>             <jaxb:class                  implclass="com.mycomp.xmlns.basecontextrequesttype"                 ref="com.mycomp.xmlns.basecontextrequesttype" >             </jaxb:class>         </xsd:appinfo>     </xsd:annotation>     <xsd:sequence>         <xsd:element name="processinstanceid" type="xsd:string" minoccurs="1"/>     </xsd:sequence> </xsd:complextype> 

the basecontextrequesttype java class looks like

@xmlaccessortype(xmlaccesstype.field) @xmltype(name = "basecontextrequesttype",      namespace="http://xmlns.mycomp.com/base",      proporder = { "processinstanceid" }) public class basecontextrequesttype {  @xmlelement(required = true, nillable=true, namespace="http://xmlns.mycomp.com/base") public string processinstanceid;  @xmlelement(required = true, nillable=true, namespace="http://xmlns.mycomp.com/base") public string getprocessinstanceid() {     return processinstanceid; }  public void setprocessinstanceid(string value) {     this.processinstanceid = value; } 

}

and enterelementstate java class extends this

public class enterstateelement extends com.mycomp.xmlns.basecontextrequesttype {

the following snippet of soap message being sent on wire.

 <env:body>   <enterstateelement xmlns:tns="http://ymqctds/" xmlns="http://ymqctds/">      <base:processinstanceid xmlns:base="http://xmlns.mycomp.com/base">iamtheprocessid</base:processinstanceid>      <tns:instatecode>r</tns:instatecode>   </enterstateelement> 

unfortunately in unmarshall processinstanceid field never gets set on basecontextrequesttype base class?

there must examples of out there weblogic, has ideas?

thanks, mark.

i believe problem because you've annotated both field , property "@xmlelement". since "xmlaccessortype" set "field", need remove "@xmlelement" annotation property (the getter method).


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -