Development and Test Environment
These examples have been tested on a machine with JDK 1.8 version and developed at Eclipse IDE for Java EE Developers (Oxygen 2). Download the installation here and choose Eclipse IDE for Java EE Developers to install it on your computer.
Creating a Java Project in Eclipse
This chapter explains the steps creating a new Java project.
Run “Eclipse”.
Go to “File” menu.
Select "New" - “Java Project”.
Enter a project name "CWS" and click the “Finish” button.
A new project will be created with the given name.
Setting a Web Service Client up
This chapter explains the steps setting up a web service client in your new Java project.
Click mouse right button on the project name under the Package Explorer.
Click the [New] - [Other ...].
Enter “Web Service” at wizards input box.
Select “Web Service Client“, then click “Next” button.
Enter http://e3.sap.cubemaster.net/calculation.svc?singlewsdl to the “Service definition” input box.
Define the “Develop client” as shown in the screen shot.
Then click the “Finish” button.
New packages and classes will be created automatically.




Adding a Main Class Package and Class
Click the mouse right button on “scr” package.
Click the “Package” on popup menu.
Enter Package name “org.main” at Name input box.Go to “org.main” package and then click the mouse right button.
Click the [New]-[Class].
Enter class name at name input box.
Check automatically method .
Select public static void main(String[] args).
Then click “Finish” button.
Main class will be generated automatically as screen shot.
Firstly, import all packages(Package Name org.tempuri.*,org.datacotract.schemas.*).
Write a try-catch statement in the main method.
Editing the Main Class Package and Class
Main class will be generated automatically as screen shot.
package org.main;
import org.tempuri.*;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.axis.encoding.Base64;
import org.datacontract.schemas._2004._07.CubeMasterWebService.*;
public class LoadBuildingSample {
public static void main(String[] args) {
try {
} catch (Exception e) {
// TODO Auto-generated catch block
}
}
}
Import all packages (Package Name org.tempuri.*,org.datacotract.schemas.*).
Write a try-catch statement in the main method.
Add new statements to define the shipment information for the calculation. Define “Account”, “Shipment”, and “Options”. Define two cargoes. Define “Container” and “Shipment” rules.
Add new statements to send the shipment information to the CubeMaster service servers.
Add a try-catch statements to look up the results by seeing if “getStatus()” returns “OK”.
Add new statements to produce an image in a try-catch statement from the results.
Add cleanup statements.
package org.main;
import org.tempuri.*;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.axis.encoding.Base64;
import org.datacontract.schemas._2004._07.CubeMasterWebService.*;
public class LoadBuildingSample {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
ICalculationProxy iCalculationProxy = new ICalculationProxy();
//Define account information
//Please replace with the information of your account
Account account = new Account();
account.setUserID("chang@logen.co.kr");
account.setPassword("****");
account.setCompany("Logen Solutions");
//Define options
Options options = new Options();
options.setCalculationSaved(true);
options.setGraphicsCreated(true);
options.setGraphicsImageWidth((short) 300);
options.setGraphicsImageDepth((short) 300);
options.setThumbnailsCreated(true);
options.setThumbnailsImageWidth((short) 300);
options.setThumbnailsImageDepth((short) 300);
options.setUOM(1);//1=mm+Kg, 0=inch+lbs, 2=Cm+Kg
//Define shipment
Shipment shipment = iCalculationProxy.getShipment();
shipment.setTitle("New Shipment Sample for Vehicle Load v2");
shipment.setDescription("in Java Eclipse");
//Define two cargoes
Cargo[] Cargoes = new Cargo[3];
Cargoes[0] = new Cargo();
Cargoes[0].setName("First Cargo");
Cargoes[0].setLength(500);//mm
Cargoes[0].setWidth(500);//mm
Cargoes[0].setHeight(500);//mm
Cargoes[0].setQty((long) 40);
Cargoes[0].setSequence(1);
Cargoes[0].setGroupName("B");
Cargoes[0].setWeight(47.12);//kg
Cargoes[0].setColorKnownName("BLUE");
Cargoes[0].setFloorStackSupportsOthers(true);
Cargoes[1] = new Cargo();
Cargoes[1].setName("Second Cargo");
Cargoes[1].setLength(700);//mm
Cargoes[1].setWidth(800);//mm
Cargoes[1].setHeight(700);//mm
Cargoes[1].setQty((long) 156);
Cargoes[1].setSequence(2);
Cargoes[1].setGroupName("A");
Cargoes[1].setWeight(50.00);//kg
Cargoes[1].setColorKnownName("RED");
Cargoes[1].setFloorStackSupportsOthers(true);
Cargoes[2] = new Cargo();
Cargoes[2].setName("Third Cargo");
Cargoes[2].setLength(600);//mm
Cargoes[2].setWidth(550);//mm
Cargoes[2].setHeight(860);//mm
Cargoes[2].setQty((long)45);
Cargoes[2].setSequence(2);
Cargoes[2].setGroupName("A");
Cargoes[2].setWeight(12.00);//kg
Cargoes[2].setOrientationsAllowed(63);
Cargoes[2].setColorKnownName("YELLOW");
//Cargoes[2].setColorHexaCode("#FF00FF");
Cargoes[2].setFloorStackSupportsOthers(false);
shipment.setCargoes(Cargoes);
//Define containers
Container[] EmptyContainers = new Container[2];
EmptyContainers[0] = new Container();
EmptyContainers[0].setContainerType(2);//2=SeaContainer
EmptyContainers[0].setName("20FT Dry");
EmptyContainers[0].setLength((double) 5890);//mm
EmptyContainers[0].setWidth((double) 2330);//mm
EmptyContainers[0].setHeight((double) 2380);//mm
EmptyContainers[0].setMaxWeight((double) 5000);//kg
EmptyContainers[1] = new Container();
EmptyContainers[1].setContainerType(2);//2=SeaContainer
EmptyContainers[1].setName("40FT Dry");
EmptyContainers[1].setLength((double) 12050);//mm
EmptyContainers[1].setWidth((double) 2330);//mm
EmptyContainers[1].setHeight((double) 2380);//mm
EmptyContainers[1].setMaxWeight((double) 7000);//kg
shipment.setContainers(EmptyContainers);
//Define Rules
shipment.getRules().setIsWeightLimited(true);
shipment.getRules().setIsSequenceUsed(false);
shipment.getRules().setIsGroupUsed(false);
shipment.getRules().setIsSafeStackingUsed(true);
shipment.getRules().setMinSupportRate((double) 60);
shipment.getRules().setStackingRule(5);
shipment.getRules().setFillDirection(1);
//Run the calculation
LoadPlan loadPlan = iCalculationProxy.run(shipment, account, options);
//Show the return
System.out.println(loadPlan.getStatus());
//Show an error code if any
System.out.println(loadPlan.getCalculationError());
if(loadPlan.getStatus().equals("OK")) {
//Access the results
System.out.println("# of Containers =" + loadPlan.getFilledContainers().length);
InputStream is = null;
OutputStream os = null;
//Show all filled containers
try {
for (FilledContainer container : loadPlan.getFilledContainers()) {
//show the name of the container
System.out.println(container.getName());
System.out.println(container.getLength());
} // End of foreach - FilledContainer
} catch (Exception e) {
// TODO: handle exception
} finally { //Resource Cleanup
if(is != null) {
try {
is.close();
os.close();
} catch(IOException e) {
e.printStackTrace();
}
}
} // end of try-catch statement .. for Show all filled containers
} //LoadPlan.Status == "OK"
System.exit(0);
} catch (Exception e) {
// TODO: handle exception
}
}
}
Impressive work, try adding more depth to the background new zealand transit visa
Prince of Persia is the best, i really like the lead actor and also the princess, the princess is very pretty,. agen togel
very good post, i surely love this excellent website, keep on it slot gacor
I have been meaning to post something like this on my blog and you have given me an idea. Cheers. poker online
It’s difficult to get knowledgeable individuals on this topic, however you seem like there’s more you’re discussing! Thanks Australian travel guide
I’m impressed, I have to admit. Really rarely can i encounter a weblog that’s both educative and entertaining, and let me tell you, you might have hit the nail to the head. Your idea is outstanding; the problem is something not enough folks are speaking intelligently about. I am delighted i found this around my look for something in regards to this. toto slot
Wow that was unusual. I just wrote an very long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyway, just wanted to say fantastic blog! 除甲醛
Thank you for your own hard work on this website. Ellie enjoys conducting investigation and it is obvious why. All of us learn all of the compelling mode you produce simple tricks through this blog and as well cause participation from other ones about this area of interest then our daughter is now starting to learn a lot of things. Take advantage of the rest of the new year. You have been conducting a very good job.Supreme Hoodie
Read carefully the complete short article. There is certainly some definitely insightful data here. thanks. “The soul is the captain and ruler of the life of morals.” by Sallust.. 除蟑螂
You have mentioned very interesting details ! ps decent web site . agen togel
The design of ventsedgemakes it a pleasure to use.
Every visit to hardcorebuzz is worth it!
Mahjong Solitaire, the online version of Mahjong, gains wide popularity recently. The online version of the classic Chinese game is a matching game that uses the Mahjong tiles. Online Mahjong games can be found in many online gaming sites in variety of layouts and versions. situs poker
Everyone should consider the 랜덤추첨기 for their next event
I love the thrill of using 꽁머니 on new games.
There are innumerable blogs in the world of the internet. But trust me, this site contains every single detail that makes it exceptional. I'll return time and time again. 네팔 시민을 위한 캄보디아 비자
툰코 has become my favorite way to enjoy webtoons
Enjoying free webtoons is so easy with 웹툰 무료보기
Finding great webtoons on 웹툰 미리보기 has been so easy. I love the site’s layout
The 웹툰 다시보기 webtoon site is great for keeping up with all the new releases
The webtoons on 툰코 주소 are always so engaging and well-drawn
블랙툰 대체 is great, but expanding your horizons with different webtoon sites can enhance your overall reading enjoyment.
Really enjoying the interactive community on 툰코. Great way to connect with other fans
The 뉴토끼 webtoon site is fantastic for finding fresh content daily
The Jawa 42 Bobber is a cruiser bike, a motorcycle that perfectly blends classic design with modern performance. Its sleek, stripped-down aesthetic and powerful engine make every ride a statement of style and freedom. The Jawa 42 Bobber offers an unmatched riding experience. Ride the Jawa 42 Bobber and enjoy the long road trip. If you need Jawa Bobber 42 accessories you can visit Sans Classic Parts, which provides the best quality accessories at a reasonable price.
you should take vocal lessons if there is a need for you to sound like Taylor Swift or Josh Groban,. 슬롯사이트
Nothing beats the convenience of 웹툰 다시보기 on Blacktoon. It’s my go-to platform for all my favorite webtoons.
A visit to 강남 룸싸롱 is not complete without trying their state-of-the-art karaoke systems. The sound quality is phenomenal!
v
웹툰 미리보기 has made discovering new webtoons a breeze. The previews are detailed and help me select the best series to follow.
The 웹툰 미리보기 on TOONKOR is a fantastic feature that helps me find new webtoons. The previews are always detailed and informative.
Milky Way Casino
When I originally commented I clicked the -Notify me when new comments are added- checkbox and already whenever a comment is added I am four emails with the exact same comment. Will there be by any means you may eliminate me from that service? Thanks!<a href="https://www.procolored.com/collections/dtf-printer">dtf printer</a>
Engaging with fellow readers on toonkor is a great way to discuss favorite series.
You have brought up a very superb points , thankyou for the post. dewatogel
Ace Property Service offers complete termite and pest inspection services to safeguard your property from undesirable invasions. Our accomplished group utilizes progressed procedures and cutting-edge gear to recognize and distinguish pests early, forestalling likely harm to your home or business. We give exhaustive inspections, definite reports, and successful treatment plans customized to your requirements. Trust Ace Property Service to guarantee a without-pest climate, defending your venture and peace of brain.
I love 꽁머니 promotions! They make betting more exciting and give me the chance to win big without risking my own money.
골드핑거 is a must-watch for anyone who appreciates great storytelling.
Engaging with like-minded individuals and expanding my horizons on 대밤.
This 안마 establishment truly prioritizes customer satisfaction.
Love how 펀초이스 connects me with Busan's vibrant community. Always find great recommendations and insights here.
I rely on 달리머넷 for honest feedback on relaxation treatments.
The community aspect of 대밤 enhances the user experience.
Don't compromise on safety when torrenting. Choose verified 토렌트 sites and implement security measures like VPNs for peace of mind.
Sports fans worldwide rely on 스포츠중계 platforms for live coverage of their favorite matches, tournaments, and events.
The soothing ambiance and expert therapists at 오피가이드 make it my go-to spot for relaxation.
I have been looking to discover a solace or powerful method to finish this procedure and I think this is the most reasonable approach to do it viably. 格鲁吉亚公民的沙特签证
I can't get enough of 오피스타. The massages are so soothing, and the atmosphere is incredibly tranquil.
Impressed by the versatility of 오피. It caters to various customer preferences with its range of offerings.
The 여기여 platform fosters a culture of learning and growth. I'm constantly inspired by the content and discussions.