List Info

Thread: Creating client




Creating client
user name
2006-02-23 18:50:32

We do not have a client generation utility per se but there was client code in the muse project as a subdirectory….I guess you can check that out…else try pinging the Apache Addressing mailing list and ask them about send headers with the generated client

 


From: José Antonio Sánchez [mailto:getaceresgmail.com]
Sent: Wednesday, February 22, 2006 1:52 PM
To: wsrf-userws.apache.org
Subject: Re: Creating client

 

The SOAP message I posted is the request I made to the server, I captured it with TCPMon. Indeed it gets to the server, but I get a fault in response saying that I need to send WS-Addressing headers.
I managed to do some operations adding the headers by hand in the following way:

public static void setHeaders(SshPortType client, String to, String action, String resourceId)
    {   
        String pt = "http://abc.com/my/wsdl/namespace ";
        String wsa = "http://schemas.xmlsoap.org/ws/2004/03/addressing";
  ;     
        org.apache.axis.message.PrefixedQName resourceIdentifierName = new org.apache.axis.message.PrefixedQName(pt,"ResourceIdentifier","pt");
        org.apache.axis.message.PrefixedQName toName = new org.apache.axis.message.PrefixedQName(wsa,"To","wsa");
        org.apache.axis.message.PrefixedQName actionName = new org.apache.axis.message.PrefixedQName(wsa,"Action","wsa");
       
        org.apache.axis.message.SOAPHeaderElement resourceIdElement = new org.apache.axis.message.SOAPHeaderElement(resourceIdentifierName);
        resourceIdElement.setValue(resourceId);
        resourceIdElement.setMustUnderstand(true);
       
        org.apache.axis.message.SOAPHeaderElement toElement = new org.apache.axis.message.SOAPHeaderElement(toName);
        toElement.setValue(to);
        toElement.setMustUnderstand(true);
       
        org.apache.axis.message.SOAPHeaderElement actionElement = new org.apache.axis.message.SOAPHeaderElement(actionName);
        actionElement.setValue(action);
        actionElement.setMustUnderstand(true);

        Stub stub = (Stub)client;
   ;    
        stub.setHeader (toElement);
        stub.setHeader(actionElement);
  ;      stub.setHeader(resourceIdElement);
       
    }

But WS-Addressing is supposed to do that for me, so, apart from generating a Stub that doesn't work with standard wsrf operations like GetResourceProperty, the Addressing WSDL2Java seems usseles to me.
It's a shame that they don't have any documentation at all, appart from a poor commented API documents and a devel mailing list (not a user mailing list).
Does the CVS version of Muse or WSRF has a WSDL2Java that generates client stubs?

On 2/22/06, Campana Jr., Salvatore J <hp.com">sal.campanahp.com>; wrote:

Jose,

 

I am not sure why you are not seeing the headers in the response…This may be a question for the Addressing team as it is their client.  The fact that you got a response shows that you successfully made your request to the server.

 

It just may be something in their objects or the way you are printing out the response, I am not sure and have not had much experience using their generated clients230;

 

-S

 


