tWebService cannot upload byte array

One Star

tWebService cannot upload byte array

Hi Experts,
I am very new to Talend Open studio for Data integration.
I am working on a job that uploads an xml file to my web service (hosted on a different server),
i am reading byte[] from a file that is generated within my job, and passing it to my web service method.
But the component throws following exception..
Jan 9, 2013 1:22:52 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://tempuri.org/}WebService#{http://tempuri.org/}ProcessXml has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: Error writing request body to server
at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:261)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:110)
at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:340)
at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvokerHelper.java:196)
at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvokerHelper.java:237)
at .......
please help me..
Moderator

Re: tWebService cannot upload byte array

Hi,
Your description and info is not enough for us. We need more information to see if is it the job configuration or program issue?
Would you mind posting your job setting screenshots and wsdl file to us in order that we can find out where is wrong and solve it in time.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tWebService cannot upload byte array

Hi Sabrina,
Please find the attached image.

Here is my WSDL (i couldnt attach it as a file except image
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="WebService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"><wsdl:types><xsd:schema targetNamespace="http://tempuri.org/Imports"><xsd:import schemaLocation="http://TestUploadService/WebService.svc?xsd=xsd0" namespace="http://tempuri.org/"/><xsd:import schemaLocation="http://TestUploadService/WebService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/><xsd:import schemaLocation="http://TestUploadService/WebService.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/TestWebService.DataContract"/></xsd:schema></wsdl:types><wsdl:message name="IServiceContract_Ping_InputMessage"><wsdlSmiley Tongueart name="parameters" element="tnsSmiley Tongueing"/></wsdl:message><wsdl:message name="IServiceContract_Ping_OutputMessage"><wsdlSmiley Tongueart name="parameters" element="tnsSmiley TongueingResponse"/></wsdl:message><wsdl:message name="IServiceContract_Login_InputMessage"><wsdlSmiley Tongueart name="parameters" element="tns:Login"/></wsdl:message><wsdl:message name="IServiceContract_Login_OutputMessage"><wsdlSmiley Tongueart name="parameters" element="tns:LoginResponse"/></wsdl:message><wsdl:message name="IServiceContract_ProcessXml_InputMessage"><wsdlSmiley Tongueart name="parameters" element="tnsSmiley TonguerocessXml"/></wsdl:message><wsdl:message name="IServiceContract_ProcessXml_OutputMessage"><wsdlSmiley Tongueart name="parameters" element="tnsSmiley TonguerocessXmlResponse"/></wsdl:message><wsdl:message name="IServiceContract_Logout_InputMessage"><wsdlSmiley Tongueart name="parameters" element="tns:Logout"/></wsdl:message><wsdl:message name="IServiceContract_Logout_OutputMessage"><wsdlSmiley Tongueart name="parameters" element="tns:LogoutResponse"/></wsdl:message><wsdlSmiley TongueortType name="IServiceContract"><wsdlSmiley Surprisedperation name="Ping"><wsdl:input wsam:Action="http://tempuri.org/IServiceContract/Ping" message="tns:IServiceContract_Ping_InputMessage"/><wsdlSmiley Surprisedutput wsam:Action="http://tempuri.org/IServiceContract/PingResponse" message="tns:IServiceContract_Ping_OutputMessage"/></wsdlSmiley Surprisedperation><wsdlSmiley Surprisedperation name="Login"><wsdl:input wsam:Action="http://tempuri.org/IServiceContract/Login" message="tns:IServiceContract_Login_InputMessage"/><wsdlSmiley Surprisedutput wsam:Action="http://tempuri.org/IServiceContract/LoginResponse" message="tns:IServiceContract_Login_OutputMessage"/></wsdlSmiley Surprisedperation><wsdlSmiley Surprisedperation name="ProcessXml"><wsdl:input wsam:Action="http://tempuri.org/IServiceContract/ProcessXml" message="tns:IServiceContract_ProcessXml_InputMessage"/><wsdlSmiley Surprisedutput wsam:Action="http://tempuri.org/IServiceContract/ProcessXmlResponse" message="tns:IServiceContract_ProcessXml_OutputMessage"/></wsdlSmiley Surprisedperation><wsdlSmiley Surprisedperation name="Logout"><wsdl:input wsam:Action="http://tempuri.org/IServiceContract/Logout" message="tns:IServiceContract_Logout_InputMessage"/><wsdlSmiley Surprisedutput wsam:Action="http://tempuri.org/IServiceContract/LogoutResponse" message="tns:IServiceContract_Logout_OutputMessage"/></wsdlSmiley Surprisedperation></wsdlSmiley TongueortType><wsdl:binding name="BasicHttpBinding_IServiceContract" type="tns:IServiceContract"><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdlSmiley Surprisedperation name="Ping"><soapSmiley Surprisedperation soapAction="http://tempuri.org/IServiceContract/Ping" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdlSmiley Surprisedutput><soap:body use="literal"/></wsdlSmiley Surprisedutput></wsdlSmiley Surprisedperation><wsdlSmiley Surprisedperation name="Login"><soapSmiley Surprisedperation soapAction="http://tempuri.org/IServiceContract/Login" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdlSmiley Surprisedutput><soap:body use="literal"/></wsdlSmiley Surprisedutput></wsdlSmiley Surprisedperation><wsdlSmiley Surprisedperation name="ProcessXml"><soapSmiley Surprisedperation soapAction="http://tempuri.org/IServiceContract/ProcessXml" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdlSmiley Surprisedutput><soap:body use="literal"/></wsdlSmiley Surprisedutput></wsdlSmiley Surprisedperation><wsdlSmiley Surprisedperation name="Logout"><soapSmiley Surprisedperation soapAction="http://tempuri.org/IServiceContract/Logout" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdlSmiley Surprisedutput><soap:body use="literal"/></wsdlSmiley Surprisedutput></wsdlSmiley Surprisedperation></wsdl:binding><wsdl:service name="WebService"><wsdlSmiley Tongueort name="BasicHttpBinding_IServiceContract" binding="tns:BasicHttpBinding_IServiceContract"><soap:address location="http://TestUploadService/WebService.svc/soap"/></wsdlSmiley Tongueort></wsdl:service></wsdl:definitions>
Moderator

Re: tWebService cannot upload byte array

Hi,
The job is big. You uploaded the wsdl file's contents, but the wsdl file import some other file
For example http://TestUploadService/WebService.svc?xsd=xsd0.
The screenshots looked so strenuous that we cannot find your issue. Would you mind sending your job .zip file which include all the related file to us, if possible. We will appreciate it very much.
Note: My E-mail: xdshi@talend.com
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tWebService cannot upload byte array

I think you need to use base64 encoding.