IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Web Java Discussion :

Transfert de fichiers avec axis


Sujet :

Services Web Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2008
    Messages
    35
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2008
    Messages : 35
    Par défaut Transfert de fichiers avec axis
    Bonjour,
    Je veux transférer des fichier pdf via web service. Je les ai transformé en byte[] puis en string base 64 mais ce string est encore tellement enorme que la requête http ne marche pas...
    avez vous une solution?
    Merci

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    18
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 18
    Par défaut
    Soit activer MTOM ou bien passer par SWA.

    Avec axis2: http://ws.apache.org/axis2/1_5_1/mtom-guide.html#23

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2008
    Messages
    35
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2008
    Messages : 35
    Par défaut
    ca m'a l'air pas mal MTOM mais comment faire en JAVA?

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    18
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 18
    Par défaut
    Et bien le lien plus haut donne des exemples de code java.
    Après la manière dépend de comment tu veux faire. As-tu généré du code avec wsdl2Java? quel databinding?
    Les exemples de code me paraissent assez clairs pourtant...
    un exemple peut-être plus complet: http://www.sayedhashimi.com/CommentV...4e3f5021f.aspx

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2008
    Messages
    35
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2008
    Messages : 35
    Par défaut
    oups désolé j'avais pas vu. j'ai suivi le tuto avec ce dernier lien que tu m'as donné mais à l'éxécution finale j'ai une erreur que je ne comprend pas :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    Exception in thread "main" org.apache.axis2.AxisFault: Unknow type can not serialize
    	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    	at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
    	at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
    	at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
    	at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
    	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
    	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    	at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
    	at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
    	at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
    	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
    	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
    	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
    	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
    	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    	at service.TransfertServiceStub.receiveMTOM(TransfertServiceStub.java:187)
    	at service.TestClient.testMTOM(TestClient.java:104)
    	at service.TestClient.main(TestClient.java:47)
    Caused by: javax.xml.stream.XMLStreamException: Unknow type can not serialize
    	at org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1456)
    	at service.TransfertServiceStub$ReceiveMTOM.serialize(TransfertServiceStub.java:1050)
    	at service.TransfertServiceStub$ReceiveMTOM.serialize(TransfertServiceStub.java:972)
    	at service.TransfertServiceStub$ReceiveMTOM$1.serialize(TransfertServiceStub.java:960)
    	at org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:93)
    	at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:738)
    	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:966)
    	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:995)
    	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:254)
    	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:242)
    	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:995)
    	at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:486)
    	at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
    	... 20 more
    voici aussi ce que dit TCPMON :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    POST /axis2/services/TransfertService HTTP/1.1
    Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_3EC49A4C93B03928CD1264670264141; type="application/xop+xml"; start="<0.urn:uuid:3EC49A4C93B03928CD1264670264142@apache.org>"; start-info="text/xml"
    SOAPAction: "urn:receiveMTOM"
    User-Agent: Axis2
    Host: 127.0.0.1:9080
    Transfer-Encoding: chunked
    et
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    HTTP/1.1 500 Erreur Interne de Servlet
    Server: Apache-Coyote/1.1
    Content-Type: text/xml;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Thu, 28 Jan 2010 09:17:44 GMT
    Connection: close
     
    1c5
    <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode></faultcode><faultstring>Stream Errorjava.io.IOException: Invalid chunk</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    C'est quoi invalid chunk?

    Merci beaucoup!

  6. #6
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    18
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 18
    Par défaut
    Alors il me semble (mais je ne peux rien affirmer) que le chunking est le fait de morceler les grosses trames.
    Du coup c'est peut-être ton serveur qui n'est pas compatible avec ce mécanisme, car l'erreur semble venir du serveur.

    Sinon tu peux peut-être essayer ça dans ton client:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Constants.VALUE_FALSE);

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème de transfert de fichier avec webutil
    Par aznkd dans le forum Forms
    Réponses: 5
    Dernier message: 06/06/2008, 17h03
  2. Transfert de fichier avec wagon
    Par hugo123 dans le forum Maven
    Réponses: 9
    Dernier message: 24/05/2007, 11h16
  3. transfert de fichier avec un socket
    Par horkets dans le forum Réseau
    Réponses: 2
    Dernier message: 22/10/2006, 12h29
  4. Probleme transfert gros fichier avec webdav
    Par cybernetique dans le forum Apache
    Réponses: 1
    Dernier message: 10/05/2006, 09h53
  5. Transfert de fichier avec TServeurSocket et TClientSocket
    Par Cyrilh7 dans le forum C++Builder
    Réponses: 7
    Dernier message: 24/09/2005, 17h53

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo