Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 896819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:47:27+00:00 2026-05-15T14:47:27+00:00

I’m trying to communicate with a soap service and I know that I should

  • 0

I’m trying to communicate with a soap service and I know that I should send a SOAP Envelope like this:

POST /webpay_test/SveaWebPay.asmx HTTP/1.1
Host: webservices.sveaekonomi.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://webservices.sveaekonomi.se/webpay/CreateOrder"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreateOrder xmlns="https://webservices.sveaekonomi.se/webpay">
      <request>
        <Order>
          <ClientOrderNr>string</ClientOrderNr>
          <CustomerReference>string</CustomerReference>
          <OrderDate>dateTime</OrderDate>
          <CountryCode>string</CountryCode>
          <SecurityNumber>string</SecurityNumber>
          <CustomerEmail>string</CustomerEmail>
          <IsCompany>boolean</IsCompany>
          <PreApprovedCustomerId>long</PreApprovedCustomerId>
          <AddressSelector>string</AddressSelector>
        </Order>
        <InvoiceRows>
          <ClientInvoiceRowInfo>
            <ArticleNr>string</ArticleNr>
            <Description>string</Description>
            <PricePerUnit>double</PricePerUnit>
            <NrOfUnits>double</NrOfUnits>
            <Unit>string</Unit>
            <VatPercent>int</VatPercent>
            <DiscountPercent>int</DiscountPercent>
            <ClientOrderRowNr>int</ClientOrderRowNr>
          </ClientInvoiceRowInfo>
          <ClientInvoiceRowInfo>
            <ArticleNr>string</ArticleNr>
            <Description>string</Description>
            <PricePerUnit>double</PricePerUnit>
            <NrOfUnits>double</NrOfUnits>
            <Unit>string</Unit>
            <VatPercent>int</VatPercent>
            <DiscountPercent>int</DiscountPercent>
            <ClientOrderRowNr>int</ClientOrderRowNr>
          </ClientInvoiceRowInfo>
        </InvoiceRows>
      </request>
    </CreateOrder>
  </soap:Body>
</soap:Envelope>

here is the code I’ve wrote:

client = Savon::Client.new("https://webservices.sveaekonomi.se/webpay_test/SveaWebPay.asmx?wsdl")
res = client.create_order do |soap|  
    soap.namespace = "https://webservices.sveaekonomi.se/webpay_test/CreateOrder.asmx"
    soap.body = { :auth         => {  :username => "username", :password => "pass", :client_number => "1111" }, 
                  :order        => {  :client_order_nr => "1000000", :customer_reference => "4212", :order_date => Date.today, 
                                      :country_code => "SE", :security_number => "1111111111", :is_company => false, 
                                      :customer_email => "me@gmail.com", :pre_approved_customer_id => 0 },
                  :invoice_rows => { :client_invoice_row_info => { :article_nr => "x100", :description => "something cool -- description",
                                      :price_per_unit => 100, :nr_of_units => 3, :unit => "SEK", :vat_percent => 25,
                                      :discount_percent => 0, :client_order_row_nr => "1"},
                                     :client_invoice_row_info => { :article_nr => "x200", :description => "something cooler -- description",
                                      :price_per_unit => 200, :nr_of_units => 2, :unit => "SEK", :vat_percent => 25,
                                      :discount_percent => 0, :client_order_row_nr => "1" }  
                                   }
    }
end

and it generates this, which is different from what I have as the template and that’s why I’m getting an error:

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:wsdl="https://webservices.sveaekonomi.se/webpay_test/CreateOrder.asmx" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<wsdl:CreateOrder>
<invoiceRows>
  <clientInvoiceRowInfo>
    <clientOrderRowNr>1</clientOrderRowNr>
    <pricePerUnit>200</pricePerUnit>
    <nrOfUnits>2</nrOfUnits>
    <unit>SEK</unit>
    <vatPercent>25</vatPercent>
    <articleNr>x200</articleNr>
    <discountPercent>0</discountPercent>
    <description>something cooler -- description</description>
  </clientInvoiceRowInfo>
</invoiceRows>
<order>
    <customerEmail>me@gmail.com</customerEmail>
    <preApprovedCustomerId>0</preApprovedCustomerId>
    <countryCode>SE</countryCode>
    <clientOrderNr>1000000</clientOrderNr>
    <securityNumber>11111111</securityNumber>
    <customerReference>4212</customerReference>
    <isCompany>false</isCompany>
    <orderDate>2010-06-28</orderDate>
</order>
<auth>
    <password>pass</password>
    <clientNumber>1111</clientNumber>
    <username>username</username>
</auth>
</wsdl:CreateOrder>
</env:Body>
</env:Envelope>

and here is the response:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <CreateOrderResponse xmlns="https://webservices.sveaekonomi.se/webpay">
      <CreateOrderResult>
        <Accepted>false</Accepted>
        <ErrorMessage>Failed to create or authorize order</ErrorMessage>
        <SveaOrderNr>0</SveaOrderNr>
        <RejectionCode>Error</RejectionCode>
        <WillBuyInvoices xsi:nil="true" />
        <AuthorizeId>0</AuthorizeId>
        <AuthorizedAmount xsi:nil="true" />
        <ExpirationDate xsi:nil="true" />
      </CreateOrderResult>
    </CreateOrderResponse>
  </soap:Body>
</soap:Envelope>

could anyone tell me how can I solve this problem. and since I’m a newbie when it comes to SOAP would you also tell me if the order of the xml tags in the soap:Body tag is important or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:47:27+00:00Added an answer on May 15, 2026 at 2:47 pm

    Thanks to Steve, I found “Why is “wsdl” namespace interjected into action name when using savon for ruby soap communication?” where Nick and Steve were talking about a similar problem.

    Like Nick, my problem was in the way Savon is cooking up a SOAP envelope. As recommended by Nick, I ended up monkey patching a couple of methods in the Savon SOAP class. It’s in lib/savon/soap.rb
    and I’m good to go now.

    I’m a novice when it comes to SOAP and it’s my first time writing a SOAP client, but honestly it SUCKS! I still remember my first time writing a client for a REST service and gosh it was fun.

    REST ROCKS, SOAP SUCKS. that’s all!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.