From: José Antonio Sánchez [mailto:gmail.com" target="_blank">getaceresgmail.com]
Sent: Wednesday, February 22, 2006 12:33 PM
To: ws.apache.org" target="_blank">wsrf-userws.apache.org
Subject: Creating client

 

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) {
 &nbsp;   &nbsp; 
 &nbsp;   &nbsp;  try {
 &nbsp;   &nbsp;   &nbsp;  String url = "http://localhost:8081/muse/services/Ssh&quot;;

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

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

   ;  &nbsp;   &nbsp;  System.out.println (port.getResourceProperty(new QName(&quot;status&quot;)));

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; &nbsp; xmlnssd="http://www.w3.org/2001/XMLSchema"
&nbsp; &nbsp; xmlnssi=" http://www.w3.org/2001/XMLSchema-instance&quot;>
  ;  <soapenv:Body>
 &nbsp;   &nbsp;  <GetResourceProperty
 &nbsp;   &nbsp;   &nbsp;  xmlns=&quot; http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
 &nbsp;   &nbsp;   &nbsp;  &lt;GetResourceProperty&gt;status&lt;/GetResourceProperty>
 ; &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




--
Saludos.
José Antonio Sánchez

Creating client
user name
2006-02-24 09:47:52
Why did this client code not enter in the official release or in the tutorials (specially the latter)?
It's not easy to read, specially when you are not familiar with Maven and you cannot build the cvs tree to test. There are some references to muse 1.0, pubscribe 1.0 and wsrf 1.0 that I don't know how to resolve and the code is full of references to xmlbeans I don't know how to generate.
Also, what are the http://localhost:8080/muse/epr/epr-demo.xml files? They don't get generated when you create a service.

On 2/23/06, Campana Jr., Salvatore J <hp.com">sal.campanahp.com &gt; wrote:

We do not have a client generation utility per se but there was client code in the muse project as a subdirectory….I guess you can check that out…else try pinging the Apache Addressing mailing list and ask them about send headers with the generated client

 

 

The SOAP message I posted is the request I made to the server, I captured it with TCPMon. Indeed it gets to the server, but I get a fault in response saying that I need to send WS-Addressing headers.
I managed to do some operations adding the headers by hand in the following way:

public static void setHeaders(SshPortType client, String to, String action, String resourceId)
 &nbsp;  { &nbsp; 
 &nbsp;   &nbsp;  String pt = "http://abc.com/my/wsdl/namespace ";
  ;   &nbsp;  String wsa = "http://schemas.xmlsoap.org/ws/2004/03/addressing";;
   ;  &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.PrefixedQName resourceIdentifierName = new org.apache.axis.message.PrefixedQName(pt,"ResourceIdentifier","pt&quot;);
&nbsp; &nbsp;  &nbsp;  org.apache.axis.message.PrefixedQName toName = new org.apache.axis.message.PrefixedQName(wsa,"To",&quot;wsa");
 &nbsp;   &nbsp;  org.apache.axis.message.PrefixedQName actionName = new org.apache.axis.message.PrefixedQName(wsa,"Action","wsa&quot;);
&nbsp; &nbsp;  &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.SOAPHeaderElement resourceIdElement = new org.apache.axis.message.SOAPHeaderElement(resourceIdentifierName);
&nbsp; &nbsp;  &nbsp;  resourceIdElement.setValue(resourceId);
&nbsp; &nbsp;  &nbsp;  resourceIdElement.setMustUnderstand(true);
&nbsp; &nbsp;  &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.SOAPHeaderElement toElement = new org.apache.axis.message.SOAPHeaderElement(toName);
&nbsp; &nbsp;  &nbsp;  toElement.setValue(to);
 &nbsp;   &nbsp;  toElement.setMustUnderstand(true);
 &nbsp;   &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.SOAPHeaderElement actionElement = new org.apache.axis.message.SOAPHeaderElement(actionName);
 &nbsp;   &nbsp;  actionElement.setValue(action);
 &nbsp;   &nbsp;  actionElement.setMustUnderstand(true);

&nbsp;    &nbsp;  Stub stub = (Stub)client;
   ;  &nbsp; 
 &nbsp;   &nbsp;  stub.setHeader (toElement);
 &nbsp;   &nbsp;  stub.setHeader(actionElement);
  ;   &nbsp;  stub.setHeader(resourceIdElement);
 &nbsp;   &nbsp; 
 &nbsp;  }

But WS-Addressing is supposed to do that for me, so, apart from generating a Stub that doesn't work with standard wsrf operations like GetResourceProperty, the Addressing WSDL2Java seems usseles to me.
It's a shame that they don't have any documentation at all, appart from a poor commented API documents and a devel mailing list (not a user mailing list).
Does the CVS version of Muse or WSRF has a WSDL2Java that generates client stubs?

On 2/22/06, Campana Jr., Salvatore J <hp.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">sal.campanahp.com>; wrote:

Jose,

 

I am not sure why you are not seeing the headers in the response…This may be a question for the Addressing team as it is their client.  The fact that you got a response shows that you successfully made your request to the server.

 

It just may be something in their objects or the way you are printing out the response, I am not sure and have not had much experience using their generated clients…

 

-S

 

 

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) {
 &nbsp;   &nbsp; 
 &nbsp;   &nbsp;  try {
 &nbsp;   &nbsp;   &nbsp;  String url = "http://localhost:8081/muse/services/Ssh&quot;;

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

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

   ;  &nbsp;   &nbsp;  System.out.println (port.getResourceProperty(new QName(&quot;status&quot;)));

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; &nbsp; xmlnssd="http://www.w3.org/2001/XMLSchema"
&nbsp; &nbsp; xmlnssi=" http://www.w3.org/2001/XMLSchema-instance&quot;>
  ;  <soapenv:Body>
 &nbsp;   &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;  &lt;GetResourceProperty&gt;status&lt;/GetResourceProperty>
 ; &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




--
Saludos.
José Antonio Sánchez




--
Saludos.
José Antonio Sánchez
Creating client
user name
2006-02-24 09:46:10
Why did this client code not enter in the official release or in the tutorials (specially the latter)?
It's not easy to read, specially when you are not familiar with Maven and you cannot build the cvs tree to test. There are some references to muse 1.0, pubscribe 1.0 and wsrf 1.0 that I don't know how to resolve and the code is full of references to xmlbeans I don't know how to generate.
Also, what are the http://localhost:8080/muse/epr/epr-demo.xml files? They don't get generated when you create a service.

On 2/23/06, Campana Jr., Salvatore J <hp.com">sal.campanahp.com &gt; wrote:

We do not have a client generation utility per se but there was client code in the muse project as a subdirectory….I guess you can check that out…else try pinging the Apache Addressing mailing list and ask them about send headers with the generated client

 

 

The SOAP message I posted is the request I made to the server, I captured it with TCPMon. Indeed it gets to the server, but I get a fault in response saying that I need to send WS-Addressing headers.
I managed to do some operations adding the headers by hand in the following way:

public static void setHeaders(SshPortType client, String to, String action, String resourceId)
 &nbsp;  { &nbsp; 
 &nbsp;   &nbsp;  String pt = "http://abc.com/my/wsdl/namespace ";
  ;   &nbsp;  String wsa = "http://schemas.xmlsoap.org/ws/2004/03/addressing";;
   ;  &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.PrefixedQName resourceIdentifierName = new org.apache.axis.message.PrefixedQName(pt,"ResourceIdentifier","pt&quot;);
&nbsp; &nbsp;  &nbsp;  org.apache.axis.message.PrefixedQName toName = new org.apache.axis.message.PrefixedQName(wsa,"To",&quot;wsa");
 &nbsp;   &nbsp;  org.apache.axis.message.PrefixedQName actionName = new org.apache.axis.message.PrefixedQName(wsa,"Action","wsa&quot;);
&nbsp; &nbsp;  &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.SOAPHeaderElement resourceIdElement = new org.apache.axis.message.SOAPHeaderElement(resourceIdentifierName);
&nbsp; &nbsp;  &nbsp;  resourceIdElement.setValue(resourceId);
&nbsp; &nbsp;  &nbsp;  resourceIdElement.setMustUnderstand(true);
&nbsp; &nbsp;  &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.SOAPHeaderElement toElement = new org.apache.axis.message.SOAPHeaderElement(toName);
&nbsp; &nbsp;  &nbsp;  toElement.setValue(to);
 &nbsp;   &nbsp;  toElement.setMustUnderstand(true);
 &nbsp;   &nbsp; 
 &nbsp;   &nbsp;  org.apache.axis.message.SOAPHeaderElement actionElement = new org.apache.axis.message.SOAPHeaderElement(actionName);
 &nbsp;   &nbsp;  actionElement.setValue(action);
 &nbsp;   &nbsp;  actionElement.setMustUnderstand(true);

&nbsp;    &nbsp;  Stub stub = (Stub)client;
   ;  &nbsp; 
 &nbsp;   &nbsp;  stub.setHeader (toElement);
 &nbsp;   &nbsp;  stub.setHeader(actionElement);
  ;   &nbsp;  stub.setHeader(resourceIdElement);
 &nbsp;   &nbsp; 
 &nbsp;  }

But WS-Addressing is supposed to do that for me, so, apart from generating a Stub that doesn't work with standard wsrf operations like GetResourceProperty, the Addressing WSDL2Java seems usseles to me.
It's a shame that they don't have any documentation at all, appart from a poor commented API documents and a devel mailing list (not a user mailing list).
Does the CVS version of Muse or WSRF has a WSDL2Java that generates client stubs?

On 2/22/06, Campana Jr., Salvatore J <hp.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">sal.campanahp.com>; wrote:

Jose,

 

I am not sure why you are not seeing the headers in the response…This may be a question for the Addressing team as it is their client.  The fact that you got a response shows that you successfully made your request to the server.

 

It just may be something in their objects or the way you are printing out the response, I am not sure and have not had much experience using their generated clients…

 

-S

 

 

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) {
 &nbsp;   &nbsp; 
 &nbsp;   &nbsp;  try {
 &nbsp;   &nbsp;   &nbsp;  String url = "http://localhost:8081/muse/services/Ssh&quot;;

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

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

   ;  &nbsp;   &nbsp;  System.out.println (port.getResourceProperty(new QName(&quot;status&quot;)));

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; &nbsp; xmlnssd="http://www.w3.org/2001/XMLSchema"
&nbsp; &nbsp; xmlnssi=" http://www.w3.org/2001/XMLSchema-instance&quot;>
  ;  <soapenv:Body>
 &nbsp;   &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;  &lt;GetResourceProperty&gt;status&lt;/GetResourceProperty>
 ; &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




--
Saludos.
José Antonio Sánchez




--
Saludos.
José Antonio Sánchez
[1-3]

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