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(namespaceURI).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/envelope/";);
<-- 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/library/ws-soapmap2/
http://www.theserverside.com/patterns/thread.jsp?thread_id=8675

XSOAP + Castor
http://www.extreme.indiana.edu/xgws/xsoap/rmi/download/xsoap_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

Reply via email to