users@jax-ws.java.net

Re: for error of add web service in NetBean

From: Sameer Tyagi <Sameer.Tyagi_at_Sun.COM>
Date: Mon, 24 Jul 2006 10:48:03 -0400
I did a quick test, looks like you are missing a schema file

SmartTransducerML.xsd (The system cannot find the file specified)
However it seems this schema is not used anywhere in the WSDL. When I comment
out the line referencing it in the WSDL it works fine.

wsimport-init:
Created dir: F:\workspace\JavaApplication3\build\generated\wsimport\client
Created dir: F:\workspace\JavaApplication3\build\classes
wsimport-client-check-SmartTransducerServices:
wsimport-client-SmartTransducerServices:
Note: F:\workspace\JavaApplication3\build\generated\wsimport\client\test\ObjectFactory.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL (total time: 8 seconds)

/s




yuyin Song wrote:
Hi Sameer,

Please find my wsdl and schema files in the
attachment(wsdl.piz). You should rename wsdl.piz into
wsdl.zip and then extend them. Please try it and see
what the problem is. Thank you so much.
Regards,

Yuyin


--- Sameer Tyagi <Sameer.Tyagi@Sun.COM> wrote:

  
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@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
     
          
=== message truncated ===