cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Creating WTPart using InfoEngine based webservice

RG_10893406
6-Contributor

Creating WTPart using InfoEngine based webservice

I am using Windchill PDMLink Release 12.1 and Datecode with CPS 12.1.2.0

i have created the infoengine based webservice for creating a wtpart. While running client some errors are persisting.
Exception in thread "main" com.ptc.jws.service.org.myorg.partservice.Exception_Exception: com.infoengine.util.IEException; nested exception is:
java.lang.NullPointerException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:114)
at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:223)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:176)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:263)
at com.sun.xml.ws.client.sei.SyncMethodHandler

Here are the errors that I faced
Exception in thread "main" com.ptc.jws.service.org.myorg.partservice.Exception_Exception: com.infoengine.util.IEException; nested exception is:
java.lang.NullPointerException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:114)
at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:223)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:176)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:263)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:88)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:61)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:131)
at com.sun.proxy.$Proxy44.createPart(Unknown Source)
at org.myorg.PartClient.main(Unknown Source)
2 REPLIES 2

Webservice :

<%@page language="java" access="internal|http|soap"%> 
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%> 
<%@taglib uri="/com/infoengine/tlds/iejstl.tld" prefix="c"%> 
 
<!--com.infoengine.soap.rpc.def  
@param String new_Part_Name 
@return String ${output[0]result[0]} 
--> 
 
 
<%! 
String part_Name = getParam("new_Part_Name").toString();
%>
 
<c:set var="${output[0]result}" value="successfully Created" />
 
<ie:webject name="Query-Objects" type="OBJ">
    <ie:param name="INSTANCE" data="$(@FORM[]supporting-adapter[*])" delim="!" valueSeparator="!" default="<%=com.infoengine.au.NamingService.getVMName()%>"/>
    <ie:param name="TYPE" data="wt.pdmlink.PDMLinkProduct"/>
    <ie:param name="WHERE" data="name=Fan"/>
     <ie:param name="GROUP_OUT" data="product"/>
</ie:webject>
 
 
<ie:webject name="Create-Objects" type="ACT">
    <ie:param name="INSTANCE" data="$(@FORM[]supporting-adapter[*])" delim="!" valueSeparator="!" default="<%=com.infoengine.au.NamingService.getVMName()%>"/>
<ie:param name="CONTAINER_REF" data="$(product[]obid[])"/>
     <ie:param name="FIELD" data="name=<%=part_Name%>"/>
    <ie:param name="TYPE" data="wt.part.WTPart"/>
</ie:webject>
 
Client :
package org.myorg;
import com.ptc.jws.client.handler.*;
import com.ptc.jws.service.org.myorg.partservice.*;
import java.util.Arrays;
import java.util.List;
 
public class PartClient
{
    public static void main ( String [] args ) throws java.lang.Exception
    {
 PartServiceImplService service = new PartServiceImplService();
 PartServiceImpl port = service.getPartServiceImplPort ();
for(String arg : args){
port.createPart(arg);
System.out.printf ( "Part Created Successfully "+arg); 
}
    }
}
 
Error:
Exception in thread "main" com.ptc.jws.service.org.myorg.partservice.Exception_Exception: com.infoengine.util.IEException; nested exception is:
java.lang.NullPointerException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:114)
at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:223)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:176)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:263)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:88)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:61)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:131)
at com.sun.proxy.$Proxy44.createPart(Unknown Source)
at org.myorg.PartClient.main(Unknown Source)

Hi RG_10893406,

Thank you for your question. 

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Regards,

Vivek N
Community Moderation Team.

Announcements


Top Tags