users@jax-ws.java.net

Re: for error of add web service in NetBean

From: Sameer Tyagi <Sameer.Tyagi_at_Sun.COM>
Date: Fri, 21 Jul 2006 18:58:24 -0400

I m not sure I understand but if you additionally include the schemas in
the WAR and
have the WSDL point to the schemas relatively this should work. For
example the WSDL should
have something like

<xsd:import namespace="http://localhost/SmartTransducerServices" schemaLocation="ReadServiceRequest.xsd"/>
 

Look at the examples (though a bit dated ) here
http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns3/

Hope this helps
/s


yuyin Song wrote:

>Hi Sameer,
>
>Thanks. I think that problem is about location of
>schema file in the xs:import. for example, <xs:import
>namespace="http://localhost/SmartTransducerServices"
>schemaLocation="ReadServiceRequest.xsd"/>.
>This is relatve location, not a absolutely location.
>
>Actually I use wsdl file in the directory C:\Documents
>and Settings\Eugene
>Song\WSDL\SmartTransducerServices.wsdl, this
>directiory also includes all XML schema file related
>to wsdl file.
>
>I use the same as
>targetNamespace="http://localhost/SmartTransducerServices
>for all XML schema files and wsdl file.
>
>When I use this wsdl file to generate web service, the
>new wsdl file and all XML schema files are generated
>respectively in the directory:
>C:\Documents and Settings\Eugene
>Song\SmartTransducerServices\web\WEB-INF\wsdl and
>C:\Documents and Settings\Eugene
>Song\SmartTransducerServices\build\web\WEB-INF\wsdl
>
>When I successfully depoly web service, It correctly
>display wsdl file in the web
>site:http://localhost:8080/SmartTransducerServices/SmartTransducerServices?WSDL.
>
>But the location of XML schema file in this wsdl file
>is changed into the following.
>
> <xsd:import
>namespace="http://localhost/SmartTransducerServices"
>schemaLocation="http://sdage8.sensor.intranet:8080/SmartTransducerServices/SmartTransducerServices/__container$publishing$subctx/WEB-INF/wsdl/ReadServiceRequest.xsd"
>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
>
>When I add web service from wsdl in this web address,
>Web Server can not find the schema file. That is main
>problem. I hope that my description is clear. My
>question is how to set the location of XML schema file
>in the wsdl for my special case? Thanks a lot.
>Regards,
>
>Yuyin
>
>
>
>--- Sameer Tyagi <Sameer.Tyagi_at_Sun.COM> wrote:
>
>
>
>>There is a problem with the WSDL you are using. It
>>may be because it has
>>schemas that
>>it references that are not packaged with it.
>>Can you attach your wsdl here ?
>>
>>/s
>>
>>
>>yuyin Song wrote:
>>
>>
>>
>>>Hi Jitu,
>>>
>>>Thanks. I tried to use NetBean 5.5. It looks like
>>>
>>>
>>not
>>
>>
>>>support web service generated from WSDL. When we
>>>create web service, the options do not include web
>>>services generated from WSDL. I am not sure why,
>>>
>>>
>>and
>>
>>
>>>feel strange. Actually, NetBean has supported web
>>>service generated from WSDL. That is why I used
>>>
>>>
>>NetBet
>>
>>
>>>5.0 not 5.5. What is your idea for that?
>>>
>>>My problem is error for add service. I successfully
>>>deploy web service and display web page:
>>>
>>>
>>http://localhost/SmartTransducerServices/build/web/WEB-INF/wsdl/SmartTransducerServices?wsdl
>>
>>
>>>When I add web service in rumtime, the error
>>>information was generated as follows:
>>>
>>>Approach 1: Add service using local wsdl file
>>>C:/Documents and Settings/Eugene
>>>
>>>
>>Song/SmartTransducerServices/web/WEB-INF/wsdl/SmartTransducerServices.wsdl
>>
>>
>>>The error information is as foloows:
>>>
>>>
>>>
>>http://localhost:8080/SmartTransducerServices/SmartTransducerServices?WSDL
>>
>>
>>>Start file:///C:\Documents and Settings\Eugene
>>>
>>>
>>Song\SmartTransducerServices\web\WEB-INF\wsdl\SmartTransducerServices.wsdl
>>
>>
>>>07/21/2006 09:17:09: Parsing WSDL. Please wait
>>>
>>>
>>..WSDL
>>
>>
>>>- file:/C:/Documents and Settings/Eugene
>>>
>>>
>>Song/SmartTransducerServices/web/WEB-INF/wsdl/SmartTransducerServices.wsdl
>>
>>
>>>07/21/2006 09:17:09: Finished parsing WSDL.
>>>
>>>
>>07/21/2006
>>
>>
>>>09:17:20: Starting web service client creation...
>>>07/21/2006 09:17:27: Error occured while creating
>>>
>>>
>>the
>>
>>
>>>proxy!
>>>
>>>
>>>Approach 2: Add service using
>>>
>>>
>>http://localhost/SmartTransducerServices/build/web/WEB-INF/wsdl/SmartTransducerServices?wsdl
>>
>>
>>>The error information is as follows:
>>>
>>>Start
>>>
>>>
>>http://localhost:8080/SmartTransducerServices/SmartTransducerServices?WSDL
>>
>>
>>>07/21/2006 09:16:27: Parsing WSDL. Please wait
>>>
>>>
>>..WSDL
>>
>>
>>>-
>>>
>>>
>>http://localhost:8080/SmartTransducerServices/SmartTransducerServices?WSDL
>>
>>
>>>07/21/2006 09:16:28: Error Parsing WSDL. Please see
>>>the log file for details. Exception = modeler
>>>
>>>
>>error:
>>
>>
>>>invalid entity name: "ReadServiceRequest" (in
>>>namespace:
>>>
>>>
>>"http://localhost/SmartTransducerServices")
>>
>>
>>>End
>>>
>>>What is problem? How to fix it? Thank you so much.
>>>Regards,
>>>
>>>Yuyin
>>>
>>>
>>>--- Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
>>>wrote:
>>>
>>>
>>>
>>>
>>>
>>>>Can you check whether you are using jax-rpc or
>>>>jax-ws. I think NetBean
>>>>5.5 beta has a good support for jax-ws.
>>>>
>>>>
>>>>
>>>http://testwww.netbeans.org/kb/55/websvc-jax-ws.html
>>>
>>>
>>>>Jitu
>>>>
>>>>yuyin Song wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hi All,
>>>>>
>>>>>I use the existed WSDL file to generate web
>>>>>
>>>>>
>>>>>
>>>>>
>>>>services
>>>>
>>>>
>>>>
>>>>
>>>>>using NetBean 5.0. Everything is good for
>>>>>
>>>>>
>>>>>
>>>>>
>>>>generating
>>>>
>>>>
>>>>
>>>>
>>>>>web services. When I add web services, there is a
>>>>>error that is "Error occured while creating the
>>>>>proxy!".
>>>>>What is problem for proxy? How to set up proxy
>>>>>
>>>>>
>>and
>>
>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>fix
>>>>
>>>>
>>>>
>>>>
>>>>>it?
>>>>>Thanks,
>>>>>
>>>>>Eugene
>>>>>
>>>>>
>>>>>