facebook

Hard-coded WSDL path in services.xml

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

    Hi.

    When I generate a top-down webservice, I select my WSDL file. That location cannot be specified as project-relative. When the service is generated (and works fine), the services.xml file still contains:

    <wsdlURL>
                file:/C:/j/workspace_tprv3c/TPRLogger/TPRLogger.wsdl
            </wsdlURL>
    

    Of course that won’t work on the server. How can I change this to something more reasonable ?

    Other problem of the same kind: my WSDL file contains:

    <wsdl:service name="TPRLogger">
    −
        <wsdl:port name="TPRLoggerSOAP" binding="tns:TPRLoggerSOAP">
    <soap:address location="http://will.be.replaced.at.runtime/"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    When I do web services straight with JBoss, JBoss automatically replaces that location with actual location. And I can’t put a hard-coded location here: I’m deploying the same code on different servers. On my test machine, they’ll become http://localhost:8081/TPRLogger/services/TPRLogger?wsdl and http://localhost:8082/TPRLogger/services/TPRLogger?wsdl
    Any idea on how I can get this configured properly ?

    Thanks.

    #264795 Reply

    Riyad Kalla
    Member

    Of course that won’t work on the server. How can I change this to something more reasonable ?

    The file needs to be publicly accessible which means you need to put it up on some webspace where it can be accessed with HTTP or you can try typing in a relative path ourside of WEB-INF that the file can be accessed… although I haven’t tried this.

    When I do web services straight with JBoss, JBoss automatically replaces that location with actual location. And I can’t put a hard-coded location here: I’m deploying the same code on different servers. On my test machine, they’ll become http://localhost:8081/TPRLogger/services/TPRLogger?wsdl and http://localhost:8082/TPRLogger/services/TPRLogger?wsdl
    Any idea on how I can get this configured properly ?

    Why is this incorrect?

    #265047 Reply

    @support-rkalla wrote:

    When I do web services straight with JBoss, JBoss automatically replaces that location with actual location. And I can’t put a hard-coded location here: I’m deploying the same code on different servers. On my test machine, they’ll become http://localhost:8081/TPRLogger/services/TPRLogger?wsdl and http://localhost:8082/TPRLogger/services/TPRLogger?wsdl
    Any idea on how I can get this configured properly ?

    Why is this incorrect?

    When I create my WSDL, I don’t know yet where it’ll be deployed. When I deploy it on my own computer, I’ll use http://localhost:8080/TPRLogger/services/TPRLogger . When I’ll deploy it to our test server, it’ll be http://tst001.vivansa.loc/TPRLogger/services/TPRLogger.
    And when it’ll be in production it’ll become http://soap.vivansa.com/TPRLogger/services/TPRLogger.

    Normally, the URL of the service specified in the WSDL is corrected at runtime by the application server to correspond to the actual path. Otherwise, it doesn’t make any sense to specify http://localhost/service or http://hostname/service.

    Just today, I gave the service to a coworker. I specified localhost in the WSDL and he tried to use it from another computer… doesn’t work of course.

    #265071 Reply

    Riyad Kalla
    Member

    I’m sorry for the misunderstanding, after we had this discussion a saw a few bugs go by my Inbox related to this. It’s being work on for 5.5.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hard-coded WSDL path in services.xml

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