List Info

Thread: Creating client




Creating client
user name
2006-02-22 17:32:56
Hi, I'm using MUSE to develop a service. The problem is that it does not supply a way to generate a client stub to use the service.
Using the Apache Addressing WSDL2Java utility, I generated a client stub for my service, but when I call it, it does not send any header. This is the test code:

public static void main(String[] args) {
       
        try {
            String url = "http://localhost:8081/muse/services/Ssh";

 ;           EndpointReferenceType epr = new EndpointReferenceType();
   ;         epr.setAddress(new AttributedURI(url));
  

           
           
            SshServiceAddressingLocator locator =
                 new SshServiceAddressingLocator();
           
            SOAPHeaderElement resourceIdentifier = new org.apache.axis.message.SOAPHeaderElement("ResourceIdentifier","wsrf");
   ;        
            ReferencePropertiesType props = new ReferencePropertiesType();
           
            props.add(resourceIdentifier);
           
            epr.setProperties(props);
   ;        
            SshPortType port = locator.getSsh(epr);

            System.out.println (port.getResourceProperty(new QName("status")));

But I only get this request:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<soapenv:Envelope
&nbsp;   xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/&quot;
 ; &nbsp; xmlnssd="http://www.w3.org/2001/XMLSchema"
&nbsp; &nbsp; xmlnssi=" http://www.w3.org/2001/XMLSchema-instance&quot;>
&nbsp;   <soapenv:Body>
  ;   &nbsp;  <GetResourceProperty
 &nbsp;   &nbsp;   &nbsp;  xmlns=&quot; http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd&quot;>
&nbsp; &nbsp;  &nbsp;   &nbsp;  <GetResourceProperty>status</GetResourceProperty>
&nbsp; &nbsp;  &nbsp;  </GetResourceProperty>
&nbsp; &nbsp; </soapenv:Body>
</soapenv:Envelope>

I know the request is not well composed, but why there is no Header section at all? Woudn't it have to have a To element at least?
--
Saludos.
José Antonio Sánchez
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )