Thanks for your reply Anne
i read much better the tutorial and i made a client. But, the I still
have a problem.
The client that I made have to sent an attachment to an web service ,
and get an answer from them. The think is that I don't get anything
from the server side.
The system server - client is very simple.
here is a part from WSDL file:
<wsdl:operation name="sendOctet">
<soap:operation soapAction="sendOctet"/>
<wsdl:input>
<mime:multipartRelated>
<mime:part>
<soap:body use="literal"/>
</mime:part>
<mime:part>
<mime:content part="octet"
type="application/octet-stream"/>
</mime:part>
</mime:multipartRelated>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
the interface generated by the wscompile using -import -f:wsi options
is look like:
public interface AttachmentPortType extends java.rmi.Remote {
public java.lang.String sendOctet(javax.activation.DataHandler
octet) throws
java.rmi.RemoteException;
the implementation of interface:
public class AttachmentPortTypeImpl implements AttachmentPortType{
public String sendOctet(javax.activation.DataHandler octet) {
return ("***Service received DataHandler of type: " +
octet.getContentType());
}
and the client :
public static void main(String[] args) {
try {
Stub proxy = proxy();
AttachmentPortType req = (AttachmentPortType) proxy;
FileDataSource file = new FileDataSource("e://lucru/IMSClient/conf/test.txt");
DataHandler dh = new DataHandler(file);
String request = req.sendOctet(dh);
System.out.println("response " + request);
} catch (Exception e) {
// TODO: handle exception
}
}
public static Stub proxy(){
return (Stub) (new Attachment_Impl().getAttachmentPort());
}
when I run this client i don't receive anything.
I do something wrong in the client in order to transmit an attachment ?
How can i see if the client send something to the web service ? I try
with TCP Monitor from Axis Apache but don't capture any SOAP Message
in this case.
Any help will be appreciated .
thanks
On 7/18/05, Anne Thomas Manes <atmanes_at_gmail.com> wrote:
> The service at the endpoint uses the qname of the child element of the
> SOAP Body to determine how to dispatch the request. That information
> must be defined as part of the service configuration. Your client must
> construct an appropriate message (as specified by the WSDL file), and
> then it should work. The client does not need to indicate the
> service's method name.
>
> On 7/14/05, Oancea Daniel <doancea_at_gmail.com> wrote:
> > hi everybody,
> >
> > a read the Java Web Services Tutorial and I build an JAX-RPC client
> > which has to interact whit a web service. The problem is that i don't
> > now exactly how to tell to my client to try to reach a particular
> > method from the server side. In the tutorial I find that I have to use
> > <call> method to send a message, which have two arguments: the message
> > being sent and the destination to which the message should go. Is
> > nothing about the method that i want to address this message.
> >
> > I done something like :
> >
> > SOAPMessage response = connection.call(message, endpoint);
> >
> > where <endpoint> is the address location of the web service.
> >
> >
> > Thanks
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>