facebook

To make locally deployed WSDL available at remote deployment

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #301273 Reply

    Hi,

    I wrote a web service client against a WSDL file. Everything goes fine on my local machine, but when deployed on a remote machine, gives the following error:

    
    Aug 10, 2009 6:00:20 PM com.sun.xml.ws.mex.client.MetadataClient retrieveMetadata
    WARNING: MEX0008:Failed to parse metadata returned from server at file:/D:/__nece/daid/WebRoot/WEB-INF/wsdl/secondary/WSCheckXYZSoapHttpPort.wsdl using protocol SOAP_1_2. Continuing attempts.
    ...
    ...
    

    … which is correct for obvious reasons that the WSDL file is not available at D:/__nece/… on a linux box. I looked into the auto-generated Service file and it has the absolute path hard coded in the file as below:

    @WebServiceClient(name = “WSCheckXYZ”, targetNamespace = “http://companyABC/WSCheckXYZ.wsdl”, wsdlLocation = “file:/D:/__nece/daid/WebRoot/WEB-INF/wsdl/secondary/WSCheckXYZSoapHttpPort.wsdl”)

    I googled around, and found solutions like using jax-ws-catalog.xml at https://jax-ws.dev.java.net/guide/Developing_client_application_with_locally_packaged_WSDL.html#Xml_Catalog. I found some nice links for other IDEs and a step-by-step instructions on how to do it, but couldn’t find anything for MyEclipse. I am putting my experience here so that other startes can benefit from it. I am using MyEclipse 7.5 with tomcat6 and JDK6 (By the way, i have also tested it with JBoss5 using JDK6 on both XP and Suse). So, here it goes:

    0- Create a Web project (JEE 5 with JAX-WS 2.1) –
    1- Put the WSDL file (against which client stubs have to be created) under WEB-INF/wsdl/secondary/ directory in your project. I just didn’t put it under WEB-INF/wsdl/ directory to differentiate between server WSDL and client WSDL (just a personel preferecne).
    2- Right click the WSDL file, click MyEclipse -> New Web Service Client
    3- Select Jax-WS, click Next
    4- Make sure the path of WSDL file is exactly where you just put it in step 1 above.
    5- Specify Java Package, click Next
    6- Click Finish to end the wizard (assuming there are no valdiation/compliance issues in WSDL)
    7- Right click WEB-INF, select New -> File
    8- Specify file name as jax-ws-catalog.xml and click Finish
    9- Open the newly created jax-ws-catalog.xml file and define the mapping from “absolute path” to “packaged URL” (see below for details).
    10- Save and deploy and you should be fine!

    What/How to jax-ws-catalog.xml?
    For the above example, my jax-ws-catalog looked like this:

    
    <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
        prefer="system">
        <system
            systemId="file:/D:/__nece/daid/WebRoot/WEB-INF/wsdl/secondary/WSCheckXYZSoapHttpPort.wsdl"
            uri="wsdl/secondary/WSCheckXYZSoapHttpPort.wsdl" />
    </catalog>
    

    The only problem with this is that the value of /catalog/system/@systemId attribute will be different for each developer in the team (as each member may have different installation directories), which may cause little inconvenience at sync time.

    Regards,
    –mnsharif

    #301274 Reply
    #301276 Reply

    Another way of avoiding the following error is given at http://blog.vinodsingh.com/2008/05/webservice-endpoint.html.

    Aug 10, 2009 6:00:20 PM com.sun.xml.ws.mex.client.MetadataClient retrieveMetadata
    WARNING: MEX0008:Failed to parse metadata returned from server at file:/D:/__nece/daid/WebRoot/WEB-INF/wsdl/secondary/WSCheckXYZSoapHttpPort.wsdl using protocol SOAP_1_2. Continuing attempts.
    ...
    ... 

    HTH!

    Regards,
    –mnsharif

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: To make locally deployed WSDL available at remote deployment

You must be logged in to post in the forum log in