Private Void jButton1ActionPerformed
Private Void jButton1ActionPerformed
setText("please wait, your request under processing"); org.netbeans.j2ee.wsdl.pobpel.po.POService service = new org.netbeans.j2ee.wsdl.pobpel.po.POService(); org.netbeans.j2ee.wsdl.pobpel.po.POPortType port = service.getPOPort(); // TODO initialize WS operation arguments here org.netbeans.xml.examples.purchaseorder.PurchaseOrderType part1 = new org.netbeans.xml.examples.purchaseorder.PurchaseOrderType(); Customer cus=new Customer(); cus.setName(CustomerName.getText()); cus.setContry(CustomerCountry.getSelectedItem().toString()); cus.setCity(CustomerCity.getSelectedItem().toString()); CreditCard cc=new CreditCard(); cc.setCardNo(CardNumber.getText()); //cc.setCardDate(new XMLGregorianCalendarImpl(new GregorianCalendar(2009, 10, 22))); //GregorianCalendar cal=new GregorianCalendar(); //cal.setTime(parseDate(CardDate.getText())); cc.setCardDate(new XMLGregorianCalendarImpl(new GregorianCalendar())); Items its=new Items(); if(!jQuantity.getText().equals("0")){ Item it = new Item(); it.setProductName(jProductName.getSelectedItem().toString()); it.setQuantity(Integer.parseInt(jQuantity.getText())); it.setPrice(BigDecimal.valueOf(Double.parseDouble(jUnitPrice.getText()))); its.getItem().add(it); } if(!jQuantity1.getText().equals("0")){ Item it = new Item(); it.setProductName(jProductName1.getSelectedItem().toString()); it.setQuantity(Integer.parseInt(jQuantity1.getText()));
it.setPrice(BigDecimal.valueOf(Double.parseDouble(jUnitPrice1.getText()))); its.getItem().add(it); } if(!jQuantity2.getText().equals("0")){ Item it = new Item(); it.setProductName(jProductName2.getSelectedItem().toString()); it.setQuantity(Integer.parseInt(jQuantity2.getText())); it.setPrice(BigDecimal.valueOf(Double.parseDouble(jUnitPrice2.getText()))); its.getItem().add(it); } cc.setCustomer(cus); part1.setCreditCard(cc); part1.setItems(its); part1.setOrderDate(new XMLGregorianCalendarImpl(new GregorianCalendar())); // TODO process result here System.out.println("asd "+part1.getItems().getItem().size()); org.netbeans.xml.examples.purchaseorder.InvoiceType result = port.poOperation(part1); State.setBackground(Color.GREEN); State.setText("done witout any problem"); Total.setText(result.getTotal().toString()); Shipment.setText(result.getShipment().getCompanyName()); } catch (POOperationFault ex) { State.setBackground(Color.RED); State.setText("ERROR: "+ex.getFaultInfo()); } catch (Exception ex){ State.setBackground(Color.RED); State.setText("please insert an validate order"); ex.printStackTrace(); }