• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

SOAP compatibility

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new in Soap and have a question about compatibility.
I wrote a Soap with Attachment webservice with cxf and soap1.2.

The EndPoint of the WebService shows like this:


I also wrote a Java based Client:


Questions:
-Is the Parameter: DataHandler a standard for Attachments? Can other clients who are not written in Java use this EndPoint? ( I tried with the Paramter: SOAPMessage message but get a Unmarshalling Error: Unable to create an instance of javax.xml.soap.SOAPMessage ERROR)
-In WebService: data.getInputStream() is ok, dataHandler.getName() is NULL also it filled at ClientSide, anyone a idea?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
When sending files or similar with SOAP messages, you should use SOAP with Attachments.
When constructing a SOAP message with attachments using Java, you commonly use the SAAJ API.
Examples and explanation can be found in my book, which can be freely downloaded at: http://www.slideshare.net/krizsan/scdjws-5-study-notes-3085287
Please refer to sections: 2.3 and 5.7
Best wishes!
 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not using JAX-WS with @MTom feature?

SOAP Message Transmission Optimization Mechanism (MTOM) specifies an optimized method for sending binary data as part of a SOAP message.

1. JAX-WS CXF:

http://cxf.apache.org/docs/mtom.html
http://cxf.apache.org/docs/mtom-attachments-with-jaxb.html

See apache-cxf-2.4.2\samples\mtom

2. JAX-WS Metro RI:

http://metro.java.net/guide/Binary_Attachments__MTOM_.html

See xmime:expectedContentType to Java type mapping
6.2.2. Enabling MTOM on server
6.2.3. Enabling MTOM on client
 
ayi bogan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply,

If i use Soap Message like:

Client:


WebService:

i get this Exception:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: Unable to create an instance of javax.xml.soap.SOAPMessage
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
at $Proxy31.create(Unknown Source)
at de.EndPointClient.main(EndPointClient.java:55)
Caused by: org.apache.cxf.binding.soap.SoapFault: Unmarshalling Error: Unable to create an instance of javax.xml.soap.SOAPMessage
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:107)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:801)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1627)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:535)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:465)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:368)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:321)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
... 2 more


I used the sample sites which you post, they used DataHandler as Parameter.

 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Developing web services, Part 3: File uploading web service built with Apache CFX
http://www.ibm.com/developerworks/webservices/library/ws-devaxis2part3/section3.html
See MTOM enabled: Listing 4. cxf.xml

OR this http://skhanzada.wordpress.com/2010/09/13/large-attachements-with-mtom-and-cxf/

2. Whichever helps. Good luck.
 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic