users@jax-rpc.java.net

Re: Client with attachments!

From: Oancea Daniel <doancea_at_gmail.com>
Date: Mon, 26 Sep 2005 17:46:40 +0100

Vivek,

You right !!!
Because I just want to avoid to put some garbage here (the file that I have
to receive is a binary file) I replace that on the server site with other, a
simple XML file.(this was the reason that DataHandler set the contain - type
to text/XML automatically) This was the cause! I just replaced with file
that should be sent with binary one, and I got the InputStream of the
attachment on client side.

Thanks again Vivek for your time!

Daniel

On 9/26/05, Vivek Pandey <Vivek.Pandey_at_sun.com> wrote:
>
> I just noticed that the 'response' attachment is send using
> Content-Type:text/xml, where as the WSDL mime binding says it should be
> appliation/octet-stream.
>
> Looks like the server side implementation code creates DataHandler with
> content-Type text/xml, it should be application/octet-stream.
>
> -vivek.
>
>
>
>
> Oancea Daniel wrote:
> > Hi again,
> > The tool that I'm used it is made by the Axis, called TCPMonitor , and
> > actually this is what I see :
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/">
> > <env:Body/>
> > </env:Envelope>------=_Part_0_12812081.1127729710453Content-Type:
> > text/xmlContent-Id:
> > <response=6126209a-30cc-4cdc-a8cd-275943ec3ed0_at_jaxrpc.sun.com
> > <mailto:6126209a-30cc-4cdc-a8cd-275943ec3ed0_at_jaxrpc.sun.com>>
> > <properties>
> > <test1>1</test1>
> > <test2>2</test2>
> > <test3>3</test3>
> > <test4>4</test4>
> > </properties>------=_Part_0_12812081.1127729710453--
> >
> > But, I don't think Content-Id is part of Content-Type. Maybe is caused
> > by the way that this tool formatting the logs.
> > Any sugestion?
> >
> > thank's
> > Daniel
> >
> >
> > On 9/23/05, *Vivek Pandey* <Vivek.Pandey_at_sun.com
> > <mailto:Vivek.Pandey_at_sun.com>> wrote:
> >
> > The content-id in response message appears to be joined with
> > Content-Type:
> >
> > </env:Envelope>------=_Part_2_32717744.1127469653710Content-Type:
> > text/xmlContent-Id:
> > <response= 1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com>
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com>>>
> >
> > It should have been:
> >
> > </env:Envelope>
> > ------=_Part_2_32717744.1127469653710
> > Content-Type: text/xml
> > Content-Id:
> > <response=1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com>
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com>>>
> >
> > Is this what you see on your capture tool or is it cut-paste error? In
> > either case looks like a bug in JAXPRC.
> >
> > thanks,
> >
> > -vivek.
> >
> > Oancea Daniel wrote:
> >
> > > Hi ,
> > >
> > > here is my entire log message:
> > >
> > > ==============
> > > Listen Port: 1201
> > > Target Host: 127.0.0.1 <http://127.0.0.1> <http://127.0.0.1> <
> http://127.0.0.1>
> > > Target Port: 8080
> > > ==== Request ====
> > > POST /streamFile/Stream HTTP/1.1
> > > Content-Type: text/xml; charset=utf-8
> > > Content-Length: 384
> > > SOAPAction: "getFile"
> > > User-Agent: Java/1.5.0_03
> > > Host: 127.0.0.1:1201 <http://127.0.0.1:1201> <http://127.0.0.1:1201>
> > <http://127.0.0.1:1201 <http://127.0.0.1:1201>>
> > > Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> > > Connection: keep-alive
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <env:Envelope xmlns:env="
> > http://schemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/
> > <http://schemas.xmlsoap.org/soap/encoding/>">
> > > <env:Body>
> > > <ans1:request
> > > xmlns:ans1="http://www.your-company.com/StreamFile.xsd1"
> > > < http://www.your-company.com/StreamFile.xsd1%22>>2</ans1:request>
> > > </env:Body>
> > > </env:Envelope>
> > > ==== Response ====
> > > HTTP/1.1 200 OK
> > > Accept: application/fastinfoset, text/html, image/gif, image/jpeg, *;
> > > q=.2, */*; q=.2
> > > SOAPAction: ""
> > > Content-Type: multipart/related; type="text/xml";
> > > boundary="----=_Part_2_32717744.1127469653710"
> > > Transfer-Encoding: chunked
> > > Date: Fri, 23 Sep 2005 10:00:53 GMT
> > > Server: Sun-Java-System/Web-Services-Pack-1.4
> > >
> > > 2be
> > > ------=_Part_2_32717744.1127469653710
> > > Content-Type: text/xml; charset=utf-8
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <env:Envelope xmlns:env="
> > http://schemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/">
> > > <env:Body/>
> > > </env:Envelope>------=_Part_2_32717744.1127469653710Content-Type:
> > > text/xmlContent-Id:
> > > <response=1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com>
> > > <mailto: 1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com
> > <mailto:1afa54bf-f2b5-4f9a-b266-abc1d1f9186e_at_jaxrpc.sun.com>>>
> > > <properties>
> > > <test1>1</test1>
> > > <test2>2</test2>
> > > <test3>3</test3>
> > > <test4>4</test4>
> > > </properties>------=_Part_2_32717744.1127469653710--
> > > 0
> > >
> > >
> > > ==============
> > >
> > > Thanks,
> > > Daniel
> > >
> > >
> > >
> > > On 9/22/05, *Vivek Pandey* <Vivek.Pandey_at_sun.com
> > <mailto:Vivek.Pandey_at_sun.com>
> > > <mailto:Vivek.Pandey_at_sun.com <mailto:Vivek.Pandey_at_sun.com>>> wrote:
> > >
> > > can you send the complete message log from your monitoring tool
> > > including the attachment part. Looks like the Content-ID of the
> > > attachment is not whats expected by the client side stub.
> > >
> > > -vivek.
> > >
> > > Oancea Daniel wrote:
> > >
> > > > Hi all,
> > > >
> > > > I have an problem with an client that has to receive an
> > attachment.
> > > > From what I see, using an monitoring tool, the response
> > SOAP Message
> > > > contain the attachment that suppose to arrive on client side,
> > > but the
> > > > client is not capable to dispatch it.
> > > >
> > > > Here is my operation description from the WSDL file:
> > > >
> > > > <wsdl:operation name="getFile">
> > > > <soap:operation soapAction="getFile"/>
> > > > <wsdl:input>
> > > > <soap:body parts="request" use="literal"/>
> > > > </wsdl:input>
> > > > <wsdl:output>
> > > > <mime:multipartRelated>
> > > > <mime:part>
> > > > <soap:body parts="" use="literal"/>
> > > > </mime:part>
> > > > <mime:part>
> > > > <mime:content part="response"
> > > > type="application/octet-stream"/>
> > > > </mime:part>
> > > > </mime:multipartRelated>
> > > > </wsdl:output>
> > > > </wsdl:operation>
> > > >
> > > > on the client side I made something like that:
> > > > .............
> > > > DataHandler dh = client.getFile(2);
> > > > int resp = data.getInputStream().available();
> > > > System.out.println("receive: "+resp+" bytes!");
> > > > ...............
> > > >
> > > > the error response is:
> > > > java.rmi.RemoteException : no attachment with id "response"
> > found in
> > > > message; nested exception is:
> > > > [java] no attachment with id "response" found in message
> > > > [java] at
> > > > enthrone.StreamFilePortType_Stub.getFile
> > > (StreamFilePortType_Stub.java:79)
> > > > [java] at enthrone.Client.main(Client.java:24)
> > > > [java] Caused by: no attachment with id "response"
> > found in
> > > message
> > > > [java] at
> > > > enthrone.StreamFilePortType_Stub.getAttachment
> > > (StreamFilePortType_Stub.java:194)
> > > > [java] at
> > > >
> > >
> > enthrone.StreamFilePortType_Stub.getFile
> (StreamFilePortType_Stub.java:72)
> > > > [java] ... 1 more
> > > >
> > > > Any suggestions will be overcome!
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > > --
> > > Vivek Pandey
> > > Web Services Standards and Technologies
> > > Sun Microsystems Inc.
> > >
> > >
> > >
> > >
> >
> > --
> > Vivek Pandey
> > Web Services Standards and Technologies
> > Sun Microsystems Inc.
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>