Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JAX-WS: Using NodeList so that Excel Web Services Toolkit can use web

Status
Not open for further replies.

Ascalonian

Programmer
Jan 4, 2008
264
US
I am running into a couple of issues where an Excel spreadsheet is suppose to call a Java web service I have created in JAX-WS and get back the results. However, there is some issue with not sending, nor receiving, back a NodeList. I am not sure how I need to change my web service to handle this.

The other issue is that the MS Office 2003 Web Service Toolkit is defining the web method as a sub routine instead of a function.

My web method is defined in the endpoint interface as:

Code:
@WebMethod
@WebResult(name="CreateWorkOrderItemResponse")
CreateWorkOrderItemResponse createWorkItems(@WebParam(name = "CreateWorkOrderItemRequest")CreateWorkOrderItemRequest request);

The CreateWorkOrderItemRequest is defined as:

Code:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "authentication",
    "createData"
})
@XmlRootElement(name = "CreateWorkOrderItemRequest", namespace="")
public class CreateWorkOrderItemRequest {

    @XmlElement(name = "authentication", required = true)
    protected Authentication authentication = null;
    @XmlElement(name = "create_data", required = true)
    protected ArrayList<CreateWorkOrderItemData> createData = new ArrayList<CreateWorkOrderItemData>();

    public Authentication getAuthentication() {
        return authentication;
    }

    public void setAuthentication(Authentication authentication) {
        this.authentication = authentication;
    }

    public ArrayList<CreateWorkOrderItemData> getCreateData() {
        return createData;
    }

    public void setCreateData(ArrayList<CreateWorkOrderItemData> createData) {
        this.createData = createData;
    }
}

The CreateWorkOrderItemResponse is defined as:

Code:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "submissionResponse",
    "errorList"
})
@XmlRootElement(name = "CreateWorkOrderItemResponse")
public class CreateWorkOrderItemResponse{

    @XmlElement(name = "submission_response", required = true)
    protected SubmissionResponse submissionResponse = new SubmissionResponse();

    @XmlElementWrapper(name="error_list") 
    @XmlElement(name="error", required = true, nillable = true)
    protected ArrayList<Error> errorList = new ArrayList<Error>();

    public SubmissionResponse getSubmissionResponse() {
        return submissionResponse;
    }

    public void setSubmissionResponse(SubmissionResponse submissionResponse) {
        this.submissionResponse = submissionResponse;
    }

    public ArrayList<Error> getErrorList() {
        return errorList;
    }

    public void addError(Error error) {
        errorList.add(error);
    }

    public void addErrors(ArrayList<Error> errors) {
        for (Error error : errors) {
            errorList.add(error);
        }
    }

    public void setErrorList(ArrayList<Error> errorList) {
        this.errorList = errorList;
    }
}

The result from the Web Service Toolkit comes out like this:

Code:
Public Sub wsm_createWorkItems() 
    '***************************************************************** 
    'Proxy subroutine created from [URL unfurl="true"]http://localhost:8080/gbswebsvcs/seiwebsvcs?wsdl.[/URL] 
    '***************************************************************** 
    'Error Trap 
        On Error GoTo wsm_createWorkItemsTrap 

        sc_SEIWebServiceImplServ.createWorkItems 
        Exit Sub 
wsm_createWorkItemsTrap: 
    SEIWebServiceImplServErrorHandler "wsm_createWorkItems" 
End Sub

But apparently it is suppose to come out more like this:

Code:
Public Function wsm_createWorkItems(ByVal any_CreateWorkOrderItemRequest As MSXML2.IXMLDOMNodeList) As MSXML2.IXMLDOMNodeList

    '***************************************************************** 
    'Proxy function created from [URL unfurl="true"]http://localhost:8080/gbswebsvcs/seiwebsvcs?wsdl.[/URL] 
    '"wsm_createWorkItems, any_CreateWorkOrderItemRequest" is defined as XML. See Complex Types: XML Variables in 
    'Microsoft Office 2003 Web Services Toolkit Help for details on implementing XML variables. 
    '***************************************************************** 
    'Error Trap 
        On Error GoTo wsm_createWorkItemsTrap 

        Set wsm_createWorkItems = sc_DataServicesServer.createWorkItems(any_CreateWorkOrderItemRequest) 
        Exit Function 
wsm_createWorkItemsTrap: 
    DataServicesServerErrorHandler "wsm_createWorkItems" 
End Function

How do I get it to this point? Thank you very much for the help.
 
I actually figured this out. I couldn't approach it the way I did. I had to add in some new annotations, along with a restructure of the folders. I needed to add in ObjectFactory, package-info and some other things to get it going. With that said, I think it was more of a JBoss issue than anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top