Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I can create XML file using XmlTextWriter (vb.net). How do I create and add that SOAP message to my same XML file?

<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:version="2.0">
      <eb:From>
        <eb:PartyId>00371234567890</eb:PartyId>
        <eb:Role>Sender</eb:Role>
      </eb:From>
      <eb:From>
        <eb:PartyId>NDEAFIHH</eb:PartyId>
        <eb:Role>Intermediator</eb:Role>
      </eb:From>
      <eb:To>
        <eb:PartyId>00370987654321</eb:PartyId>
        <eb:Role>Receiver</eb:Role>
      </eb:To>
      <eb:To>
        <eb:PartyId>003710948874</eb:PartyId>
        <eb:Role>Intermediator</eb:Role>
      </eb:To>
      <eb:CPAId>yoursandmycpa</eb:CPAId>
      <eb:ConversationId>123123</eb:ConversationId>
      <eb:Service>Routing</eb:Service>
      <eb:Action>ProcessInvoice</eb:Action>
      <eb:MessageData>
      <eb:MessageId>123</eb:MessageId>
      <eb:Timestamp>2013-08-14T12:17:50</eb:Timestamp>
      <eb:RefToMessageId>456</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="200911180001">
        <eb:Schema eb:location="http://www.finvoice.info/finvoice.xsd" eb:version="2.0"/>
      </eb:Reference>
    </eb:Manifest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="ISO-8859-15"?>
<?xml-stylesheet href="Finvoice.xsl" type="text/xsl"?>


What I have tried:

This XML file I created with XmlTextWriter

<?xml version="1.0" encoding="iso-8859-15"?>
<?xml-stylesheet href='Finvoice.xsl' type='text/xsl'?>
<Finvoice Version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Finvoice3.0.xsd">
  <MessageTransmissionDetails>
    <MessageSenderDetails>
      <FromIdentifier SchemeID="0037">00371234567890</FromIdentifier>
      <FromIntermediator>NDEAFIHH</FromIntermediator>
    </MessageSenderDetails>
    <MessageReceiverDetails>
      <ToIdentifier SchemeID="0037">00371234567890</ToIdentifier>
      <ToIntermediator>00371234567890</ToIntermediator>
    </MessageReceiverDetails>
    <MessageDetails>
      <MessageIdentifier>12345</MessageIdentifier>
      <MessageTimeStamp>2023-05-11T12:29:36</MessageTimeStamp>
      <SpecificationIdentifier>EN16931</SpecificationIdentifier>
    </MessageDetails>
  </MessageTransmissionDetails>
  <SellerPartyDetails>
    <SellerPartyIdentifier>12345678</SellerPartyIdentifier>
    <SellerOrganisationName>Seller Company</SellerOrganisationName>
    <SellerOrganisationTaxCode>FI12345678</SellerOrganisationTaxCode>
    <SellerPostalAddressDetails>
      <SellerStreetName>Street 11</SellerStreetName>
      <SellerTownName>Town</SellerTownName>
      <SellerPostCodeIdentifier>12345</SellerPostCodeIdentifier>
      <CountryCode>FI</CountryCode>
      <CountryName>Suomi</CountryName>
    </SellerPostalAddressDetails>
  </SellerPartyDetails>
</Finvoice>
Posted
Updated 10-May-23 23:47pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900