wsdl authentication

100 views
Skip to first unread message

prathapr...@gmail.com

unread,
Mar 20, 2017, 10:03:08 AM3/20/17
to Membrane SOA Model
Dear team,

   I am trying to authenticate wsdl web service url by using wsdlparser. 
I wsdl having basic authentication. I tried to BasicAuthenticationResolver not working . 
Please Help me how can authanticate.
import java.io.IOException;
import com.predic8.wsdl.Definitions;
import com.predic8.wsdl.WSDLParser;
import com.predic8.xml.util.BasicAuthenticationResolver;

public class Test {

    public static void main(String[] args) throws ClientProtocolException, IOException {
        String str="http://localhost:7005/OrderManagement/wsapi?WSDL";
        WSDLParser ws=new WSDLParser();
        BasicAuthenticationResolver bs=new BasicAuthenticationResolver();
        bs.setBaseDir("http");
        bs.setUsername("osm");
        bs.setPassword("osmadmin1");
        ws.setResourceResolver(bs);
        Definitions df=ws.parse(str);
        System.out.println(df.toString());

    }
}

error: 
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: com.predic8.xml.util.BasicAuthenticationResolver.resolve() 
is applicable for argument types: (java.lang.String, java.lang.String) values: [http://192.168.1.105:7005/OrderManagement/wsapi?WSDL, ]
Possible solutions: resolve(java.lang.Object)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
    at com.predic8.soamodel.AbstractParser.getResourceToken(AbstractParser.groovy:47)
    at com.predic8.soamodel.AbstractParser.this$2$getResourceToken(AbstractParser.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.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
    at com.predic8.soamodel.AbstractParser.parse(AbstractParser.groovy:35)
    at com.predic8.wsdl.WSDLParser.super$2$parse(WSDLParser.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.invokeMethod(MetaClassImpl.java:1215)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
    at com.predic8.wsdl.WSDLParser.parse(WSDLParser.groovy:24)
    at test.Test.main(Test.java:21)
Reply all
Reply to author
Forward
0 new messages