Appendix B. Sample Java code for Web services 455
* @param businessPartnerId The businessPartnerId to set
*/
public void setBusinessPartnerId(String businessPartnerId) {
sBusinessPartnerId = businessPartnerId;
}
/**
* Gets the businessPartnerName
* @return Returns a String
*/
public String getBusinessPartnerName() {
return sBusinessPartnerName;
}
/**
* Sets the businessPartnerName
* @param businessPartnerName The businessPartnerName to set
*/
public void setBusinessPartnerName(String businessPartnerName) {
sBusinessPartnerName = businessPartnerName;
}
/**
* Gets the itemCount
* @return Returns a int
*/
public int getItemCount() {
return iItemCount;
}
/**
* Sets the itemCount
* @param itemCount The itemCount to set
*/
public void setItemCount(int itemCount) {
iItemCount = itemCount;
}
/**
* Gets the itemId
* @return Returns a String
*/
public String getItemId() {
return sItemId;
}
/**
* Sets the itemId
* @param itemId The itemId to set
456 A B2B Solution using WebSphere Business Integration and WebSphere Business Connection
*/
public void setItemId(String itemId) {
sItemId = itemId;
}
/**
* Gets the itemDescription
* @return Returns a String
*/
public String getItemDescription() {
return sItemDescription;
}
/**
* Sets the itemDescription
* @param itemDescription The itemDescription to set
*/
public void setItemDescription(String itemDescription) {
sItemDescription = itemDescription;
}
/**
* Gets the itemQuantity
* @return Returns a int
*/
public double getItemQuantity() {
return dItemQuantity;
}
/**
* Sets the itemQuantity
* @param itemQuantity The itemQuantity to set
*/
public void setItemQuantity(double itemQuantity) {
dItemQuantity = itemQuantity;
}
/**
* Gets the unitOfMeasure
* @return Returns a String
*/
public String getUnitOfMeasure() {
return sUnitOfMeasure;
}
/**
* Sets the unitOfMeasure
* @param unitOfMeasure The unitOfMeasure to set
*/
public void setUnitOfMeasure(String unitOfMeasure) {
Appendix B. Sample Java code for Web services 457
sUnitOfMeasure = unitOfMeasure;
}
/**
* Gets the itemPrice
* @return Returns a double
*/
public double getItemPrice() {
return dItemPrice;
}
/**
* Sets the itemPrice
* @param itemPrice The itemPrice to set
*/
public void setItemPrice(double itemPrice) {
dItemPrice = itemPrice;
}
/**
* Gets the itemTotalPrice
* @return Returns a double
*/
public double getItemTotalPrice() {
return dItemTotalPrice;
}
/**
* Sets the itemTotalPrice
* @param itemTotalPrice The itemTotalPrice to set
*/
public void setItemTotalPrice(double itemTotalPrice) {
dItemTotalPrice = itemTotalPrice;
}
/**
* Gets the itemCurrency
* @return Returns a String
*/
public String getItemCurrency() {
return sItemCurrency;
}
/**
* Sets the itemCurrency
* @param itemCurrency The itemCurrency to set
*/
public void setItemCurrency(String itemCurrency) {
sItemCurrency = itemCurrency;
}
458 A B2B Solution using WebSphere Business Integration and WebSphere Business Connection
/**
* Gets the status
* @return Returns a String
*/
public String getStatus() {
return sStatus;
}
/**
* Sets the status
* @param status The status to set
*/
public void setStatus(String status) {
sStatus = status;
}
/**
* Gets the purchaseOrderNumber
* @return Returns a int
*/
public int getPurchaseOrderNumber() {
return iPurchaseOrderNumber;
}
/**
* Sets the purchaseOrderNumber
* @param purchaseOrderNumber The purchaseOrderNumber to set
*/
public void setPurchaseOrderNumber(int purchaseOrderNumber) {
iPurchaseOrderNumber = purchaseOrderNumber;
}
/**
* Gets the lineNumber
* @return Returns a String
*/
public String getLineNumber() {
return sLineNumber;
}
/**
* Sets the lineNumber
* @param lineNumber The lineNumber to set
*/
public void setLineNumber(String lineNumber) {
sLineNumber = lineNumber;
}
// no set method - the order number is created by the
// constructor and cannot be changed later
public int getOrderNumber() {
return this.iPurchaseOrderNumber;
Appendix B. Sample Java code for Web services 459
}
}
Example: B-6 Source code for PurchaseOrderManager.java
package com.ibm.webservices;
import java.util.Vector;
import java.util.Date;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.*;
import org.apache.xerces.dom.*;
import org.apache.xerces.jaxp.*;
import org.apache.xerces.parsers.*;
import java.io.*;
import proxy.soap.wsstatic.*;
public class PurchaseOrderManager {
static Vector vOrders = new Vector();
PurchaseOrder newOrder = null;
/**
* Gets for new purchase order
* @return Returns a String
*/
public String checkForNewOrder() {
String newMessage = "";
try {
newOrder = new PurchaseOrder();
MQReceiveServiceProxy newProxyObject = new MQReceiveServiceProxy();
newMessage = newProxyObject.receiveMessage("WSGW", "ITSO01.ORDER.CREATED", "");
if (newMessage.equals("") || newMessage==null)
{
return "Purchase Order could not be created. Invalid XML input.";
}
org.xml.sax.InputSource isReadXML = new org.xml.sax.InputSource();
isReadXML.setCharacterStream(new StringReader(newMessage));

Get A B2B Solution using WebSphere Business Integration V4.1 and WebSphere Business Connection V1.1 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.