Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10313

Call web service in CLM script

$
0
0

Dear all,

 

I'm working on a script where I need to call a WebService. We are using SAP soursing 9 on the project so I can't use Axis and I need to use CXF.

The WSDL for the WebService is protected with an Http authentication.

 

Locally I can run the script by using the Authenticator object, after that I get the error listed bellow. On the CLM environement I can't use this kind of authentication (failled to import the librairy).

 

I'm stacking with the following issues :

 

HTTP Authentification :

 

Locally by using a Java IDE I can call the service after using :

Authenticator.setDefault(new Authenticator()

                              {

                                        @Override

                                        protected PasswordAuthentication getPasswordAuthentication() {

                                                  return new PasswordAuthentication(username, password.toCharArray());

                                        }

                              });

 

I try to use the Dynamic client factory but the following error is sent back :

java.lang.IllegalStateException: Unable to create JAXBContext for generated packages: "com.sap.document.sap.soap.functions.mc_style" doesnt contain ObjectFactory.class or jaxb.index

          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:356)

          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:204)

          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:197)

          at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:152)

          at src.main.zzzMain.main(zzzMain.java:81)

Caused by: javax.xml.bind.JAXBException: "com.sap.document.sap.soap.functions.mc_style" doesnt contain ObjectFactory.class or jaxb.index

 

 

Dynamic Client Factory :

 

                              JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();

                              Client client = dcf.createClient(wsdlHTTP);

                              Object[] res = client.invoke("urn:ZfclCheckContractAccass01");

 

 

Someone have an idea how to solve this issue ? Or If someone have an example how to contact a webservice with a CLM script ?

 

Regards,

 

Mathieu


Viewing all articles
Browse latest Browse all 10313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>