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
}
}
}
블랙툰 has an excellent range of action-packed stories that are both thrilling and engaging. It’s a top choice for action fans.
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
Checking 웹툰 미리보기 has become a daily habit. It makes the waiting period for new episodes so much more fun.
웹툰 미리보기 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
Duplicity is a nice movie,i like the story and also the actors., anabolen kopen ideal
It’s really a great and useful piece of information. I am happy that you shared this useful information with us. Please keep us up to date like this. Thanks for sharing. ombak88 slot
오피’s platform simplifies the search for high-quality relaxation services, making it straightforward to book a peaceful retreat.
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.
Implementing strategies like 소액결제현금화 can enhance financial flexibility and operational efficiency.
You have brought up a very superb points , thankyou for the post. dewatogel
PVD coating services in the USA are portrayed by their high-level gear, stringent quality control measures, and aptitude in material science and surface engineering. These offices are prepared to deal with both limited scope and huge scope creation, delivering reliable and excellent coatings that meet the demanding prerequisites of current industrial applications. Whether it's improving the presentation of auto parts, enhancing the strength of cutting devices or extending the life expectancy of clinical inserts, PVD coating services assume a pivotal part in driving innovation and greatness across different areas in the USA. pvd coating services in usa
Reliable auto transport by JW Logistic Inc. guarantees your vehicle is conveyed securely and on time, offering inner serenity with each move. Their expert administrations ensure a smooth and trustworthy transportation experience.
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.