You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Pampolini Matteo <ma...@selex-es.com> on 2013/01/09 15:05:21 UTC
Please help, I cannot (and do not want) to connect to the Internet
at runtime
Hello CXF folks and happy new year from Italy!
I posted a similar email some time ago, but though some kind replies,
I'm still in trouble.
I need to develop a Web service from a third-party WSDL file that in
turns imports other files.
I'm usingwsdl2java and everything seems fine, classes are generated and
I can compile my
server application. However, at runtime I get an exception because CXF
framework tries to
connect to the Internet through the BuildServiceFromWSDL function, but
it fails because my
server needs to run on a private network without Internet access. Is
there a way to avoid this?
Please note that:
1) There are many nested imports, so it is not feasible to download
everything locally and create
Java classes from there.
2) The same works perfectly with C++ classes generated by gSOAP library,
once the dependencies
are resolved at code-generation time the code is completely consistent.
May you please help me? Frankly speaking I cannot really understand why
there's this kind of
need in CXF framework.
Many thanks in advance,
Matteo
--
Write once, compile everywhere
Compile once, run somewhere...
Re: Please help, I cannot (and do not want) to connect to the Internet
at runtime
Posted by Pampolini Matteo <ma...@selex-es.com>.
Hi Ron,
many thanks for your quick reply. The WSDL file comes from ONVIF
specifications,
in particular I'm working with
http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl.
The first sites it is trying to reach are the ones in definitions, say
ONVIF itself and XML SOAP schemas.
Please note that this code is part of a product that has to be installed
at customer premises, on private
networks with all the constraints you can imagine.
Any suggestions?
Matteo
On 09/01/2013 15:43, Ron Wheeler wrote:
> What site is it trying to reach?
> You can always make your own Internet if you don't want to connect to
> the outside world.
> Ron
>
> On 09/01/2013 9:05 AM, Pampolini Matteo wrote:
>> Hello CXF folks and happy new year from Italy!
>>
>> I posted a similar email some time ago, but though some kind replies,
>> I'm still in trouble.
>>
>> I need to develop a Web service from a third-party WSDL file that in
>> turns imports other files.
>> I'm usingwsdl2java and everything seems fine, classes are generated
>> and I can compile my
>> server application. However, at runtime I get an exception because CXF
>> framework tries to
>> connect to the Internet through the BuildServiceFromWSDL function, but
>> it fails because my
>> server needs to run on a private network without Internet access. Is
>> there a way to avoid this?
>>
>> Please note that:
>>
>> 1) There are many nested imports, so it is not feasible to download
>> everything locally and create
>> Java classes from there.
>>
>> 2) The same works perfectly with C++ classes generated by gSOAP
>> library, once the dependencies
>> are resolved at code-generation time the code is completely consistent.
>>
>> May you please help me? Frankly speaking I cannot really understand
>> why there's this kind of
>> need in CXF framework.
>>
>> Many thanks in advance,
>>
>> Matteo
>>
>
--
Write once, compile everywhere
Compile once, run somewhere...
Re: Please help, I cannot (and do not want) to connect to the Internet
at runtime
Posted by Ron Wheeler <rw...@artifact-software.com>.
What site is it trying to reach?
You can always make your own Internet if you don't want to connect to
the outside world.
Ron
On 09/01/2013 9:05 AM, Pampolini Matteo wrote:
> Hello CXF folks and happy new year from Italy!
>
> I posted a similar email some time ago, but though some kind replies,
> I'm still in trouble.
>
> I need to develop a Web service from a third-party WSDL file that in
> turns imports other files.
> I'm usingwsdl2java and everything seems fine, classes are generated
> and I can compile my
> server application. However, at runtime I get an exception because CXF
> framework tries to
> connect to the Internet through the BuildServiceFromWSDL function, but
> it fails because my
> server needs to run on a private network without Internet access. Is
> there a way to avoid this?
>
> Please note that:
>
> 1) There are many nested imports, so it is not feasible to download
> everything locally and create
> Java classes from there.
>
> 2) The same works perfectly with C++ classes generated by gSOAP
> library, once the dependencies
> are resolved at code-generation time the code is completely consistent.
>
> May you please help me? Frankly speaking I cannot really understand
> why there's this kind of
> need in CXF framework.
>
> Many thanks in advance,
>
> Matteo
>
--
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102
Re: Please help, I cannot (and do not want) to connect to the Internet at runtime
Posted by Daniel Kulp <dk...@apache.org>.
It looks like that wsdl has some characters in it that don't map into the standard ISO8859-1 charset. By default, I think we'll write it out in UTF-8. Thus, you have two options:
1) Update the call to javac in the ant script to specify that source files are in UTF-8.
2) Pass a specific encoding into wsdl2java:
./wsdl2java -encoding ASCII -fe jaxws21 -client -d t2 http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
to force it to map the unknown chars into "?" chars.
Dan
On May 17, 2013, at 4:30 AM, stravi <vi...@uti.ro> wrote:
> How did u succeed to compile it?
> I am generating code with:
> wsdl2java.bat -client -ant -d Clei
> http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
> got: WARNING: WSDL document
> http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl does not define
> any services
>
> and when i use ant to build source i get 15 errors like:
> [javac]shall be ΓÇ£415 Unsupported Media TypeΓÇ?. If the firmware upgrade
> fails due to an error at the
> [javac]error: unmappable character for encoding Cp1252
> [javac] device, the HTTP POST response shall be ΓÇ£500 Internal Server Error
> ΓÇ?.
>
> What's wrong with the generated code?
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Please-help-I-cannot-and-do-not-want-to-connect-to-the-Internet-at-runtime-tp5721283p5727802.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Please help, I cannot (and do not want) to connect to the
Internet at runtime
Posted by stravi <vi...@uti.ro>.
How did u succeed to compile it?
I am generating code with:
wsdl2java.bat -client -ant -d Clei
http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
got: WARNING: WSDL document
http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl does not define
any services
and when i use ant to build source i get 15 errors like:
[javac]shall be ΓÇ£415 Unsupported Media TypeΓÇ?. If the firmware upgrade
fails due to an error at the
[javac]error: unmappable character for encoding Cp1252
[javac] device, the HTTP POST response shall be ΓÇ£500 Internal Server Error
ΓÇ?.
What's wrong with the generated code?
--
View this message in context: http://cxf.547215.n5.nabble.com/Please-help-I-cannot-and-do-not-want-to-connect-to-the-Internet-at-runtime-tp5721283p5727802.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Please help, I cannot (and do not want) to connect to the Internet
at runtime
Posted by Pampolini Matteo <ma...@selex-es.com>.
Many many thanks Dan.
While I was trying to understand this stuff, I made some changes to the
WSDL/code and I removed
wsdlLocation in the wrong place, now I started from scratch and
everything is fine!
I really appreciated your kind help.
Best regards,
Matteo
On 09/01/2013 16:55, Daniel Kulp wrote:
> On Jan 9, 2013, at 10:23 AM, Pampolini Matteo <ma...@selex-es.com> wrote:
>
>> Hi Dan,
>>
>> I tried your suggestion but it does not work. I noticed that there are many "targetNamespace"
>> declarations with external URLs inside code annotations, what about them?
> The targetnamespace things are just namespaces used for the element namespaces when the XML is created. They should never be connected to anything.
>
>
>> But sorry if I insist,
>> why does gSOAP works perfectly without having to access the Internet?
>>
>> BTW, may you please have a look at the WSDL file I cited to better understand my case?
> I generated the code from the wsdl and the only thing that references the wsdl is the DeviceImpl. If you remove the wsdlLocation attribute from there, then nothing would be referencing the wsdl and it should be starting up fine without hitting the internet. I don't see any policies in there so the service should work fine.
>
> Dan
>
>
>
>> Many thanks, Matteo
>>
>> On 09/01/2013 15:49, Daniel Kulp wrote:
>>> With CXF, if you set the wsdlLocation to null or an empty string, the Server/Client will likely work, although it will internally generate a new WSDL from the java classes. However, that won't work for all cases. If the WSDL contains things like policy statements and such that are required at runtime, CXF WILL need the WSDL to obtain those. Also, things like schema facets and restrictions and such cannot be validated without the original wsdl/schema.
>>>
>>> Dan
>>>
>>>
>>>
>>> On Jan 9, 2013, at 9:05 AM, Pampolini Matteo <ma...@selex-es.com> wrote:
>>>
>>>> Hello CXF folks and happy new year from Italy!
>>>>
>>>> I posted a similar email some time ago, but though some kind replies, I'm still in trouble.
>>>>
>>>> I need to develop a Web service from a third-party WSDL file that in turns imports other files.
>>>> I'm usingwsdl2java and everything seems fine, classes are generated and I can compile my
>>>> server application. However, at runtime I get an exception because CXF framework tries to
>>>> connect to the Internet through the BuildServiceFromWSDL function, but it fails because my
>>>> server needs to run on a private network without Internet access. Is there a way to avoid this?
>>>>
>>>> Please note that:
>>>>
>>>> 1) There are many nested imports, so it is not feasible to download everything locally and create
>>>> Java classes from there.
>>>>
>>>> 2) The same works perfectly with C++ classes generated by gSOAP library, once the dependencies
>>>> are resolved at code-generation time the code is completely consistent.
>>>>
>>>> May you please help me? Frankly speaking I cannot really understand why there's this kind of
>>>> need in CXF framework.
>>>>
>>>> Many thanks in advance,
>>>>
>>>> Matteo
>>>>
>>>> --
>>>> Write once, compile everywhere
>>>> Compile once, run somewhere...
>>>>
>>
>> --
>> Write once, compile everywhere
>> Compile once, run somewhere...
>>
--
Write once, compile everywhere
Compile once, run somewhere...
Re: Please help, I cannot (and do not want) to connect to the Internet at runtime
Posted by Daniel Kulp <dk...@apache.org>.
On Jan 9, 2013, at 10:23 AM, Pampolini Matteo <ma...@selex-es.com> wrote:
> Hi Dan,
>
> I tried your suggestion but it does not work. I noticed that there are many "targetNamespace"
> declarations with external URLs inside code annotations, what about them?
The targetnamespace things are just namespaces used for the element namespaces when the XML is created. They should never be connected to anything.
> But sorry if I insist,
> why does gSOAP works perfectly without having to access the Internet?
>
> BTW, may you please have a look at the WSDL file I cited to better understand my case?
I generated the code from the wsdl and the only thing that references the wsdl is the DeviceImpl. If you remove the wsdlLocation attribute from there, then nothing would be referencing the wsdl and it should be starting up fine without hitting the internet. I don't see any policies in there so the service should work fine.
Dan
>
> Many thanks, Matteo
>
> On 09/01/2013 15:49, Daniel Kulp wrote:
>> With CXF, if you set the wsdlLocation to null or an empty string, the Server/Client will likely work, although it will internally generate a new WSDL from the java classes. However, that won't work for all cases. If the WSDL contains things like policy statements and such that are required at runtime, CXF WILL need the WSDL to obtain those. Also, things like schema facets and restrictions and such cannot be validated without the original wsdl/schema.
>>
>> Dan
>>
>>
>>
>> On Jan 9, 2013, at 9:05 AM, Pampolini Matteo <ma...@selex-es.com> wrote:
>>
>>> Hello CXF folks and happy new year from Italy!
>>>
>>> I posted a similar email some time ago, but though some kind replies, I'm still in trouble.
>>>
>>> I need to develop a Web service from a third-party WSDL file that in turns imports other files.
>>> I'm usingwsdl2java and everything seems fine, classes are generated and I can compile my
>>> server application. However, at runtime I get an exception because CXF framework tries to
>>> connect to the Internet through the BuildServiceFromWSDL function, but it fails because my
>>> server needs to run on a private network without Internet access. Is there a way to avoid this?
>>>
>>> Please note that:
>>>
>>> 1) There are many nested imports, so it is not feasible to download everything locally and create
>>> Java classes from there.
>>>
>>> 2) The same works perfectly with C++ classes generated by gSOAP library, once the dependencies
>>> are resolved at code-generation time the code is completely consistent.
>>>
>>> May you please help me? Frankly speaking I cannot really understand why there's this kind of
>>> need in CXF framework.
>>>
>>> Many thanks in advance,
>>>
>>> Matteo
>>>
>>> --
>>> Write once, compile everywhere
>>> Compile once, run somewhere...
>>>
>
>
> --
> Write once, compile everywhere
> Compile once, run somewhere...
>
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Please help, I cannot (and do not want) to connect to the Internet
at runtime
Posted by Pampolini Matteo <ma...@selex-es.com>.
Hi Dan,
I tried your suggestion but it does not work. I noticed that there are
many "targetNamespace"
declarations with external URLs inside code annotations, what about
them? But sorry if I insist,
why does gSOAP works perfectly without having to access the Internet?
BTW, may you please have a look at the WSDL file I cited to better
understand my case?
Many thanks, Matteo
On 09/01/2013 15:49, Daniel Kulp wrote:
> With CXF, if you set the wsdlLocation to null or an empty string, the Server/Client will likely work, although it will internally generate a new WSDL from the java classes. However, that won't work for all cases. If the WSDL contains things like policy statements and such that are required at runtime, CXF WILL need the WSDL to obtain those. Also, things like schema facets and restrictions and such cannot be validated without the original wsdl/schema.
>
> Dan
>
>
>
> On Jan 9, 2013, at 9:05 AM, Pampolini Matteo <ma...@selex-es.com> wrote:
>
>> Hello CXF folks and happy new year from Italy!
>>
>> I posted a similar email some time ago, but though some kind replies, I'm still in trouble.
>>
>> I need to develop a Web service from a third-party WSDL file that in turns imports other files.
>> I'm usingwsdl2java and everything seems fine, classes are generated and I can compile my
>> server application. However, at runtime I get an exception because CXF framework tries to
>> connect to the Internet through the BuildServiceFromWSDL function, but it fails because my
>> server needs to run on a private network without Internet access. Is there a way to avoid this?
>>
>> Please note that:
>>
>> 1) There are many nested imports, so it is not feasible to download everything locally and create
>> Java classes from there.
>>
>> 2) The same works perfectly with C++ classes generated by gSOAP library, once the dependencies
>> are resolved at code-generation time the code is completely consistent.
>>
>> May you please help me? Frankly speaking I cannot really understand why there's this kind of
>> need in CXF framework.
>>
>> Many thanks in advance,
>>
>> Matteo
>>
>> --
>> Write once, compile everywhere
>> Compile once, run somewhere...
>>
--
Write once, compile everywhere
Compile once, run somewhere...
Re: Please help, I cannot (and do not want) to connect to the Internet at runtime
Posted by Daniel Kulp <dk...@apache.org>.
With CXF, if you set the wsdlLocation to null or an empty string, the Server/Client will likely work, although it will internally generate a new WSDL from the java classes. However, that won't work for all cases. If the WSDL contains things like policy statements and such that are required at runtime, CXF WILL need the WSDL to obtain those. Also, things like schema facets and restrictions and such cannot be validated without the original wsdl/schema.
Dan
On Jan 9, 2013, at 9:05 AM, Pampolini Matteo <ma...@selex-es.com> wrote:
> Hello CXF folks and happy new year from Italy!
>
> I posted a similar email some time ago, but though some kind replies, I'm still in trouble.
>
> I need to develop a Web service from a third-party WSDL file that in turns imports other files.
> I'm usingwsdl2java and everything seems fine, classes are generated and I can compile my
> server application. However, at runtime I get an exception because CXF framework tries to
> connect to the Internet through the BuildServiceFromWSDL function, but it fails because my
> server needs to run on a private network without Internet access. Is there a way to avoid this?
>
> Please note that:
>
> 1) There are many nested imports, so it is not feasible to download everything locally and create
> Java classes from there.
>
> 2) The same works perfectly with C++ classes generated by gSOAP library, once the dependencies
> are resolved at code-generation time the code is completely consistent.
>
> May you please help me? Frankly speaking I cannot really understand why there's this kind of
> need in CXF framework.
>
> Many thanks in advance,
>
> Matteo
>
> --
> Write once, compile everywhere
> Compile once, run somewhere...
>
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com