One Star

web service process the data from a file XML

Hello
A web service should process the data from a file XML.
For this the following construction was fixed. (pic)
XML-File:
*************************************************
<soapenv:Envelope>
<soapenv:Header>
<TisysHeader>
<CompanyId>232706</CompanyId>
<Username>Test</Username>
<Password>Test123</Password>
<SessionData>?</SessionData>
<ShipperCompanyId>?</ShipperCompanyId>
</TisysHeader>
</soapenv:Header>
<soapenv:Body>
<GetBooking>
<bookingId>1050800787</bookingId>
</GetBooking>
</soapenv:Body>
</soapenv:Envelope>
*************************************************
Now I get following error message:
Starting job TestWS_normal at 12:10 28/07/2009.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tWebServiceInput_1Process(TestWS_normal.java:1167)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tFileInputXML_1Process(TestWS_normal.java:965)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.runJobInTOS(TestWS_normal.java:1497)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.main(TestWS_normal.java:1413)
232706|Test|Test123|?|?|1050800787
Job TestWS_normal ended at 12:10 28/07/2009.

Is the construction right?
What is the mistake?
Where is the mistake?
How can I repair the mistake?
Thanks for your help
6 REPLIES
Employee

Re: web service process the data from a file XML

Hi,
Please replace the filepath separator into your WebServiceInput component.
You have to use a / character ("C:/documents and settings/test/file/test.xml") instead of a \ character ("C:\documents and settings\test\file\test.xml").
Best regards;
One Star

Re: web service process the data from a file XML

Thanks for your answer.
I have change the
But now I get following error-message:
Exception in component tWebServiceInput_1
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Server was unable to process request. ---> Invalid authentication
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Server was unable to process request. ---> Invalid authentication
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:289)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:162)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:119)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tWebServiceInput_1Process(TestWS_normal.java:395)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.runJobInTOS(TestWS_normal.java:688)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.main(TestWS_normal.java:604)
{http://xml.apache.org/axis/}hostname:berserker
Server was unable to process request. ---> Invalid authentication
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:289)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:162)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:119)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tWebServiceInput_1Process(TestWS_normal.java:395)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.runJobInTOS(TestWS_normal.java:688)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.main(TestWS_normal.java:604)
Job TestWS_normal ended at 14:17 29/07/2009.

the authentification notes are the attributes of soap header.
XML-File:
*************************************************
<soapenv:Envelope>
<soapenv:Header>
<TisysHeader>
<CompanyId>232706</CompanyId>
<Username>Test</Username>
<Password>Test123</Password>
<SessionData>?</SessionData>
<ShipperCompanyId>?</ShipperCompanyId>
</TisysHeader>
</soapenv:Header>
<soapenv:Body>
<GetBooking>
<bookingId>1050800787</bookingId>
</GetBooking>
</soapenv:Body>
</soapenv:Envelope>
*************************************************
how can use the web services these attributes?
Community Manager

Re: web service process the data from a file XML

Hello
First, read the xml file and extract the username and password, then put them into global vars.eg:
GetBooking_input--row-->tJavaRow
|
onSubjobOk
|
tWebserviceInput-->tLogRow
on tJavaRow type in:
globalMap.put("username",input_row.Username);
globalMap.put("password",input_row.Password);

On tWebserviceInput, select 'need authentication' option,
in username field: (String)globalMap.get("username")
in password field: (String)globalMap.get("password")
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: web service process the data from a file XML

Thanks for your answer.
My problem is, we need for the authentication
companyid
username
password

In the authentication of the tWebservice you can only use
username & password.
How can I do this?
One Star

Re: web service process the data from a file XML

Now I get following error-message:
Starting job TestWS_normal at 11:05 31/07/2009.
Exception in component tWebServiceInput_1
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Server was unable to process request. ---> Invalid authentication
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Server was unable to process request. ---> Invalid authentication
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:289)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:162)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:119)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tWebServiceInput_1Process(TestWS_normal.java:1094)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tFileInputXML_1Process(TestWS_normal.java:921)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.runJobInTOS(TestWS_normal.java:1387)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.main(TestWS_normal.java:1303)
{http://xml.apache.org/axis/}hostname:berserker
Server was unable to process request. ---> Invalid authentication
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.talend.DynamicInvoker.invokeMethod(DynamicInvoker.java:289)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:162)
at org.talend.DynamicInvoker.main(DynamicInvoker.java:119)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tWebServiceInput_1Process(TestWS_normal.java:1094)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.tFileInputXML_1Process(TestWS_normal.java:921)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.runJobInTOS(TestWS_normal.java:1387)
at bachelorarbeit_webservice.testws_normal_0_1.TestWS_normal.main(TestWS_normal.java:1303)
Job TestWS_normal ended at 11:05 31/07/2009.

whats the misstake?
How can I modify the configuration?
Thanks
Community Manager

Re: web service process the data from a file XML

Hello
faultString: Server was unable to process request. ---> Invalid authentication

It is invalid authentication.
In the authentication of the tWebservice you can only use
username & password.
How can I do this?

I think you need to use the advanced usage of component, so you can customize the code and set the authentication parameters.
See 6226
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business