I was wondering if there is a way to update host and port address of a 
WadlComponent
I mean to use something else that on the Wadl file.

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:html="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xsi:schemaLocation="http://research.sun.com/wadl/2006/10 wadl.xsd" 
xmlns="http://research.sun.com/wadl/2006/10";>

   <grammars>
        <include href="Quiks_v1.xsd"/>
    </grammars>

    <resources base="http://localhost:8185";>
        <resource id="com.services.QuiksResource"  path="/docId/{docId}">
              <param name="docId" style="template" type="xsi:string" 
required="true" />
             <method name="POST">
                <response>
                    <representation status="200" mediaType="text/plain" />
               </response>
            </method>
       </resource>
    </resources>

</application>


Currently the only way to access to this resource is through 
http://localhost:8185/docId/12
So, I want to use a different port that 8185.and lets say preferably the actual 
hostname
http://bora:8182/docId/12 how is this possible? I can see this not being a 
problem on a servlet container but when 
running  standalone it causes problems.

So far I've tried the following. Since the Wadl can not match the base url it 
can not find the resource and I get 404 error
  

public static void main(String[] args) {

try

{

    WadlComponent component = new 
WadlComponent(file:///C:/Eclipse/workspace/Quiks/src/main/resources/Quiks.wadl.xml");

    component.getServers().add(Protocol.HTTP,"localhost", 8182);

    component.start();


    Client client = new Client(Protocol.HTTP);

    Response res = client.post("http://localhost:8182/quikbiblist/docId/1";,

    new StringRepresentation(""));


    System.out.println("res="+res.getStatus().getCode());

    component.stop();



}

catch (Exception e)

{

// Something is wrong.

e.printStackTrace();

}

}





Any help is appreciated

Thanks

Bora






Reply via email to