File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Error on Client ws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Error on Client ws" Watch "Error on Client ws" New topic
Author

Error on Client ws

Herzon Guevara
Greenhorn

Joined: Sep 06, 2013
Posts: 1
Hi!
I tried make a client ws using jax ws, but in the code don't run. I test de request(the same request is built in de code) in Soap Ui and the request is funtional in this tool.

The code is:

String qnameService = "updateServiceService";
String portTypeName = "updateService";
String BODY_NAMESPACE_VALUE = "http://batch/service";
String usuarioWS = usuarioConexion;
String passwordWS = passwordConexion;
String qnamePort = "http://localhostnumberofport)/BatchWebApp/servicio/updateService.wsdl";

QName serviceName = new QName(BODY_NAMESPACE_VALUE,qnameService);
QName portName = new QName(BODY_NAMESPACE_VALUE, portTypeName);

Service service = Service.create(serviceName);
service.addPort(portName, SOAPBinding.SOAP11HTTP_MTOM_BINDING, qnamePort);

Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);

BindingProvider bp = (BindingProvider) dispatch;
MessageFactory mf = ((SOAPBinding) bp.getBinding()).getMessageFactory();

SOAPMessage request = mf.createMessage();
SOAPPart part = request.getSOAPPart();

SOAPEnvelope env = part.getEnvelope();
SOAPHeader header = env.getHeader();
SOAPBody body = env.getBody();

header.addChildElement("user","","http://batch/service").addTextNode(usuarioWS);
header.addChildElement("password","","http://batch/service").addTextNode(passwordWS);

body.addChildElement(nombreDelParametro,"","").addTextNode(valorDelParametro);

SOAPMessage response = dispatch.invoke(request);
String respuesta = response.getSOAPPart().getDocumentElement().getChildNodes().item(0).getNextSibling().getChildNodes().item(0).getChildNodes().item(0).getTextContent();

The error is the next::

Could not save changes; nested exception is javax.xml.soap.SOAPException: Error getting parts count from MimeMultiPart Message:
javax.xml.ws.soap.SOAPFaultException: Could not save changes; nested exception is javax.xml.soap.SOAPException: Error getting parts count from MimeMultiPart Message:
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:176)
at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:195)
at Principal.main(Principal.java:166)

Other:
Ws using spring ws
Server: Weblogic 10
jdk 6
Client: jax-ws


Tks for your help!.

 
 
subject: Error on Client ws
 
Similar Threads
dii client problems..help!
Running a DII client through JSP
Content is not allowed in prolog
JAX-WS Client - Unsupported Content-Type issue
WebServiceProvider annotation