webservice动态调用JaxWsDynamicClientFactory,should be of type, not java.lang.String

webservice的客户端动态远程调用,报异常:java.lang.IllegalArgumentException: Part {http://****}sendSmsRequest should be of type *.*.*SendSmsRequest, not java.lang.String

具体代码:

JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
 Client client1 = factory.createClient("http://***?wsdl");
 //处理 WebService接口和实现类namespace不同的情况// CXF动态客户端在处理此问题时,会报No operation was found with the name的异常
 Endpoint endpoint = client1.getEndpoint();
 String operation="sendSms";
 QName opName = new QName(endpoint.getService().getName().getNamespaceURI(), operation);
 BindingInfo bindingInfo = endpoint.getEndpointInfo().getBinding();
 if (bindingInfo.getOperation(opName) == null) {
     for (BindingOperationInfo operationInfo : bindingInfo.getOperations()) {
         if (operation.equals(operationInfo.getName().getLocalPart())) {
             opName = operationInfo.getName();
             break;
         }
     }
 }

 Object[] objects1 = null;
// String jsonString=
 try {
     objects1 = client1.invoke(opName, "**", "**", "**", "", "**");
 } catch (Exception e) {
     e.printStackTrace();
 }

wsdl:


   
     
     
     
     
     
     
     
     
     

   

   

 

麻烦帮忙查看

 

 

你可能感兴趣的:(webservice动态调用JaxWsDynamicClientFactory,should be of type, not java.lang.String)