6 Replies Latest reply on Sep 11, 2007 8:38 AM by 807605

    SOAP and java problem....create SOAPMessage from file. Extremely important!

    807605
      Hi,
      I've got a problem related to usage of SOAP in Java. I receive a file containing SOAP message with XML attachment. I store it on hard disk.
      Then I create a SOAP message as it is shown in source code below.
      When I try to get the attachment, the method doesn't return anything.
      If I pass to method createMessage value null instead of new MimeHeaders(), the result is the same.

      What can be the problem? How to solve it? Any idea?

      Looking forward any support.

      BR,
      rafikoko
      MessageFactory factory = MessageFactory.newInstance();
      SOAPMessage message = factory.createMessage(new MimeHeaders(), new FileInputStream(xmlFile));
      Iterator attachments = message.getAttachments();
       
      log4j.error("TEST:before while:"+message.countAttachments());
      while(attachments.hasNext()){
      log4j.error("TEST:while");
      Object finvoice = attachments.next();
      log4j.error("TEST:Finvoice:"+finvoice);
      }
        • 1. Re: SOAP and java problem....create SOAPMessage from file. Extremely important!
          807605
          I attach also a SOAP message. Perhaps it will help you.

          <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
          <SOAP-ENV:Header>
          <eb:MessageHeader xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"
          SOAP-ENV:mustUnderstand="1" eb:id="20030222133003285">
              <eb:From>
                 <eb:PartyId>FI9859292720000267</eb:PartyId>
                 <eb:Role>Sender</eb:Role>
              </eb:From>
              <eb:From>
                 <eb:PartyId>OKOYFIHH</eb:PartyId>
                 <eb:Role>Intermediator</eb:Role>
              </eb:From>
              <eb:To>
                 <eb:PartyId>FI3329501800008512</eb:PartyId>
                 <eb:Role>Receiver</eb:Role>
              </eb:To>
              <eb:To>
                 <eb:PartyId>NDEAFIHH</eb:PartyId>
                 <eb:Role>Intermediator</eb:Role>
              </eb:To>
          <eb:CPAId>yoursandmycpa</eb:CPAId>
          <eb:ConversationId>nnnnn</eb:ConversationId>
          <eb:Service>Routing</eb:Service>
          <eb:Action>ProcessInvoice</eb:Action>
          <eb:MessageData>
               <eb:MessageId>1</eb:MessageId>
               <eb:Timestamp>2003-01-22T11:12:12+02</eb:Timestamp>
               <eb:RefToMessageId/> 
          </eb:MessageData>
          </eb:MessageHeader>
          </SOAP-ENV:Header>
          <SOAP-ENV:Body>
          <eb:Manifest eb:id="Manifest" eb:version="2.0">
          <eb:Reference eb:id="Finvoice" xlink:href="20020209-133003">
          <eb:schema eb:location="http://www.pankkiyhdistys.fi/verkkolasku/finvoice/finvoice.xsd" eb:version="2.0"/>
          </eb:Reference>
          </eb:Manifest>
          </SOAP-ENV:Body>
          </SOAP-ENV:Envelope>
          <?xml version="1.0" encoding="ISO-8859-1"?>
          <!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Jussi Paasikallio (OKOBANK Group) -->
          <!--Sample XML file generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
          <!DOCTYPE Finvoice SYSTEM "Finvoice.dtd">
          <?xml-stylesheet type="text/xsl" href="Finvoice.xsl"?>
          <!--Finvoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\l\finvoice\Finvoice.xsd" Version="1.0"-->
          <Finvoice Version="1.0">
               <SellerPartyDetails>
                    <SellerPartyIdentifier>0123456-7</SellerPartyIdentifier>
                    <SellerOrganisationName>Pullin Kala Oy</SellerOrganisationName>
                    <SellerOrganisationTaxCode>0123456-7</SellerOrganisationTaxCode>
                    <SellerPostalAddressDetails>
                         <SellerStreetName>Haapatie 7</SellerStreetName>
                         <SellerTownName>Helsinki</SellerTownName>
                         <SellerPostCodeIdentifier>00100</SellerPostCodeIdentifier>
                         <CountryCode>FI</CountryCode>
                         <CountryName>FINLAND</CountryName>
                         <SellerPostOfficeBoxIdentifier>PL 302</SellerPostOfficeBoxIdentifier>
                    </SellerPostalAddressDetails>
               </SellerPartyDetails>
               <SellerContactPersonName>Hanna Paananen</SellerContactPersonName>
               <SellerCommunicationDetails>
                    <SellerPhoneNumberIdentifier>050-5432659</SellerPhoneNumberIdentifier>
                    <SellerEmailaddressIdentifier>hanna.paananen@pullinkala.fi</SellerEmailaddressIdentifier>
               </SellerCommunicationDetails>
               <SellerInformationDetails>
                    <SellerHomeTownName>Helsinki</SellerHomeTownName>
                    <SellerVatRegistrationText>Alv.Rek</SellerVatRegistrationText>
                    <SellerVatRegistrationDate Format="CCYYMMDD">19990321</SellerVatRegistrationDate>
                    <SellerPhoneNumber>(09) 542 1222</SellerPhoneNumber>
                    <SellerFaxNumber>(09) 542 2221</SellerFaxNumber>
                    <SellerCommonEmailaddressIdentifier>palaute@pullinkala.fi</SellerCommonEmailaddressIdentifier>
                    <SellerWebaddressIdentifier>www.pullinkala.fi</SellerWebaddressIdentifier>
                    <SellerAccountDetails>
                         <SellerAccountID IdentificationSchemeName="IBAN">FI1234567890123456</SellerAccountID>
                         <SellerBic IdentificationSchemeName="BIC">OKOYFIHH</SellerBic>
                    </SellerAccountDetails>
                    <SellerAccountDetails>
                         <SellerAccountID IdentificationSchemeName="IBAN">FI1234567890123456</SellerAccountID>
                         <SellerBic IdentificationSchemeName="BIC">NDEAFIHH</SellerBic>
                    </SellerAccountDetails>
               </SellerInformationDetails>
               <BuyerPartyDetails>
                    <BuyerPartyIdentifier>CL12221</BuyerPartyIdentifier>
                    <BuyerOrganisationName>Kalakauppa Vilkkunen</BuyerOrganisationName>
                    <BuyerPostalAddressDetails>
                         <BuyerStreetName>Haapatie 1</BuyerStreetName>
                         <BuyerTownName>Helsinki</BuyerTownName>
                         <BuyerPostCodeIdentifier>00211</BuyerPostCodeIdentifier>
                         <CountryCode/>
                         <CountryName/>
                         <BuyerPostOfficeBoxIdentifier/>
                    </BuyerPostalAddressDetails>
               </BuyerPartyDetails>
               <BuyerContactPersonName>Maija Vikkunen</BuyerContactPersonName>
               <BuyerCommunicationDetails>
                    <BuyerPhoneNumberIdentifier>(09)221222</BuyerPhoneNumberIdentifier>
                    <BuyerEmailaddressIdentifier>maija.vilkkunen@kolumbus.fi</BuyerEmailaddressIdentifier>
               </BuyerCommunicationDetails>
               <InvoiceDetails>
                    <InvoiceTypeCode>INV01</InvoiceTypeCode>
                    <InvoiceTypeText>LASKU</InvoiceTypeText>
                    <OriginCode>Origin</OriginCode>
                    <InvoiceNumber>1/2002</InvoiceNumber>
                    <InvoiceDate Format="CCYYMMDD">20020612</InvoiceDate>
                    <SellerReferenceIdentifier>212</SellerReferenceIdentifier>
                    <OrderIdentifier>TI0988</OrderIdentifier>
                    <InvoiceTotalVatExcludedAmount AmountCurrencyIdentifier="EUR">100,00</InvoiceTotalVatExcludedAmount>
                    <InvoiceTotalVatAmount AmountCurrencyIdentifier="EUR">22,00</InvoiceTotalVatAmount>
                    <InvoiceTotalVatIncludedAmount AmountCurrencyIdentifier="EUR">122,00</InvoiceTotalVatIncludedAmount>
                    <ShortProposedAccountIdentifier>9922</ShortProposedAccountIdentifier>
                    <NormalProposedAccountIdentifier>8822</NormalProposedAccountIdentifier>
                    <AccountDimensionText>4500</AccountDimensionText>
                    <VatSpecificationDetails>
                         <VatBaseAmount AmountCurrencyIdentifier="EUR">100,00</VatBaseAmount>
                         <VatRatePercent>22</VatRatePercent>
                         <VatRateAmount AmountCurrencyIdentifier="EUR">22,00</VatRateAmount>
                    </VatSpecificationDetails>
                    <PaymentTermsDetails>
                         <PaymentTermsFreeText>14 p�iv�� netto</PaymentTermsFreeText>
                         <PaymentOverDueFineDetails>
                              <PaymentOverDueFineFreeText>Yliaikakorko 16%</PaymentOverDueFineFreeText>
                              <PaymentOverDueFinePercent>16</PaymentOverDueFinePercent>
                         </PaymentOverDueFineDetails>
                    </PaymentTermsDetails>
               </InvoiceDetails>
               <PaymentStatusDetails>
                    <PaymentStatusCode>NOTPAID</PaymentStatusCode>
               </PaymentStatusDetails>
               <VirtualBankBarcode>250003210002229000122000000000000000862074102062800009</VirtualBankBarcode>
               <InvoiceRow>
                    <ArticleIdentifier>123213123332123</ArticleIdentifier>
                    <ArticleName>TUURA</ArticleName>
                    <BuyerArticleIdentifier>1232321232332</BuyerArticleIdentifier>
                    <DeliveredQuantity QuantityUnitCode="Kpl">10</DeliveredQuantity>
                    <OrderedQuantity QuantityUnitCode="Kpl">10</OrderedQuantity>
                    <UnitPriceAmount AmountCurrencyIdentifier="EUR" UnitPriceUnitCode="e/kpl">5,00</UnitPriceAmount>
                    <RowIdentifier>221</RowIdentifier>
                    <RowIdentifierDate Format="CCYYMMDD">20020611</RowIdentifierDate>
                    <RowDeliveryDate Format="CCYYMMDD">20020615</RowDeliveryDate>
                    <RowShortProposedAccountIdentifier>9922</RowShortProposedAccountIdentifier>
                    <RowNormalProposedAccountIdentifier>8822</RowNormalProposedAccountIdentifier>
                    <RowAccountDimensionText>4500</RowAccountDimensionText>
                    <RowFreeText>Tuurat myyd��n varsien kanssa.</RowFreeText>
                    <RowDiscountPercent>0</RowDiscountPercent>
                    <RowVatRatePercent>22</RowVatRatePercent>
                    <RowVatAmount AmountCurrencyIdentifier="EUR">11,00</RowVatAmount>
                    <RowVatExcludedAmount AmountCurrencyIdentifier="EUR">50,00</RowVatExcludedAmount>
                    <RowAmount AmountCurrencyIdentifier="EUR">61,00</RowAmount>
               </InvoiceRow>
               <InvoiceRow>
                    <ArticleIdentifier>123213123332123</ArticleIdentifier>
                    <ArticleName>HUOLLON VUOSIMAKSU</ArticleName>
                    <StartDate Format="CCYYMMDDHHMMSS">20020611000000</StartDate>
                    <EndDate Format="CCYYMMDDHHMMSS">2003062011000000</EndDate>
                    <RowShortProposedAccountIdentifier>9923</RowShortProposedAccountIdentifier>
                    <RowNormalProposedAccountIdentifier>8823</RowNormalProposedAccountIdentifier>
                    <RowAccountDimensionText>4500</RowAccountDimensionText>
                    <RowVatRatePercent>22</RowVatRatePercent>
                    <RowVatAmount AmountCurrencyIdentifier="EUR">11,00</RowVatAmount>
                    <RowVatExcludedAmount AmountCurrencyIdentifier="EUR">50,00</RowVatExcludedAmount>
                    <RowAmount AmountCurrencyIdentifier="EUR">61,00</RowAmount>
               </InvoiceRow>
               <EpiDetails>
                    <EpiIdentificationDetails>
                         <EpiDate Format="CCYYMMDD">20020612</EpiDate>
                         <EpiReference>1</EpiReference> 
                    </EpiIdentificationDetails>
                    <EpiPartyDetails>
                         <EpiBfiPartyDetails>
                              <EpiBfiIdentifier IdentificationSchemeName="BIC">OKOYFIHH</EpiBfiIdentifier>
                         </EpiBfiPartyDetails>
                         <EpiBeneficiaryPartyDetails>
                              <EpiNameAddressDetails>Pullin Kala</EpiNameAddressDetails>
                              <EpiAccountID IdentificationSchemeName="IBAN">FI1234567890123456</EpiAccountID>
                         </EpiBeneficiaryPartyDetails>
                    </EpiPartyDetails>
                    <EpiPaymentInstructionDetails>
                         <EpiRemittanceInfoIdentifier>8620741</EpiRemittanceInfoIdentifier>
                         <EpiInstructedAmount AmountCurrencyIdentifier="EUR">122,00</EpiInstructedAmount>
                         <EpiCharge ChargeOption="SHA">SHA</EpiCharge>
                         <EpiDateOptionDate Format="CCYYMMDD">20020628</EpiDateOptionDate>
                    </EpiPaymentInstructionDetails>
               </EpiDetails>
          </Finvoice>
          • 2. Re: SOAP and java problem....create SOAPMessage from file. Extremely import
            807605
            The fact that you included ' Extremely important' in your post title will probably make most of the people that can help you just ignore you.

            One big hint: Never assume you are more important than the other people who need help. Therefore dont include urgent, or important in the title of your post.

            Anyways, good luck
            • 3. Re: SOAP and java problem....create SOAPMessage from file. Extremely import
              807605
              Thanks for the advice. I agree it wasn't wise to put these words into topic. Anyway could anybody help me?
              • 4. Re: SOAP and java problem....create SOAPMessage from file. Extremely import
                807605
                I do need the support at this point. Pls help me to solve this problem. I don't believe that nobody has faced similar problem.
                • 5. Re: SOAP and java problem....create SOAPMessage from file. Extremely import
                  807605
                  So it's so extremely important that you didn't bother checking back for several days, eh? Ah well, guess it can't be all that important after all
                  • 6. Re: SOAP and java problem....create SOAPMessage from file. Extremely import
                    807605
                    I've written in one of my previous posts that it was mistake to use words "extremely important". In fact it is extremely important for me, but it wasn't urgent. I agree that it was misleading. Sorry for that. I will know in the future that I shouldn't use this kind of words in the subject. I was involved in other task for a few last days, but today I am coming back to this problem. Could you please stop finding a fault with me and help if you have an appropriate knowledge?