You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Pieper, Aaron" <Pi...@Pragmatics.com> on 2013/01/09 17:39:25 UTC

When calling a web service with ws-addressing, CXF tries to connect to w3.org

I'm using some CXF-generated stubs to call a web service, without
connecting to the internet. I've done this before, but this particular
web service uses ws-addressing which causes some additional issues. This
is the section of code where we obtain a reference to the
"MessagingManager" - the generated service class which we're trying to
call.

 

 
W3CEndpointReferenceBuilder w3cerBuilder = new
W3CEndpointReferenceBuilder();

 
w3cerBuilder.address("https://www.foo.org/MessagingManager");

                                                W3CEndpointReference
w3ceReference = w3cerBuilder.build();

                                                MyService myService =
w3ceReference.getPort(MyService.class, new AddressingFeature());

 

This getPort() call invokes
org.apache.cxf.jaxws.spi.ProviderImpl.getPort(). This getPort
implementation eventually delegates to
org.apache.cxf.jaxb.JAXBDataBinding, which generates a JAXB schema file,
"schema1.xsd". This generated file references the
http://www.w3.org/2006/03/addressing/ws-addr.xsd schema, which is
downloaded at runtime. If an internet connection is unavailable, this
results in an error, "Unable to locate imported document at
'http://www.w3.org...".

 

What's the best way to call a ws-addressing web service without an
internet connection?

 

-          Aaron


Re: When calling a web service with ws-addressing, CXF tries to connect to w3.org

Posted by Freeman Fang <fr...@gmail.com>.
Yeah, as discussed in the thread Glen already pointed out, the jax-ws-catalog.xml is the way to go to handle offline xsd scenario, that said, override the url map to your local xsd copy.
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-1-10, at 上午5:28, Glen Mazza wrote:

> Hi Aaron, I just googled that URL + CXF and got this thread:
> http://cxf.547215.n5.nabble.com/CXF-without-internet-connection-td3347755.html#a3347920
> 
> (starting from there and reading down).  Any workable solution there for you?
> 
> Regards,
> Glen
> 
> On 01/09/2013 11:39 AM, Pieper, Aaron wrote:
>> I'm using some CXF-generated stubs to call a web service, without
>> connecting to the internet. I've done this before, but this particular
>> web service uses ws-addressing which causes some additional issues. This
>> is the section of code where we obtain a reference to the
>> "MessagingManager" - the generated service class which we're trying to
>> call.
>> 
>>  
>>  W3CEndpointReferenceBuilder w3cerBuilder = new
>> W3CEndpointReferenceBuilder();
>> 
>>  w3cerBuilder.address("https://www.foo.org/MessagingManager");
>> 
>>                                                 W3CEndpointReference
>> w3ceReference = w3cerBuilder.build();
>> 
>>                                                 MyService myService =
>> w3ceReference.getPort(MyService.class, new AddressingFeature());
>> 
>>  
>> This getPort() call invokes
>> org.apache.cxf.jaxws.spi.ProviderImpl.getPort(). This getPort
>> implementation eventually delegates to
>> org.apache.cxf.jaxb.JAXBDataBinding, which generates a JAXB schema file,
>> "schema1.xsd". This generated file references the
>> http://www.w3.org/2006/03/addressing/ws-addr.xsd schema, which is
>> downloaded at runtime. If an internet connection is unavailable, this
>> results in an error, "Unable to locate imported document at
>> 'http://www.w3.org...".
>> 
>>  
>> What's the best way to call a ws-addressing web service without an
>> internet connection?
>> 
>>  
>> -          Aaron
>> 
>> 
> 
> 
> -- 
> Glen Mazza
> Talend Community Coders - coders.talend.com
> blog: www.jroller.com/gmazza
> 


Re: When calling a web service with ws-addressing, CXF tries to connect to w3.org

Posted by Glen Mazza <gm...@talend.com>.
Hi Aaron, I just googled that URL + CXF and got this thread:
http://cxf.547215.n5.nabble.com/CXF-without-internet-connection-td3347755.html#a3347920

(starting from there and reading down).  Any workable solution there for 
you?

Regards,
Glen

On 01/09/2013 11:39 AM, Pieper, Aaron wrote:
> I'm using some CXF-generated stubs to call a web service, without
> connecting to the internet. I've done this before, but this particular
> web service uses ws-addressing which causes some additional issues. This
> is the section of code where we obtain a reference to the
> "MessagingManager" - the generated service class which we're trying to
> call.
>
>   
>
>   
> W3CEndpointReferenceBuilder w3cerBuilder = new
> W3CEndpointReferenceBuilder();
>
>   
> w3cerBuilder.address("https://www.foo.org/MessagingManager");
>
>                                                  W3CEndpointReference
> w3ceReference = w3cerBuilder.build();
>
>                                                  MyService myService =
> w3ceReference.getPort(MyService.class, new AddressingFeature());
>
>   
>
> This getPort() call invokes
> org.apache.cxf.jaxws.spi.ProviderImpl.getPort(). This getPort
> implementation eventually delegates to
> org.apache.cxf.jaxb.JAXBDataBinding, which generates a JAXB schema file,
> "schema1.xsd". This generated file references the
> http://www.w3.org/2006/03/addressing/ws-addr.xsd schema, which is
> downloaded at runtime. If an internet connection is unavailable, this
> results in an error, "Unable to locate imported document at
> 'http://www.w3.org...".
>
>   
>
> What's the best way to call a ws-addressing web service without an
> internet connection?
>
>   
>
> -          Aaron
>
>


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza