Erik,

So in conclusion, 0.9.5 works differently (incorrectly?) opposed to 0.9.4?
Should I just back down to 0.9.4, place a bug in bugzilla and wait for a
resolution?

Thanks for all your help and I recognize you must bring home the bacon.

Regards,

Elias Torres

-----Original Message-----
From: Ostermueller, Erik [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 4:20 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] SOAP and Castor: unable to find FieldDescriptor


Elias,

I think we've stumpbled across some differences between 0.9.4 and 0.9.5

For starters, I had to patch the generated source
in the attached jar file, so if you run the default ant
target, you'll have to do the patching, too.
Issue 1) here is where I did the patching -- moved 2 files and added a
'package' stmt.

1) SourceGenerator is not putting ShipTo.java and ShipToDescriptor.java into

   the right package (or any package for that matter).

2) Elias, as you discovered, that the SourceGenerator no longer has the
getJavaPackage(namespaceURI) method 
        :-( :-( .

3) If you kick off the 'run' target with 0.9.4, you get the AnyNode as
expected. :- ).
   If you do the same with 0.9.5, you get :-(
SAXException: unable to find FieldDescriptor for 'Invoice' in
ClassDescriptor of Body By a visual check, the Invoice*.class files are
compiled and in the class path. Also, we know they're they because they
resolve if you run with 0.9.4.

Sorry I don't have time to dig any deeper -- gotta bring home the bacon.

--Erik

      > -----Original Message-----
      > From: Elias Torres [mailto:[EMAIL PROTECTED]
      > Sent: Tuesday, June 10, 2003 12:12 PM
      > To: [EMAIL PROTECTED]
      > Subject: Re: [castor-dev] SOAP and Castor: unable to find
      > FieldDescriptor
      > 
      > 
      > 
      > I'm getting a different behavior, I'd love for it to 
      > give me AnyNode at this
      > point, then I'm willing to work on the 
      > ns->package->class resolution. Can
      > you help me get the initial behavior working of AnyNode 
      > being returned
      > first?
      > 
      > Elias
      > 
      > -----Original Message-----
      > From: Ostermueller, Erik [mailto:[EMAIL PROTECTED] 
      > Sent: Tuesday, June 10, 2003 12:16 PM
      > To: [EMAIL PROTECTED]
      > Subject: Re: [castor-dev] SOAP and Castor: unable to 
      > find FieldDescriptor
      > 
      > 
      > 
      > 
      > Elias Torres wrote:
      >       > Now let's say that Foo is like: <ns1:Foo
      >       > xmlns="http://adifferenturithansoapschema/";></ns1:Foo>, 
      >       > will Castor still
      >       > treat as anyNode?
      > Yes, I believe so.  I presume you're getting different behavior?
      > 
      >       > 
      >       > I'm trying to avoid putting xsiType information and 
      >       > make language dependent.
      > :-) -- good idea.
      > 
      >       > I thought xsd:any namespace="##other|##any" would allow 
      >       > me to have any
      >       > element I wanted w/o having it defined in the schema. 
      >       > Shouldn't Castor treat
      >       > it the same?
      > yep.  You're just stuck with 
      > org.exolab.castor.types.AnyNode until you
      > provide castor with more info for ns->package->class resolution.
      > 
      > 
      >       > 
      >       > -----Original Message-----
      >       > From: Ostermueller, Erik 
      > [mailto:[EMAIL PROTECTED] 
      >       > Sent: Tuesday, June 10, 2003 10:28 AM
      >       > To: [EMAIL PROTECTED]
      >       > Subject: Re: [castor-dev] SOAP and Castor: unable to 
      >       > find FieldDescriptor
      >       > 
      >       > 
      >       > 
      >       > 
      >       > Elias Torres wrote:
      >       >       > Is Castor w/o setting a custom resolver 
      > supposed to 
      >       >       > place any children of
      >       >       > Body as AnyNodes according to the SOAP schema?
      >       > Say you've unmarshalled a SOAP message with 1 child 
      >       > element <Foo> under
      >       > <Body>. Without a customer resolver, code traversing 
      >       > below the <Body> will
      >       > encounter a org.exolab.castor.types.AnyNode object with 
      >       > <Foo> data inside
      >       > it.
      >       > 
      >       > Taking a different route, you can alternatively use 
      >       > xsiType without a custom
      >       > resolver.
      >       > 
      >       >       > 
      >       >       > Regards,
      >       >       > 
      >       >       > Elias
      >       >       > 
      >       >       > -----Original Message-----
      >       >       > From: Ostermueller, Erik 
      >       > [mailto:[EMAIL PROTECTED] 
      >       >       > Sent: Tuesday, June 10, 2003 9:56 AM
      >       >       > To: [EMAIL PROTECTED]
      >       >       > Subject: Re: [castor-dev] SOAP and 
      > Castor: unable to 
      >       >       > find FieldDescriptor
      >       >       > 
      >       >       > 
      >       >       > Elias,
      >       >       > 
      >       >       > For starters, I put together 
      > nspackages.jar using 0.9.4.
      >       >       > I'll dig into the rest of this today.
      >       >       > 
      >       >       >       > -----Original Message-----
      >       >       >       > From: Elias Torres 
      > [mailto:[EMAIL PROTECTED]
      >       >       >       > Sent: Monday, June 09, 2003 5:13 PM
      >       >       >       > To: [EMAIL PROTECTED]
      >       >       >       > Subject: Re: [castor-dev] SOAP 
      > and Castor: 
      >       >       > unable to find
      >       >       >       > FieldDescriptor
      >       >       >       > 
      >       >       >       > 
      >       >       >       > Hi Erik,
      >       >       >       > 
      >       >       >       > Thanks for your desire to help. 
      > Here is what 
      >       >       > I've done so far:
      >       >       >       > 
      >       >       >       > I have two projects using 
      >       > castor-0.9.5-xml.jar, one is 
      >       >       >       > your nspackages.jar
      >       >       >       > source and other is my own test project.
      >       >       >       > 
      >       >       >       > This is what I did to your 
      > nspackages.jar:
      >       >       >       > - modified resolveByXMLName() 
      > because it was 
      >       >       > not compiling:
      >       >       >       >             strClass =
      >       >       >       > 
      >       > _namespacePackageMapper.lookupPackageNamespace(namespace
      >       >       >       > URI).trim() + "." +
      >       >       >       > xmlName;
      >       >       >       > - Ran your example and it did 
      > *not* work:
      >       >       >       >         org.xml.sax.SAXException: 
      >       > unable to find 
      >       >       >       > FieldDescriptor for
      >       >       >       > 'Invoice' in ClassDescriptor of Body
      >       >       >       > - Using FileMon from 
      >       > http://www.sysinternals.com 
      >       >       >       > verified the process is
      >       >       >       > reading the rigth 
      > castorbuilder.properties file
      >       >       >       > - I noticed you generated 
      > source from soap 1.0
      >       >       >       > 
      >       >       >       > Now, I copied your 
      >       > DataBindingUtility.java to my test 
      >       >       >       > project and of course,
      >       >       >       > I had the same error for my own 
      >       > children element in the 
      >       >       >       > body/header
      >       >       >       > 
      >       >       >       > - My first issue was the fact that 
      >       > Castor was not 
      >       >       >       > treating my body's (or
      >       >       >       > header's) children as AnyNode as in 
      >       > your example:
      >       >       >       >       AnyNode anyNode = 
      >       > (AnyNode)header.getAnyObject(0);
      >       >       >       >       String strSecurityInfo = 
      >       > anyNode.getStringValue();
      >       >       >       >       
      > System.out.println(strSecurityInfo);
      >       >       >       > 
      >       >       >       > - Then I noticed that your header child 
      >       > SecurityInfo in 
      >       >       >       > SoapTest did not
      >       >       >       > have a default xmlns attribute, so I 
      >       > modified the 
      >       >       >       > testNamespace to do this:
      >       >       >       >   public void testNamespace() throws 
      >       > Exception  {
      >       >       >       >       System.out.println("Test 
      > xml namespace");
      >       >       >       >       unmarshalStuff( 
      > getSoapMessage("") );
      >       >       >       >   }
      >       >       >       >   and this made it possible for me to 
      >       > read anything as 
      >       >       >       > AnyNode that does not
      >       >       >       > have a default xmlns attribute. Except 
      >       > that for this to 
      >       >       >       > work I had to use
      >       >       >       > your source for soap.xsd instead of the 
      >       > one I generated 
      >       >       >       > from soap 1.1 xsd.
      >       >       >       > What I noticed to be the difference was:
      >       >       >       > 
      >       >       >       >         desc.setHandler(handler);
      >       >       >       >         
      >       >       >       > 
      >       > desc.setNameSpaceURI("http://schemas.xmlsoap.org/soap/en
      >       >       >       > velope/");
      >       >       >       > <-- this was not in my source
      >       >       >       >         desc.setMatches("*");
      >       >       >       >         desc.setMultivalued(true);
      >       >       >       >         addFieldDescriptor(desc);
      >       >       >       > 
      >       >       >       > Summary:
      >       >       >       > 
      >       >       >       > - I would like to know how did 
      > you make your 
      >       >       > source include
      >       >       >       > desc.setNameSpaceURI() in the 
      > .java file.
      >       >       >       > - resolveByXMLName in your 
      >       > ClassDescriptorResolverImpl 
      >       >       >       > is only getting
      >       >       >       > called when for any body/header 
      >       > children when it does 
      >       >       >       > not contain an xmlns
      >       >       >       > attribute, if it does have an xmlns 
      >       > attribute, it does 
      >       >       >       > not get called. 
      >       >       >       > 
      >       >       >       > Let me know what else would you like to 
      >       > see in order to 
      >       >       >       > help me find the
      >       >       >       > solution to my problem.
      >       >       >       > 
      >       >       >       > Thanks in advance,
      >       >       >       > 
      >       >       >       > Elias Torres
      >       >       >       > 
      >       >       >       > -----Original Message-----
      >       >       >       > From: Ostermueller, Erik 
      >       >       > [mailto:[EMAIL PROTECTED] 
      >       >       >       > Sent: Monday, June 09, 2003 11:15 AM
      >       >       >       > To: [EMAIL PROTECTED]
      >       >       >       > Subject: Re: [castor-dev] SOAP and 
      >       > Castor: unable to 
      >       >       >       > find FieldDescriptor
      >       >       >       > 
      >       >       >       > 
      >       >       >       > 
      >       >       >       > Elias wrote:
      >       >       >       >         > I read the post from 
      > Eric that 
      >       >       >       >       > talks about reading the
      >       >       >       >       > nspackages at run time by 
      >       > implementing your own 
      >       >       >       >       > CDResolver, I've tried that
      >       >       >       >       > but is still throwing 
      > the same error. I 
      >       >       > just don't 
      >       >       >       >       > understand why it's not
      >       >       >       >       > treating 'myNode' as an 
      > anyNode like I 
      >       >       > would think it's 
      >       >       >       >       > supposed to.
      >       >       >       > I'd be happy to help -- just 
      > send a bit more 
      >       >       > detailed info.
      >       >       >       > Be sure to do a sanity check:  
      >       >       >       > make sure the *Descriptor.class files 
      >       > are compiled and 
      >       >       >       > in your cp, make sure
      >       >       >       > you're using the same 
      >       > castorbuilder.properties at 
      >       >       >       > code-gen as you are at
      >       >       >       > runtime.
      >       >       >       > 
      >       >       >       >       > 
      >       >       >       >       > Please someone let me 
      > know what the 
      >       >       > current best 
      >       >       >       >       > practice for using SOAP and
      >       >       >       >       > Castor is.. Thanks in advanced.
      >       >       >       > Perhaps we could use the wiki to 
      >       > document these best 
      >       >       >       > practices. For
      >       >       >       > starters, we might have to settle for 
      >       >       > 'often-used' practices.
      >       >       >       > 
      >       >       >       > Here is some Axis + Castor activity:
      >       >       >       > 
      >       >       > 
      >       > 
      > http://hypermail.linklord.com/castor-dev.old/2002/Aug/0497.html
      >       >       >       > 
      >       >       > 
      >       > 
      > http://www.mail-archive.com/[EMAIL PROTECTED]/msg09933.html
      >       >       >       > 
      >       >       > 
      >       > 
      > http://www.mail-archive.com/[EMAIL PROTECTED]/msg00971.html
      >       >       >       > 
      >       > http://www-106.ibm.com/developerworks/webservices/librar
      >       >       >       > y/ws-soapmap2/
      >       >       >       > 
      >       >       > 
      >       > 
http://www.theserverside.com/patterns/thread.jsp?thread_id=8675
      >       >       > 
      >       >       > XSOAP + Castor
      >       >       > 
      > http://www.extreme.indiana.edu/xgws/xsoap/rmi/download/x
      >       > soap_1_2/src/java/sa
      >       > mples/google/
      >       > 
      >       > 
      > ----------------------------------------------------------- 
      >       > If you wish to unsubscribe from this mailing, 
      > send mail to
      >       > [EMAIL PROTECTED] with a subject of:
      >       >         unsubscribe castor-dev
      >       > 
      >       > 
      > ----------------------------------------------------------- 
      >       > If you wish to unsubscribe from this mailing, 
      > send mail to
      >       > [EMAIL PROTECTED] with a subject of:
      >       >         unsubscribe castor-dev
      >       > 
      >       > 
      > ----------------------------------------------------------- 
      >       > If you wish to unsubscribe from this mailing, 
      > send mail to
      >       > [EMAIL PROTECTED] with a subject of:
      >       >         unsubscribe castor-dev
      >       > 
      >       > 
      > ----------------------------------------------------------- 
      >       > If you wish to unsubscribe from this mailing, 
      > send mail to
      >       > [EMAIL PROTECTED] with a subject of:
      >       >         unsubscribe castor-dev
      >       > 
      > 
      > ----------------------------------------------------------- 
      > If you wish to unsubscribe from this mailing, send mail to
      > [EMAIL PROTECTED] with a subject of:
      >         unsubscribe castor-dev
      > 
      > ----------------------------------------------------------- 
      > If you wish to unsubscribe from this mailing, send mail to
      > [EMAIL PROTECTED] with a subject of:
      >         unsubscribe castor-dev
      > 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to