Error "In Create SOAP Request with Java" theme : NullPointerException: Cannot get property 'binding' on null object

76 views
Skip to first unread message

i.p.e....@gmail.com

unread,
Feb 3, 2017, 7:40:30 AM2/3/17
to Membrane SOA Model
I am trying to do an example from you webpage http://www.membrane-soa.org/soa-model-doc/1.4/java-api/create-soap-request.htm, and I have the next error:

Exception in thread "main" java.lang.NullPointerException: Cannot get property 'binding' on null object
    at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
    at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
    at com.predic8.wstool.creator.SOARequestCreator.getSoapPrefix(SOARequestCreator.groovy:140)
    at com.predic8.wstool.creator.SOARequestCreator.this$3$getSoapPrefix(SOARequestCreator.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1852)
    at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3735)
    at com.predic8.soamodel.AbstractCreator.getProperty(AbstractCreator.groovy)
    at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:50)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
    at com.predic8.wstool.creator.SOARequestCreator.createRequest(SOARequestCreator.groovy:74)
    at netlogistik.com.CreateSOAPRequest.main(CreateSOAPRequest.java:30)

I wrote a java class that extends from SOARequestCreator and added the properties that the exception indicates, and the simple java class is:

public class CustomSOARequestCreator extends SOARequestCreator {
   
    private String binding;
    private String soapPrefix;
    private String soapNamespace;

    public CustomSOARequestCreator(Definitions definitions, Object creator,
            MarkupBuilder builder) {
        super(definitions, creator, builder);
    }

}

After that, I could run the example, but the SOAP Request is empty:

<null:Envelope xmlns:null=''>
  <isHeaderExisting />
  <buildHeader>groovy.xml.MarkupBuilder@3febb011</buildHeader>
  <buildBody>groovy.xml.MarkupBuilder@3febb011</buildBody>
</null:Envelope>

I houp that you can help me :D
Reply all
Reply to author
Forward
0 new messages