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 7178919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:01:21+00:00 2026-05-28T17:01:21+00:00

i am trying to write a test code of wsdl web service in java.

  • 0

i am trying to write a test code of wsdl web service in java. This code return me some values of variables and have to place an order. Of this code i have en equivalent on C# but i don’t understand how to convert in java. This is my code in Java:

 package betdaqclient; 
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List; 
 import javax.xml.bind.JAXBElement;
 public class test 
 {
public static void main(String[] args) 
{
ExternalApiHeader externalAPIHeader = new ExternalApiHeader();
externalAPIHeader.languageCode = "en";
externalAPIHeader.username = "myusername";
externalAPIHeader.password = "mypassword";
externalAPIHeader.version = new BigDecimal ("2.0"); 

ReadOnlyService_Service ro = new ReadOnlyService_Service();
ReadOnlyService readOnlyService = ro.getReadOnlyService();
SecureService_Service ss = new SecureService_Service();
SecureService secureService = ss.getSecureService(); 


GetAccountBalancesRequest getAccountBalanceRequest = new GetAccountBalancesRequest();
GetAccountBalancesResponse2 getAccountBalanceResponse = secureService.getAccountBalances(getAccountBalanceRequest, externalAPIHeader);
System.out.printf("%n%nUser  : "  + externalAPIHeader.username);
System.out.printf("%nBalance  : " + getAccountBalanceResponse.balance.toString()); 
System.out.printf("%nExposure : " + getAccountBalanceResponse.exposure.toString()); 
System.out.printf("%nAvailable: " + getAccountBalanceResponse.availableFunds.toString()+"%n");



SimpleOrderRequest bet = new SimpleOrderRequest();

bet.selectionId = (long) IdMarket;

bet.polarity = (byte) 1 ; //<-----BACK?

bet.stake = new BigDecimal("1.00") ;

bet.price = new BigDecimal("1.01") ;
bet.cancelOnInRunning = true ; 





PlaceOrdersNoReceiptRequest request = new PlaceOrdersNoReceiptRequest();

/* Lacking Code */





 PlaceOrdersNoReceiptResponse2 response = secureService.placeOrdersNoReceipt(request,externalAPIHeader);


}
} 

I guess that my bet has to be converted in a list and then passed to request. This is the code in C# that i have found in the examples:

    public long[] PlaceOrdersNoReceipt(long selectionId, byte polarity, decimal amount

        , decimal odds, byte resetCount)

    {

        SimpleOrderRequest order = new SimpleOrderRequest();

        order.SelectionId = selectionId;

        order.Polarity = polarity;

        order.Stake = amount;

        order.Price = odds;

        order.ExpectedSelectionResetCount = resetCount;





        PlaceOrdersNoReceiptRequest request = new PlaceOrdersNoReceiptRequest();

        request.Orders = new SimpleOrderRequest[1] {order};





        PlaceOrdersNoReceiptResponse response = _proxy.PlaceOrdersNoReceipt(request);

        if (response.ReturnStatus.Code != 0)

            throw new Exception(response.ReturnStatus.Description);





        return response.OrderHandles;

    }

This is the definition of the class built from wsdl:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PlaceOrdersNoReceiptRequest", propOrder = {
"orders",
"wantAllOrNothingBehaviour"
})
public class PlaceOrdersNoReceiptRequest {

@XmlElement(name = "Orders", required = true)
protected PlaceOrdersNoReceiptRequest.Orders orders;
@XmlElement(name = "WantAllOrNothingBehaviour")
protected boolean wantAllOrNothingBehaviour;

public PlaceOrdersNoReceiptRequest.Orders getOrders() {return orders;}


public void setOrders(PlaceOrdersNoReceiptRequest.Orders value) {this.orders = value;}


public boolean isWantAllOrNothingBehaviour() { return wantAllOrNothingBehaviour; }
public void setWantAllOrNothingBehaviour(boolean value)    {this.wantAllOrNothingBehaviour = value;}


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {"order"})
public static class Orders {

    @XmlElement(name = "Order", required = true)
    protected List<SimpleOrderRequest> order;
    public List<SimpleOrderRequest> getOrder() {
        if (order == null) {
            order = new ArrayList<SimpleOrderRequest>();
        }
        return this.order;
    }

}

}

The question is how i have to convert bet element of thee class SimpleOrderRequest into request of the class PlaceOrderNoRecepeit ?
May be a very stupid question but i am a newbie in java programming.

  • 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-28T17:01:22+00:00Added an answer on May 28, 2026 at 5:01 pm

    Lacked code should be

    PlaceOrdersNoReceiptRequest.Orders orders = new PlaceOrdersNoReceiptRequest.Orders();
    orders.getOrder().add(bet);
    
    PlaceOrdersNoReceiptRequest request = new PlaceOrdersNoReceiptRequest();
    request.setOrders(orders);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write some test code for my java application using Scalatest.
I'm trying to write some code in java to learn more about coding with
I'm trying to write some code to test out the Cartesian product of a
I'm trying to write some simple test code as a demonstration of hooking the
I'm trying to write a program to test student code against a good implementation.
I'm trying to write a unit test for a piece of code that generates
I'm trying to write a Selenium test for a web page that uses an
I'm trying to write basic assert test: def assert_session_has ( sessionvar ) return assert_not_nil
I am currently trying to write some unit test against my zend framework controller.
I'm trying to write some test cases for my Qooxdoo application, and I think

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.