I am not that familiar with XFire so you have to bear with me. I don't see
any methods in JaxbServiceFactory where I can pass a JAXBContext. I'm also
not seeing where the JaxbServiceFactory fits into the picture. I create a
"Client", "Impl" and "SoapPort" class from the wsdl of the service I'm
trying to connect to. It looks like all the action occurs in
DegreeVerifyClient.create0

private void create0() {
        TransportManager tm =
(org.codehaus.xfire.XFireFactory.newInstance().getXFire().getTransportManager());
        HashMap props = new HashMap();
        props.put("annotations.allow.interface", true);
        AnnotationServiceFactory asf = new AnnotationServiceFactory(new
Jsr181WebAnnotations(), tm, new AegisBindingProvider(new
JaxbTypeRegistry()));
        asf.setBindingCreationEnabled(false);
        service0 =
asf.create((com.tci.nsch.client.DegreeVerifySoapPort.class), props);
        {
            AbstractSoapBinding soapBinding =
asf.createSoap11Binding(service0, new
QName("http://xml.studentclearinghouse.org/ws/services/DegreeVerify";,
"DegreeVerifySoapPortLocalBinding"), "urn:xfire:transport:local");
        }
        {
            AbstractSoapBinding soapBinding =
asf.createSoap11Binding(service0, new
QName("http://xml.studentclearinghouse.org/ws/services/DegreeVerify";,
"DegreeVerifySoapBinding"), "http://schemas.xmlsoap.org/soap/http";);
        }
    }


I call this from:

DegreeVerifyClient                       client = new DegreeVerifyClient();
DegreeVerifySoapPort               service =
client.getDegreeVerifySoapPort();
DegreeVerifyResponseType        resp = service.degreeVerifyRequest(req);

I've gone through the javadoc but I'm not seeing how to introduce a
JaxbServiceFactory into this. Some guidanec would be greatly appreciated.

thanks,
Nat


Tomek Sztelak wrote:
> 
> You can pass your own JAXBContext  to JaxbServiceFactory,what should
> fix the problem ( i hope).
> 
> On 4/20/07, Nat <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I have a problem with xfire using jaxb. Let me describe my application:
>> XFire and the associated jars are located in the WEB-INF directory. This
>> makes them loaded by the application classloader. Without making this to
>> complicated I have another classloader who's parent is the application
>> classloader. This "application" or main web service calls another web
>> service to retrieve some data. All the code for the client as well as the
>> java beans used by jaxb are loaded by the child classloader. This created
>> an
>> initial jaxb problem because jaxb is at the application level with xfire
>> and
>> it couldn't see the ObjectFactory sitting in the package managed by the
>> child classloader. I was able to fix that issue by passing a classloader
>> to
>> JAXBContext so now all my classes can be marshaled and unmarshaled. The
>> real
>> fun begins when I make my soap call through xfire. Xfire eventually tries
>> to
>> marshall my request object using jaxb. Unfortunately when xfire creates
>> the
>> JAXBContext it recreates my original problem and throws an exception
>> stating
>> it "could not marshall type". I was hoping there was a way to pass my
>> child
>> classloader into xfire but I can't seem to find a way to do that.
>>
>> I can restructure my project and make this work but I will lose a lot of
>> flexibility and I would like to avoid it if possible. Is there any way to
>> get xfire to initialize jaxbcontext correctly so my client piece works?
>>
>> thanks in advance,
>> Nat
>> --
>> View this message in context:
>> http://www.nabble.com/classloader-problem-tf3610507.html#a10089455
>> Sent from the XFire - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
> 
> 
> -- 
> -----
> When one of our products stops working, we'll blame another vendor
> within 24 hours.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/classloader-problem-tf3610507.html#a10101608
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to